diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:46:37 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:46:37 -0800 |
| commit | afa87af01c79a9baa539f2992d32154d2a4739bd (patch) | |
| tree | 92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs | |
| parent | 3b927e84d200402281f68181cd4253bc77e5528d (diff) | |
| download | neko-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/tokenizer/OffsetToLocation.cjs')
| -rw-r--r-- | vanilla/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/vanilla/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs b/vanilla/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs deleted file mode 100644 index 18b7f7c..0000000 --- a/vanilla/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const adoptBuffer = require('./adopt-buffer.cjs'); -const charCodeDefinitions = require('./char-code-definitions.cjs'); - -const N = 10; -const F = 12; -const R = 13; - -function computeLinesAndColumns(host) { - const source = host.source; - const sourceLength = source.length; - const startOffset = source.length > 0 ? charCodeDefinitions.isBOM(source.charCodeAt(0)) : 0; - const lines = adoptBuffer.adoptBuffer(host.lines, sourceLength); - const columns = adoptBuffer.adoptBuffer(host.columns, sourceLength); - let line = host.startLine; - let column = host.startColumn; - - for (let i = startOffset; i < sourceLength; i++) { - const code = source.charCodeAt(i); - - lines[i] = line; - columns[i] = column++; - - if (code === N || code === R || code === F) { - if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) { - i++; - lines[i] = line; - columns[i] = column; - } - - line++; - column = 1; - } - } - - lines[sourceLength] = line; - columns[sourceLength] = column; - - host.lines = lines; - host.columns = columns; - host.computed = true; -} - -class OffsetToLocation { - constructor(source, startOffset, startLine, startColumn) { - this.setSource(source, startOffset, startLine, startColumn); - this.lines = null; - this.columns = null; - } - setSource(source = '', startOffset = 0, startLine = 1, startColumn = 1) { - this.source = source; - this.startOffset = startOffset; - this.startLine = startLine; - this.startColumn = startColumn; - this.computed = false; - } - getLocation(offset, filename) { - if (!this.computed) { - computeLinesAndColumns(this); - } - - return { - source: filename, - offset: this.startOffset + offset, - line: this.lines[offset], - column: this.columns[offset] - }; - } - getLocationRange(start, end, filename) { - if (!this.computed) { - computeLinesAndColumns(this); - } - - return { - source: filename, - start: { - offset: this.startOffset + start, - line: this.lines[start], - column: this.columns[start] - }, - end: { - offset: this.startOffset + end, - line: this.lines[end], - column: this.columns[end] - } - }; - } -} - -exports.OffsetToLocation = OffsetToLocation; |
