@projectwallace/css-parser 0.18.8 → 0.18.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +186 -18
  2. package/dist/{arena-e9O_g2AN.js → arena-Bsf96CQK.js} +27 -19
  3. package/dist/{arena-BGvFdbj5.d.ts → arena-DvT75bvK.d.ts} +2 -0
  4. package/dist/constants.d.ts +1 -1
  5. package/dist/constants.js +1 -1
  6. package/dist/{css-node-CH5HqF0J.js → css-node-yoUdFtNg.js} +101 -106
  7. package/dist/index.d.ts +6 -20
  8. package/dist/index.js +9 -146
  9. package/dist/{node-types-YnOKcNfU.d.ts → node-types-DG8OKqPu.d.ts} +8 -54
  10. package/dist/node-types.d.ts +2 -0
  11. package/dist/node-types.js +142 -0
  12. package/dist/parse-anplusb.d.ts +2 -2
  13. package/dist/parse-anplusb.js +5 -4
  14. package/dist/parse-atrule-prelude.d.ts +4 -3
  15. package/dist/parse-atrule-prelude.js +82 -77
  16. package/dist/parse-declaration.d.ts +4 -3
  17. package/dist/parse-declaration.js +28 -26
  18. package/dist/parse-dimension.js +46 -1
  19. package/dist/{parse-selector-PhqFezCi.js → parse-selector-CqIpnBrQ.js} +74 -89
  20. package/dist/parse-selector.d.ts +2 -2
  21. package/dist/parse-selector.js +1 -2
  22. package/dist/parse-value.d.ts +2 -2
  23. package/dist/parse-value.js +8 -8
  24. package/dist/parse.d.ts +3 -3
  25. package/dist/parse.js +49 -47
  26. package/dist/string-helpers-BMWJduts.d.ts +18 -0
  27. package/dist/string-helpers.d.ts +2 -0
  28. package/dist/string-helpers.js +1 -0
  29. package/dist/{parse-dimension-CQELWb5z.js → string-utils-DiRRd28d.js} +9 -59
  30. package/dist/token-types-Bqsf5FX-.d.ts +38 -0
  31. package/dist/token-types.d.ts +2 -0
  32. package/dist/token-types.js +30 -0
  33. package/dist/{tokenize-BYl6GvyV.js → tokenize-Ccg58Z_k.js} +79 -96
  34. package/dist/tokenize.d.ts +97 -2
  35. package/dist/tokenize.js +1 -2
  36. package/dist/{value-node-parser-tjY982sG.js → value-node-parser-D0qnA_bD.js} +153 -219
  37. package/dist/walk.d.ts +3 -2
  38. package/dist/walk.js +2 -2
  39. package/package.json +29 -18
  40. package/dist/tokenize-CDEnYcVG.d.ts +0 -133
package/dist/parse.js CHANGED
@@ -1,11 +1,12 @@
1
- import { t as Lexer } from "./tokenize-BYl6GvyV.js";
2
- import { l as CSSDataArena } from "./arena-e9O_g2AN.js";
3
- import { t as CSSNode } from "./css-node-CH5HqF0J.js";
4
- import { a as skip_whitespace_and_comments_backward, s as trim_boundaries, t as SelectorParser } from "./parse-selector-PhqFezCi.js";
1
+ import { t as Lexer } from "./tokenize-Ccg58Z_k.js";
2
+ import "./token-types.js";
3
+ import { l as CSSDataArena } from "./arena-Bsf96CQK.js";
4
+ import { t as CSSNode } from "./css-node-yoUdFtNg.js";
5
+ import { a as skip_whitespace_and_comments_backward, o as skip_whitespace_and_comments_forward, t as SelectorParser } from "./parse-selector-CqIpnBrQ.js";
5
6
  import { AtRulePreludeParser } from "./parse-atrule-prelude.js";
6
7
  import { DeclarationParser } from "./parse-declaration.js";
7
8
  //#region src/parse.ts
