aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
commitafa87af01c79a9baa539f2992d32154d2a4739bd (patch)
tree92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs
parent3b927e84d200402281f68181cd4253bc77e5528d (diff)
downloadneko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.gz
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.bz2
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.zip
task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq
Diffstat (limited to 'vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs')
-rw-r--r--vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs74
1 files changed, 0 insertions, 74 deletions
diff --git a/vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs b/vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs
deleted file mode 100644
index 4de5ab3..0000000
--- a/vanilla/node_modules/css-tree/cjs/parser/SyntaxError.cjs
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-const createCustomError = require('../utils/create-custom-error.cjs');
-
-const MAX_LINE_LENGTH = 100;
-const OFFSET_CORRECTION = 60;
-const TAB_REPLACEMENT = ' ';
-
-function sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {
- function processLines(start, end) {
- return lines
- .slice(start, end)
- .map((line, idx) =>
- String(start + idx + 1).padStart(maxNumLength) + ' |' + line
- ).join('\n');
- }
-
- const prelines = '\n'.repeat(Math.max(baseLine - 1, 0));
- const precolumns = ' '.repeat(Math.max(baseColumn - 1, 0));
- const lines = (prelines + precolumns + source).split(/\r\n?|\n|\f/);
- const startLine = Math.max(1, line - extraLines) - 1;
- const endLine = Math.min(line + extraLines, lines.length + 1);
- const maxNumLength = Math.max(4, String(endLine).length) + 1;
- let cutLeft = 0;
-
- // column correction according to replaced tab before column
- column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;
-
- if (column > MAX_LINE_LENGTH) {
- cutLeft = column - OFFSET_CORRECTION + 3;
- column = OFFSET_CORRECTION - 2;
- }
-
- for (let i = startLine; i <= endLine; i++) {
- if (i >= 0 && i < lines.length) {
- lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
- lines[i] =
- (cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
- lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
- (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
- }
- }
-
- return [
- processLines(startLine, line),
- new Array(column + maxNumLength + 2).join('-') + '^',
- processLines(line, endLine)
- ].filter(Boolean)
- .join('\n')
- .replace(/^(\s+\d+\s+\|\n)+/, '')
- .replace(/\n(\s+\d+\s+\|)+$/, '');
-}
-
-function SyntaxError(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {
- const error = Object.assign(createCustomError.createCustomError('SyntaxError', message), {
- source,
- offset,
- line,
- column,
- sourceFragment(extraLines) {
- return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);
- },
- get formattedMessage() {
- return (
- `Parse error: ${message}\n` +
- sourceFragment({ source, line, column, baseLine, baseColumn }, 2)
- );
- }
- });
-
- return error;
-}
-
-exports.SyntaxError = SyntaxError;