summaryrefslogtreecommitdiff
path: root/node_modules/css-tree/lib/definition-syntax/tokenizer.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/css-tree/lib/definition-syntax/tokenizer.js
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/css-tree/lib/definition-syntax/tokenizer.js')
-rw-r--r--node_modules/css-tree/lib/definition-syntax/tokenizer.js52
1 files changed, 0 insertions, 52 deletions
diff --git a/node_modules/css-tree/lib/definition-syntax/tokenizer.js b/node_modules/css-tree/lib/definition-syntax/tokenizer.js
deleted file mode 100644
index 8c392627..00000000
--- a/node_modules/css-tree/lib/definition-syntax/tokenizer.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import { SyntaxError } from './SyntaxError.js';
-
-const TAB = 9;
-const N = 10;
-const F = 12;
-const R = 13;
-const SPACE = 32;
-
-export class Tokenizer {
- constructor(str) {
- this.str = str;
- this.pos = 0;
- }
- charCodeAt(pos) {
- return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
- }
- charCode() {
- return this.charCodeAt(this.pos);
- }
- nextCharCode() {
- return this.charCodeAt(this.pos + 1);
- }
- nextNonWsCode(pos) {
- return this.charCodeAt(this.findWsEnd(pos));
- }
- findWsEnd(pos) {
- for (; pos < this.str.length; pos++) {
- const code = this.str.charCodeAt(pos);
- if (code !== R && code !== N && code !== F && code !== SPACE && code !== TAB) {
- break;
- }
- }
-
- return pos;
- }
- substringToPos(end) {
- return this.str.substring(this.pos, this.pos = end);
- }
- eat(code) {
- if (this.charCode() !== code) {
- this.error('Expect `' + String.fromCharCode(code) + '`');
- }
-
- this.pos++;
- }
- peek() {
- return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
- }
- error(message) {
- throw new SyntaxError(message, this.str, this.pos);
- }
-};