8
- let DECLARATION_AT_RULES = /* @__PURE__ */ new Set([
9
+ const DECLARATION_AT_RULES = /* @__PURE__ */ new Set([
9
10
  "font-face",
10
11
  "font-feature-values",
11
12
  "page",
@@ -29,12 +30,12 @@ var Parser = class {
29
30
  parse_atrule_preludes_enabled;
30
31
  constructor(source, options) {
31
32
  this.source = source;
32
- let opts = options || {};
33
+ const opts = options || {};
33
34
  this.parse_values_enabled = opts.parse_values ?? true;
34
35
  this.parse_selectors_enabled = opts.parse_selectors ?? true;
35
36
  this.parse_atrule_preludes_enabled = opts.parse_atrule_preludes ?? true;
36
37
  this.lexer = new Lexer(source, opts.on_comment);
37
- let capacity = CSSDataArena.capacity_for_source(source.length);
38
+ const capacity = CSSDataArena.capacity_for_source(source.length);
38
39
  this.arena = new CSSDataArena(capacity);
39
40
  this.selector_parser = this.parse_selectors_enabled ? new SelectorParser(this.arena, source) : null;
40
41
  this.prelude_parser = this.parse_atrule_preludes_enabled ? new AtRulePreludeParser(this.arena, source) : null;
@@ -57,11 +58,11 @@ var Parser = class {
57
58
  }
58
59
  parse() {
59
60
  this.next_token();
60
- let stylesheet = this.arena.create_node(1, 0, this.source.length, 1, 1);
61
+ const stylesheet = this.arena.create_node(1, 0, this.source.length, 1, 1);
61
62
  let first_rule = 0;
62
63
  let last_rule = 0;
63
64
  while (!this.is_eof()) {
64
- let rule = this.parse_rule();
65
+ const rule = this.parse_rule();
65
66
  if (rule === null) this.next_token();
66
67
  else {
67
68
  if (first_rule === 0) first_rule = rule;
@@ -82,7 +83,7 @@ var Parser = class {
82
83
  let first_child = 0;
83
84
  let last_child = 0;
84
85
  while (!this.is_eof()) {
85
- let token_type = this.peek_type();
86
+ const token_type = this.peek_type();
86
87
  if (token_type === 24) break;
87
88
  let child = null;
88
89
  if (!declarations_only && token_type === 3) {
@@ -107,19 +108,19 @@ var Parser = class {
107
108
  }
108
109
  parse_style_rule() {
109
110
  if (this.is_eof()) return null;
110
- let rule_start = this.lexer.token_start;
111
- let rule_line = this.lexer.token_line;
112
- let rule_column = this.lexer.token_column;
113
- let style_rule = this.arena.create_node(2, rule_start, 0, rule_line, rule_column);
114
- let selector = this.parse_selector();
111
+ const rule_start = this.lexer.token_start;
112
+ const rule_line = this.lexer.token_line;
113
+ const rule_column = this.lexer.token_column;
114
+ const style_rule = this.arena.create_node(2, rule_start, 0, rule_line, rule_column);
115
+ const selector = this.parse_selector();
115
116
  if (this.peek_type() !== 23) return null;
116
- let block_start = this.lexer.token_end;
117
+ const block_start = this.lexer.token_end;
117
118
  this.next_token();
118
119
  this.arena.set_flag(style_rule, 8);
119
- let block_line = this.lexer.token_line;
120
- let block_column = this.lexer.token_column;
121
- let block_node = this.arena.create_node(7, block_start, 0, block_line, block_column);
122
- let first_child = this.parse_block_children(style_rule, false);
120
+ const block_line = this.lexer.token_line;
121
+ const block_column = this.lexer.token_column;
122
+ const block_node = this.arena.create_node(7, block_start, 0, block_line, block_column);
123
+ const first_child = this.parse_block_children(style_rule, false);
123
124
  let block_end = this.lexer.token_start;
124
125
  let rule_end = this.lexer.token_end;
125
126
  if (this.peek_type() === 24) {
@@ -139,9 +140,9 @@ var Parser = class {
139
140
  }
140
141
  parse_selector() {
141
142
  if (this.is_eof()) return null;
142
- let selector_start = this.lexer.token_start;
143
- let selector_line = this.lexer.token_line;
144
- let selector_column = this.lexer.token_column;
143
+ const selector_start = this.lexer.token_start;
144
+ const selector_line = this.lexer.token_line;
145
+ const selector_column = this.lexer.token_column;
145
146
  let last_end = this.lexer.token_end;
146
147
  if (this.peek_type() !== 23) {
147
148
  this.lexer.skip_to_unquoted(123);
@@ -149,10 +150,10 @@ var Parser = class {
149
150
  this.next_token();
150
151
  }
151
152
  if (this.parse_selectors_enabled && this.selector_parser) {
152
- let selector = this.selector_parser.parse_selector(selector_start, last_end, selector_line, selector_column);
153
+ const selector = this.selector_parser.parse_selector(selector_start, last_end, selector_line, selector_column);
153
154
  if (selector !== null) return selector;
154
155
  }
155
- let node_type = this.parse_selectors_enabled ? 20 : 8;
156
+ const node_type = this.parse_selectors_enabled ? 20 : 8;
156
157
  return this.arena.create_node(node_type, selector_start, last_end - selector_start, selector_line, selector_column);
157
158
  }
158
159
  parse_declaration() {
@@ -165,21 +166,21 @@ var Parser = class {
165
166
  }
166
167
  parse_atrule() {
167
168
  if (this.peek_type() !== 3) return null;
168
- let at_rule_start = this.lexer.token_start;
169
- let at_rule_line = this.lexer.token_line;
170
- let at_rule_column = this.lexer.token_column;
171
- let name_start = this.lexer.token_start + 1;
172
- let name_length = this.lexer.token_end - name_start;
173
- let at_rule_name = this.source.substring(name_start, this.lexer.token_end);
169
+ const at_rule_start = this.lexer.token_start;
170
+ const at_rule_line = this.lexer.token_line;
171
+ const at_rule_column = this.lexer.token_column;
172
+ const name_start = this.lexer.token_start + 1;
173
+ const name_length = this.lexer.token_end - name_start;
174
+ const at_rule_name = this.source.substring(name_start, this.lexer.token_end);
174
175
  this.next_token();
175
- let at_rule = this.arena.create_node(3, at_rule_start, 0, at_rule_line, at_rule_column);
176
+ const at_rule = this.arena.create_node(3, at_rule_start, 0, at_rule_line, at_rule_column);
176
177
  this.arena.set_content_start_delta(at_rule, name_start - at_rule_start);
177
178
  this.arena.set_content_length(at_rule, name_length);
178
- let prelude_start = this.lexer.token_start;
179
+ const prelude_start = this.lexer.token_start;
179
180
  let prelude_end = prelude_start;
180
181
  let paren_depth = 0;
181
182
  while (!this.is_eof()) {
182
- let token_type = this.peek_type();
183
+ const token_type = this.peek_type();
183
184
  if (token_type === 21 || token_type === 2) paren_depth++;
184
185
  else if (token_type === 22) paren_depth--;
185
186
  if (token_type === 23 && paren_depth === 0) break;
@@ -187,29 +188,30 @@ var Parser = class {
187
188
  prelude_end = this.lexer.token_end;
188
189
  this.next_token();
189
190
  }
190
- let trimmed = trim_boundaries(this.source, prelude_start, prelude_end);
191
+ const trimmed_start = skip_whitespace_and_comments_forward(this.source, prelude_start, prelude_end);
192
+ const trimmed_end = skip_whitespace_and_comments_backward(this.source, prelude_end, trimmed_start);
191
193
  let prelude_wrapper = null;
192
- if (trimmed) {
194
+ if (trimmed_start < trimmed_end) {
193
195
  if (this.prelude_parser) {
194
- let prelude_nodes = this.prelude_parser.parse_prelude(at_rule_name, trimmed[0], trimmed[1], at_rule_line, at_rule_column);
196
+ const prelude_nodes = this.prelude_parser.parse_prelude(at_rule_name, trimmed_start, trimmed_end, at_rule_line, at_rule_column);
195
197
  if (prelude_nodes.length > 0) {
196
- prelude_wrapper = this.arena.create_node(40, trimmed[0], trimmed[1] - trimmed[0], at_rule_line, at_rule_column);
198
+ prelude_wrapper = this.arena.create_node(40, trimmed_start, trimmed_end - trimmed_start, at_rule_line, at_rule_column);
197
199
  this.arena.append_children(prelude_wrapper, prelude_nodes);
198
- } else prelude_wrapper = this.arena.create_node(8, trimmed[0], trimmed[1] - trimmed[0], at_rule_line, at_rule_column);
199
- } else prelude_wrapper = this.arena.create_node(8, trimmed[0], trimmed[1] - trimmed[0], at_rule_line, at_rule_column);
200
+ } else prelude_wrapper = this.arena.create_node(8, trimmed_start, trimmed_end - trimmed_start, at_rule_line, at_rule_column);
201
+ } else prelude_wrapper = this.arena.create_node(8, trimmed_start, trimmed_end - trimmed_start, at_rule_line, at_rule_column);
200
202
  }
201
203
  let last_end = this.lexer.token_end;
202
204
  if (this.peek_type() === 23) {
203
- let block_start = this.lexer.token_end;
205
+ const block_start = this.lexer.token_end;
204
206
  this.next_token();
205
207
  this.arena.set_flag(at_rule, 8);
206
- let block_line = this.lexer.token_line;
207
- let block_column = this.lexer.token_column;
208
- let block_node = this.arena.create_node(7, block_start, 0, block_line, block_column);
209
- let declarations_only = this.atrule_has_declarations(at_rule_name);
210
- let first_child = this.parse_block_children(at_rule, declarations_only);
208
+ const block_line = this.lexer.token_line;
209
+ const block_column = this.lexer.token_column;
210
+ const block_node = this.arena.create_node(7, block_start, 0, block_line, block_column);
211
+ const declarations_only = this.atrule_has_declarations(at_rule_name);
212
+ const first_child = this.parse_block_children(at_rule, declarations_only);
211
213
  if (this.peek_type() === 24) {
212
- let block_end = this.lexer.token_start;
214
+ const block_end = this.lexer.token_start;
213
215
  last_end = this.lexer.token_end;
214
216
  this.next_token();
215
217
  this.arena.set_length(block_node, block_end - block_start);
@@ -0,0 +1,18 @@
1
+ //#region src/string-utils.d.ts
2
+ /**
3
+ * @param a Base string, MUST be lowercase!
4
+ * @param b Compare string
5
+ */
6
+ declare function str_equals(a: string, b: string): boolean;
7
+ /** Case-insensitive ASCII prefix check without allocations. `prefix` MUST be lowercase. */
8
+ declare function str_starts_with(str: string, prefix: string): boolean;
9
+ /** Case-insensitive substring search without allocations, or -1 if not found. `searchChar` MUST be lowercase. */
10
+ declare function str_index_of(str: string, searchChar: string): number;
11
+ /** True if the string/range is vendor-prefixed (-webkit-, -moz-, -ms-, -o-). `--custom-property` is not. */
12
+ declare function is_vendor_prefixed(text: string): boolean;
13
+ declare function is_vendor_prefixed(source: string, start: number, end: number): boolean;
14
+ /** True if the string is a CSS custom property (starts with `--`). */
15
+ declare function is_custom(str: string): boolean;
16
+ declare function strip_vendor_prefix(str: string): string;
17
+ //#endregion
18
+ export { str_starts_with as a, str_index_of as i, is_vendor_prefixed as n, strip_vendor_prefix as o, str_equals as r, is_custom as t };
@@ -0,0 +1,2 @@
1
+ import { a as str_starts_with, i as str_index_of, n as is_vendor_prefixed, o as strip_vendor_prefix, r as str_equals, t as is_custom } from "./string-helpers-BMWJduts.js";
2
+ export { is_custom, is_vendor_prefixed, str_equals, str_index_of, str_starts_with, strip_vendor_prefix };
@@ -0,0 +1 @@
1
+ export { r as is_custom, a as is_vendor_prefixed, s as str_equals, l as str_index_of, u as str_starts_with, d as strip_vendor_prefix } from "./string-utils-DiRRd28d.js";
@@ -1,7 +1,3 @@
1
- /**
2
- * Check if a character code is whitespace (space, tab, newline, CR, or FF)
3
- * @internal
4
- */
5
1
  function is_whitespace(ch) {
6
2
  return ch === 32 || ch === 9 || ch === 10 || ch === 13 || ch === 12;
7
3
  }
@@ -9,7 +5,6 @@ function is_whitespace(ch) {
9
5
  function is_combinator(ch) {
10
6
  return ch === 62 || ch === 43 || ch === 126;
11
7
  }
12
- /** @internal */
13
8
  function is_digit(ch) {
14
9
  return ch >= 48 && ch <= 57;
15
10
  }
@@ -20,18 +15,13 @@ function is_digit(ch) {
20
15
  function str_equals(a, b) {
21
16
  if (a.length !== b.length) return false;
22
17
  for (let i = 0; i < a.length; i++) {
23
- let ca = a.charCodeAt(i);
18
+ const ca = a.charCodeAt(i);
24
19
  let cb = b.charCodeAt(i);
25
20
  cb |= 32;
26
21
  if (ca !== cb) return false;
27
22
  }
28
23
  return true;
29
24
  }
30
- /**
31
- * Case-insensitive equality between `source[start, end)` and `literal`, without allocating
32
- * a substring first. Same semantics as `str_equals(literal, source.substring(start, end))`.
33
- * `literal` MUST be lowercase.
34
- */
35
25
  function str_equals_range(source, start, end, literal) {
36
26
  if (end - start !== literal.length) return false;
37
27
  for (let i = 0; i < literal.length; i++) {
@@ -41,12 +31,17 @@ function str_equals_range(source, start, end, literal) {
41
31
  }
42
32
  return true;
43
33
  }
34
+ function is_and_or_not_range(source, start, end) {
35
+ const length = end - start;
36
+ if (length === 3) return str_equals_range(source, start, end, "and") || str_equals_range(source, start, end, "not");
37
+ return length === 2 && str_equals_range(source, start, end, "or");
38
+ }
44
39
  /** Case-insensitive ASCII prefix check without allocations. `prefix` MUST be lowercase. */
45
40
  function str_starts_with(str, prefix) {
46
41
  if (str.length < prefix.length) return false;
47
42
  for (let i = 0; i < prefix.length; i++) {
48
43
  let ca = str.charCodeAt(i);
49
- let cb = prefix.charCodeAt(i);
44
+ const cb = prefix.charCodeAt(i);
50
45
  if (ca >= 65 && ca <= 90) ca |= 32;
51
46
  if (ca !== cb) return false;
52
47
  }
@@ -68,7 +63,7 @@ function str_index_of(str, searchChar) {
68
63
  let match = true;
69
64
  for (let j = 0; j < searchChar.length; j++) {
70
65
  let ca = str.charCodeAt(i + j);
71
- let cb = searchChar.charCodeAt(j);
66
+ const cb = searchChar.charCodeAt(j);
72
67
  if (ca >= 65 && ca <= 90) ca |= 32;
73
68
  if (ca !== cb) {
74
69
  match = false;
@@ -95,55 +90,10 @@ function is_custom(str) {
95
90
  if (str.length < 3) return false;
96
91
  return str.charCodeAt(0) === 45 && str.charCodeAt(1) === 45;
97
92
  }
98
- /** Strip a vendor prefix, e.g. `-webkit-keyframes` → `keyframes`. Returns the input unchanged if it has no prefix. */
99
93
  function strip_vendor_prefix(str) {
100
94
  if (!is_vendor_prefixed(str)) return str;
101
95
  for (let i = 2; i < str.length; i++) if (str.charCodeAt(i) === 45) return str.substring(i + 1);
102
96
  return str;
103
97
  }
104
98
  //#endregion
105
- //#region src/parse-dimension.ts
106
- /**
107
- * Find where a dimension's numeric part ends, e.g. 3 for "100px" or 2 for "2%".
108
- * No allocation — callers that only need `value` or only `unit` can slice just
109
- * the part they want instead of going through `parse_dimension`'s object + two
110
- * substrings for both.
111
- * @internal
112
- */
113
- function dimension_number_end(text) {
114
- let num_end = 0;
115
- for (let i = 0; i < text.length; i++) {
116
- let ch = text.charCodeAt(i);
117
- if (ch === 101 || ch === 69) {
118
- if (i + 1 < text.length) {
119
- let next_ch = text.charCodeAt(i + 1);
120
- if (is_digit(next_ch)) {
121
- num_end = i + 1;
122
- continue;
123
- }
124
- if ((next_ch === 43 || next_ch === 45) && i + 2 < text.length) {
125
- if (is_digit(text.charCodeAt(i + 2))) {
126
- num_end = i + 1;
127
- continue;
128
- }
129
- }
130
- }
131
- break;
132
- }
133
- if (is_digit(ch) || ch === 46 || ch === 45 || ch === 43) num_end = i + 1;
134
- else break;
135
- }
136
- return num_end;
137
- }
138
- /** Parse a dimension string into value and unit, e.g. "100px" → { value: 100, unit: "px" } or "2%" → { value: 2, unit: "%" } */
139
- function parse_dimension(text) {
140
- let num_end = dimension_number_end(text);
141
- let num_str = text.substring(0, num_end);
142
- let unit = text.substring(num_end);
143
- return {
144
- value: num_str ? Number.parseFloat(num_str) : 0,
145
- unit
146
- };
147
- }
148
- //#endregion
149
- export { is_vendor_prefixed as a, str_equals_range as c, strip_vendor_prefix as d, is_custom as i, str_index_of as l, parse_dimension as n, is_whitespace as o, is_combinator as r, str_equals as s, dimension_number_end as t, str_starts_with as u };
99
+ export { is_vendor_prefixed as a, str_equals_range as c, strip_vendor_prefix as d, is_digit as i, str_index_of as l, is_combinator as n, is_whitespace as o, is_custom as r, str_equals as s, is_and_or_not_range as t, str_starts_with as u };
@@ -0,0 +1,38 @@
1
+ //#region src/token-types.d.ts
2
+ declare const TOKEN_IDENT = 1;
3
+ declare const TOKEN_FUNCTION = 2;
4
+ declare const TOKEN_AT_KEYWORD = 3;
5
+ declare const TOKEN_HASH = 4;
6
+ declare const TOKEN_STRING = 5;
7
+ declare const TOKEN_BAD_STRING = 6;
8
+ declare const TOKEN_URL = 7;
9
+ declare const TOKEN_BAD_URL = 8;
10
+ declare const TOKEN_DELIM = 9;
11
+ declare const TOKEN_NUMBER = 10;
12
+ declare const TOKEN_PERCENTAGE = 11;
13
+ declare const TOKEN_DIMENSION = 12;
14
+ declare const TOKEN_WHITESPACE = 13;
15
+ declare const TOKEN_CDO = 14;
16
+ declare const TOKEN_CDC = 15;
17
+ declare const TOKEN_COLON = 16;
18
+ declare const TOKEN_SEMICOLON = 17;
19
+ declare const TOKEN_COMMA = 18;
20
+ declare const TOKEN_LEFT_BRACKET = 19;
21
+ declare const TOKEN_RIGHT_BRACKET = 20;
22
+ declare const TOKEN_LEFT_PAREN = 21;
23
+ declare const TOKEN_RIGHT_PAREN = 22;
24
+ declare const TOKEN_LEFT_BRACE = 23;
25
+ declare const TOKEN_RIGHT_BRACE = 24;
26
+ declare const TOKEN_COMMENT = 25;
27
+ declare const TOKEN_EOF = 26;
28
+ declare const TOKEN_UNICODE_RANGE = 27;
29
+ type TokenType = typeof TOKEN_IDENT | typeof TOKEN_FUNCTION | typeof TOKEN_AT_KEYWORD | typeof TOKEN_HASH | typeof TOKEN_STRING | typeof TOKEN_BAD_STRING | typeof TOKEN_URL | typeof TOKEN_BAD_URL | typeof TOKEN_DELIM | typeof TOKEN_NUMBER | typeof TOKEN_PERCENTAGE | typeof TOKEN_DIMENSION | typeof TOKEN_WHITESPACE | typeof TOKEN_CDO | typeof TOKEN_CDC | typeof TOKEN_COLON | typeof TOKEN_SEMICOLON | typeof TOKEN_COMMA | typeof TOKEN_LEFT_BRACKET | typeof TOKEN_RIGHT_BRACKET | typeof TOKEN_LEFT_PAREN | typeof TOKEN_RIGHT_PAREN | typeof TOKEN_LEFT_BRACE | typeof TOKEN_RIGHT_BRACE | typeof TOKEN_COMMENT | typeof TOKEN_EOF | typeof TOKEN_UNICODE_RANGE;
30
+ type Token = {
31
+ type: TokenType;
32
+ start: number;
33
+ end: number;
34
+ line: number;
35
+ column: number;
36
+ };
37
+ //#endregion
38
+ export { TOKEN_SEMICOLON as C, TOKEN_WHITESPACE as D, TOKEN_URL as E, Token as O, TOKEN_RIGHT_PAREN as S, TOKEN_UNICODE_RANGE as T, TOKEN_LEFT_PAREN as _, TOKEN_CDO as a, TOKEN_RIGHT_BRACE as b, TOKEN_COMMENT as c, TOKEN_EOF as d, TOKEN_FUNCTION as f, TOKEN_LEFT_BRACKET as g, TOKEN_LEFT_BRACE as h, TOKEN_CDC as i, TokenType as k, TOKEN_DELIM as l, TOKEN_IDENT as m, TOKEN_BAD_STRING as n, TOKEN_COLON as o, TOKEN_HASH as p, TOKEN_BAD_URL as r, TOKEN_COMMA as s, TOKEN_AT_KEYWORD as t, TOKEN_DIMENSION as u, TOKEN_NUMBER as v, TOKEN_STRING as w, TOKEN_RIGHT_BRACKET as x, TOKEN_PERCENTAGE as y };
@@ -0,0 +1,2 @@
1
+ import { C as TOKEN_SEMICOLON, D as TOKEN_WHITESPACE, E as TOKEN_URL, O as Token, S as TOKEN_RIGHT_PAREN, T as TOKEN_UNICODE_RANGE, _ as TOKEN_LEFT_PAREN, a as TOKEN_CDO, b as TOKEN_RIGHT_BRACE, c as TOKEN_COMMENT, d as TOKEN_EOF, f as TOKEN_FUNCTION, g as TOKEN_LEFT_BRACKET, h as TOKEN_LEFT_BRACE, i as TOKEN_CDC, k as TokenType, l as TOKEN_DELIM, m as TOKEN_IDENT, n as TOKEN_BAD_STRING, o as TOKEN_COLON, p as TOKEN_HASH, r as TOKEN_BAD_URL, s as TOKEN_COMMA, t as TOKEN_AT_KEYWORD, u as TOKEN_DIMENSION, v as TOKEN_NUMBER, w as TOKEN_STRING, x as TOKEN_RIGHT_BRACKET, y as TOKEN_PERCENTAGE } from "./token-types-Bqsf5FX-.js";
2
+ export { TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, Token, TokenType };
@@ -0,0 +1,30 @@
1
+ //#region src/token-types.ts
2
+ const TOKEN_IDENT = 1;
3
+ const TOKEN_FUNCTION = 2;
4
+ const TOKEN_AT_KEYWORD = 3;
5
+ const TOKEN_HASH = 4;
6
+ const TOKEN_STRING = 5;
7
+ const TOKEN_BAD_STRING = 6;
8
+ const TOKEN_URL = 7;
9
+ const TOKEN_BAD_URL = 8;
10
+ const TOKEN_DELIM = 9;
11
+ const TOKEN_NUMBER = 10;
12
+ const TOKEN_PERCENTAGE = 11;
13
+ const TOKEN_DIMENSION = 12;
14
+ const TOKEN_WHITESPACE = 13;
15
+ const TOKEN_CDO = 14;
16
+ const TOKEN_CDC = 15;
17
+ const TOKEN_COLON = 16;
18
+ const TOKEN_SEMICOLON = 17;
19
+ const TOKEN_COMMA = 18;
20
+ const TOKEN_LEFT_BRACKET = 19;
21
+ const TOKEN_RIGHT_BRACKET = 20;
22
+ const TOKEN_LEFT_PAREN = 21;
23
+ const TOKEN_RIGHT_PAREN = 22;
24
+ const TOKEN_LEFT_BRACE = 23;
25
+ const TOKEN_RIGHT_BRACE = 24;
26
+ const TOKEN_COMMENT = 25;
27
+ const TOKEN_EOF = 26;
28
+ const TOKEN_UNICODE_RANGE = 27;
29
+ //#endregion
30
+ export { TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE };