@projectwallace/css-parser 0.6.1 → 0.6.3
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.
- package/dist/arena.d.ts +1 -0
- package/dist/{css-node-CIM4dthB.js → css-node-aIMm9_Cb.js} +2 -1
- package/dist/css-node.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/parse-anplusb.js +1 -1
- package/dist/parse-atrule-prelude.d.ts +1 -0
- package/dist/parse-atrule-prelude.js +31 -79
- package/dist/parse-selector.d.ts +1 -5
- package/dist/parse-selector.js +24 -99
- package/dist/parse-value.d.ts +1 -0
- package/dist/parse-value.js +79 -2
- package/dist/parse.d.ts +1 -1
- package/dist/parse.js +2 -2
- package/package.json +1 -1
package/dist/arena.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const NODE_VALUE_STRING = 13;
|
|
|
12
12
|
export declare const NODE_VALUE_COLOR = 14;
|
|
13
13
|
export declare const NODE_VALUE_FUNCTION = 15;
|
|
14
14
|
export declare const NODE_VALUE_OPERATOR = 16;
|
|
15
|
+
export declare const NODE_VALUE_PARENTHESIS = 17;
|
|
15
16
|
export declare const NODE_SELECTOR_LIST = 20;
|
|
16
17
|
export declare const NODE_SELECTOR_TYPE = 21;
|
|
17
18
|
export declare const NODE_SELECTOR_CLASS = 22;
|
|
@@ -13,6 +13,7 @@ const NODE_VALUE_STRING = 13;
|
|
|
13
13
|
const NODE_VALUE_COLOR = 14;
|
|
14
14
|
const NODE_VALUE_FUNCTION = 15;
|
|
15
15
|
const NODE_VALUE_OPERATOR = 16;
|
|
16
|
+
const NODE_VALUE_PARENTHESIS = 17;
|
|
16
17
|
const NODE_SELECTOR_LIST = 20;
|
|
17
18
|
const NODE_SELECTOR_TYPE = 21;
|
|
18
19
|
const NODE_SELECTOR_CLASS = 22;
|
|
@@ -665,4 +666,4 @@ class CSSNode {
|
|
|
665
666
|
}
|
|
666
667
|
}
|
|
667
668
|
|
|
668
|
-
export {
|
|
669
|
+
export { FLAG_HAS_DECLARATIONS as $, ATTR_OPERATOR_NONE as A, NODE_SELECTOR_ATTRIBUTE as B, CSSNode as C, NODE_SELECTOR_PSEUDO_CLASS as D, NODE_SELECTOR_PSEUDO_ELEMENT as E, NODE_SELECTOR_COMBINATOR as F, NODE_SELECTOR_UNIVERSAL as G, NODE_SELECTOR_NESTING as H, NODE_SELECTOR_NTH as I, NODE_SELECTOR_NTH_OF as J, NODE_SELECTOR_LANG as K, NODE_PRELUDE_MEDIA_QUERY as L, NODE_PRELUDE_MEDIA_FEATURE as M, NODE_STYLE_RULE as N, NODE_PRELUDE_MEDIA_TYPE as O, NODE_PRELUDE_CONTAINER_QUERY as P, NODE_PRELUDE_SUPPORTS_QUERY as Q, NODE_PRELUDE_LAYER_NAME as R, NODE_PRELUDE_IDENTIFIER as S, NODE_PRELUDE_OPERATOR as T, NODE_PRELUDE_IMPORT_URL as U, NODE_PRELUDE_IMPORT_LAYER as V, NODE_PRELUDE_IMPORT_SUPPORTS as W, FLAG_IMPORTANT as X, CSSDataArena as Y, FLAG_HAS_BLOCK as Z, NODE_BLOCK as _, ATTR_OPERATOR_EQUAL as a, is_vendor_prefixed as a0, FLAG_VENDOR_PREFIXED as a1, trim_boundaries as a2, CHAR_GREATER_THAN as a3, CHAR_PLUS as a4, CHAR_TILDE as a5, CHAR_PERIOD as a6, CHAR_ASTERISK as a7, CHAR_AMPERSAND as a8, is_whitespace as a9, is_combinator as aa, skip_whitespace_and_comments_forward as ab, skip_whitespace_and_comments_backward as ac, CHAR_EQUALS as ad, CHAR_PIPE as ae, CHAR_CARET as af, CHAR_DOLLAR as ag, CHAR_SINGLE_QUOTE as ah, CHAR_DOUBLE_QUOTE as ai, CHAR_COLON as aj, FLAG_HAS_PARENS as ak, skip_whitespace_forward as al, str_equals as am, CHAR_MINUS_HYPHEN as an, CHAR_FORWARD_SLASH as ao, ATTR_OPERATOR_TILDE_EQUAL as b, ATTR_OPERATOR_PIPE_EQUAL as c, ATTR_OPERATOR_CARET_EQUAL as d, ATTR_OPERATOR_DOLLAR_EQUAL as e, ATTR_OPERATOR_STAR_EQUAL as f, ATTR_FLAG_NONE as g, ATTR_FLAG_CASE_INSENSITIVE as h, ATTR_FLAG_CASE_SENSITIVE as i, NODE_AT_RULE as j, NODE_COMMENT as k, NODE_DECLARATION as l, NODE_SELECTOR as m, NODE_STYLESHEET as n, NODE_VALUE_KEYWORD as o, NODE_VALUE_NUMBER as p, NODE_VALUE_DIMENSION as q, NODE_VALUE_STRING as r, NODE_VALUE_COLOR as s, NODE_VALUE_FUNCTION as t, NODE_VALUE_OPERATOR as u, NODE_VALUE_PARENTHESIS as v, NODE_SELECTOR_LIST as w, NODE_SELECTOR_TYPE as x, NODE_SELECTOR_CLASS as y, NODE_SELECTOR_ID as z };
|
package/dist/css-node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSDataArena } from './arena';
|
|
2
|
-
import { NODE_STYLESHEET, NODE_STYLE_RULE, NODE_AT_RULE, NODE_DECLARATION, NODE_SELECTOR, NODE_COMMENT, NODE_BLOCK, NODE_VALUE_KEYWORD, NODE_VALUE_NUMBER, NODE_VALUE_DIMENSION, NODE_VALUE_STRING, NODE_VALUE_COLOR, NODE_VALUE_FUNCTION, NODE_VALUE_OPERATOR, NODE_SELECTOR_LIST, NODE_SELECTOR_TYPE, NODE_SELECTOR_CLASS, NODE_SELECTOR_ID, NODE_SELECTOR_ATTRIBUTE, NODE_SELECTOR_PSEUDO_CLASS, NODE_SELECTOR_PSEUDO_ELEMENT, NODE_SELECTOR_COMBINATOR, NODE_SELECTOR_UNIVERSAL, NODE_SELECTOR_NESTING, NODE_SELECTOR_NTH, NODE_SELECTOR_NTH_OF, NODE_SELECTOR_LANG, NODE_PRELUDE_MEDIA_QUERY, NODE_PRELUDE_MEDIA_FEATURE, NODE_PRELUDE_MEDIA_TYPE, NODE_PRELUDE_CONTAINER_QUERY, NODE_PRELUDE_SUPPORTS_QUERY, NODE_PRELUDE_LAYER_NAME, NODE_PRELUDE_IDENTIFIER, NODE_PRELUDE_OPERATOR, NODE_PRELUDE_IMPORT_URL, NODE_PRELUDE_IMPORT_LAYER, NODE_PRELUDE_IMPORT_SUPPORTS } from './arena';
|
|
3
|
-
export type CSSNodeType = typeof NODE_STYLESHEET | typeof NODE_STYLE_RULE | typeof NODE_AT_RULE | typeof NODE_DECLARATION | typeof NODE_SELECTOR | typeof NODE_COMMENT | typeof NODE_BLOCK | typeof NODE_VALUE_KEYWORD | typeof NODE_VALUE_NUMBER | typeof NODE_VALUE_DIMENSION | typeof NODE_VALUE_STRING | typeof NODE_VALUE_COLOR | typeof NODE_VALUE_FUNCTION | typeof NODE_VALUE_OPERATOR | typeof NODE_SELECTOR_LIST | typeof NODE_SELECTOR_TYPE | typeof NODE_SELECTOR_CLASS | typeof NODE_SELECTOR_ID | typeof NODE_SELECTOR_ATTRIBUTE | typeof NODE_SELECTOR_PSEUDO_CLASS | typeof NODE_SELECTOR_PSEUDO_ELEMENT | typeof NODE_SELECTOR_COMBINATOR | typeof NODE_SELECTOR_UNIVERSAL | typeof NODE_SELECTOR_NESTING | typeof NODE_SELECTOR_NTH | typeof NODE_SELECTOR_NTH_OF | typeof NODE_SELECTOR_LANG | typeof NODE_PRELUDE_MEDIA_QUERY | typeof NODE_PRELUDE_MEDIA_FEATURE | typeof NODE_PRELUDE_MEDIA_TYPE | typeof NODE_PRELUDE_CONTAINER_QUERY | typeof NODE_PRELUDE_SUPPORTS_QUERY | typeof NODE_PRELUDE_LAYER_NAME | typeof NODE_PRELUDE_IDENTIFIER | typeof NODE_PRELUDE_OPERATOR | typeof NODE_PRELUDE_IMPORT_URL | typeof NODE_PRELUDE_IMPORT_LAYER | typeof NODE_PRELUDE_IMPORT_SUPPORTS;
|
|
2
|
+
import { NODE_STYLESHEET, NODE_STYLE_RULE, NODE_AT_RULE, NODE_DECLARATION, NODE_SELECTOR, NODE_COMMENT, NODE_BLOCK, NODE_VALUE_KEYWORD, NODE_VALUE_NUMBER, NODE_VALUE_DIMENSION, NODE_VALUE_STRING, NODE_VALUE_COLOR, NODE_VALUE_FUNCTION, NODE_VALUE_OPERATOR, NODE_VALUE_PARENTHESIS, NODE_SELECTOR_LIST, NODE_SELECTOR_TYPE, NODE_SELECTOR_CLASS, NODE_SELECTOR_ID, NODE_SELECTOR_ATTRIBUTE, NODE_SELECTOR_PSEUDO_CLASS, NODE_SELECTOR_PSEUDO_ELEMENT, NODE_SELECTOR_COMBINATOR, NODE_SELECTOR_UNIVERSAL, NODE_SELECTOR_NESTING, NODE_SELECTOR_NTH, NODE_SELECTOR_NTH_OF, NODE_SELECTOR_LANG, NODE_PRELUDE_MEDIA_QUERY, NODE_PRELUDE_MEDIA_FEATURE, NODE_PRELUDE_MEDIA_TYPE, NODE_PRELUDE_CONTAINER_QUERY, NODE_PRELUDE_SUPPORTS_QUERY, NODE_PRELUDE_LAYER_NAME, NODE_PRELUDE_IDENTIFIER, NODE_PRELUDE_OPERATOR, NODE_PRELUDE_IMPORT_URL, NODE_PRELUDE_IMPORT_LAYER, NODE_PRELUDE_IMPORT_SUPPORTS } from './arena';
|
|
3
|
+
export type CSSNodeType = typeof NODE_STYLESHEET | typeof NODE_STYLE_RULE | typeof NODE_AT_RULE | typeof NODE_DECLARATION | typeof NODE_SELECTOR | typeof NODE_COMMENT | typeof NODE_BLOCK | typeof NODE_VALUE_KEYWORD | typeof NODE_VALUE_NUMBER | typeof NODE_VALUE_DIMENSION | typeof NODE_VALUE_STRING | typeof NODE_VALUE_COLOR | typeof NODE_VALUE_FUNCTION | typeof NODE_VALUE_OPERATOR | typeof NODE_VALUE_PARENTHESIS | typeof NODE_SELECTOR_LIST | typeof NODE_SELECTOR_TYPE | typeof NODE_SELECTOR_CLASS | typeof NODE_SELECTOR_ID | typeof NODE_SELECTOR_ATTRIBUTE | typeof NODE_SELECTOR_PSEUDO_CLASS | typeof NODE_SELECTOR_PSEUDO_ELEMENT | typeof NODE_SELECTOR_COMBINATOR | typeof NODE_SELECTOR_UNIVERSAL | typeof NODE_SELECTOR_NESTING | typeof NODE_SELECTOR_NTH | typeof NODE_SELECTOR_NTH_OF | typeof NODE_SELECTOR_LANG | typeof NODE_PRELUDE_MEDIA_QUERY | typeof NODE_PRELUDE_MEDIA_FEATURE | typeof NODE_PRELUDE_MEDIA_TYPE | typeof NODE_PRELUDE_CONTAINER_QUERY | typeof NODE_PRELUDE_SUPPORTS_QUERY | typeof NODE_PRELUDE_LAYER_NAME | typeof NODE_PRELUDE_IDENTIFIER | typeof NODE_PRELUDE_OPERATOR | typeof NODE_PRELUDE_IMPORT_URL | typeof NODE_PRELUDE_IMPORT_LAYER | typeof NODE_PRELUDE_IMPORT_SUPPORTS;
|
|
4
4
|
export declare class CSSNode {
|
|
5
5
|
private arena;
|
|
6
6
|
private source;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export { type ParserOptions } from './parse';
|
|
|
8
8
|
export { CSSNode, type CSSNodeType } from './css-node';
|
|
9
9
|
export type { LexerPosition } from './lexer';
|
|
10
10
|
export { ATTR_OPERATOR_NONE, ATTR_OPERATOR_EQUAL, ATTR_OPERATOR_TILDE_EQUAL, ATTR_OPERATOR_PIPE_EQUAL, ATTR_OPERATOR_CARET_EQUAL, ATTR_OPERATOR_DOLLAR_EQUAL, ATTR_OPERATOR_STAR_EQUAL, ATTR_FLAG_NONE, ATTR_FLAG_CASE_INSENSITIVE, ATTR_FLAG_CASE_SENSITIVE, } from './arena';
|
|
11
|
-
export { NODE_STYLE_RULE, NODE_AT_RULE, NODE_COMMENT, NODE_DECLARATION, NODE_SELECTOR, NODE_STYLESHEET, NODE_VALUE_KEYWORD, NODE_VALUE_NUMBER, NODE_VALUE_DIMENSION, NODE_VALUE_STRING, NODE_VALUE_COLOR, NODE_VALUE_FUNCTION, NODE_VALUE_OPERATOR, NODE_SELECTOR_LIST, NODE_SELECTOR_TYPE, NODE_SELECTOR_CLASS, NODE_SELECTOR_ID, NODE_SELECTOR_ATTRIBUTE, NODE_SELECTOR_PSEUDO_CLASS, NODE_SELECTOR_PSEUDO_ELEMENT, NODE_SELECTOR_COMBINATOR, NODE_SELECTOR_UNIVERSAL, NODE_SELECTOR_NESTING, NODE_SELECTOR_NTH, NODE_SELECTOR_NTH_OF, NODE_PRELUDE_MEDIA_QUERY, NODE_PRELUDE_MEDIA_FEATURE, NODE_PRELUDE_MEDIA_TYPE, NODE_PRELUDE_CONTAINER_QUERY, NODE_PRELUDE_SUPPORTS_QUERY, NODE_PRELUDE_LAYER_NAME, NODE_PRELUDE_IDENTIFIER, NODE_PRELUDE_OPERATOR, NODE_PRELUDE_IMPORT_URL, NODE_PRELUDE_IMPORT_LAYER, NODE_PRELUDE_IMPORT_SUPPORTS, FLAG_IMPORTANT, } from './parse';
|
|
11
|
+
export { NODE_STYLE_RULE, NODE_AT_RULE, NODE_COMMENT, NODE_DECLARATION, NODE_SELECTOR, NODE_STYLESHEET, NODE_VALUE_KEYWORD, NODE_VALUE_NUMBER, NODE_VALUE_DIMENSION, NODE_VALUE_STRING, NODE_VALUE_COLOR, NODE_VALUE_FUNCTION, NODE_VALUE_OPERATOR, NODE_VALUE_PARENTHESIS, NODE_SELECTOR_LIST, NODE_SELECTOR_TYPE, NODE_SELECTOR_CLASS, NODE_SELECTOR_ID, NODE_SELECTOR_ATTRIBUTE, NODE_SELECTOR_PSEUDO_CLASS, NODE_SELECTOR_PSEUDO_ELEMENT, NODE_SELECTOR_COMBINATOR, NODE_SELECTOR_UNIVERSAL, NODE_SELECTOR_NESTING, NODE_SELECTOR_NTH, NODE_SELECTOR_NTH_OF, NODE_SELECTOR_LANG, NODE_PRELUDE_MEDIA_QUERY, NODE_PRELUDE_MEDIA_FEATURE, NODE_PRELUDE_MEDIA_TYPE, NODE_PRELUDE_CONTAINER_QUERY, NODE_PRELUDE_SUPPORTS_QUERY, NODE_PRELUDE_LAYER_NAME, NODE_PRELUDE_IDENTIFIER, NODE_PRELUDE_OPERATOR, NODE_PRELUDE_IMPORT_URL, NODE_PRELUDE_IMPORT_LAYER, NODE_PRELUDE_IMPORT_SUPPORTS, FLAG_IMPORTANT, } from './parse';
|
|
12
12
|
export { TOKEN_IDENT, TOKEN_FUNCTION, TOKEN_AT_KEYWORD, TOKEN_HASH, TOKEN_STRING, TOKEN_BAD_STRING, TOKEN_URL, TOKEN_BAD_URL, TOKEN_DELIM, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_DIMENSION, TOKEN_WHITESPACE, TOKEN_CDO, TOKEN_CDC, TOKEN_COLON, TOKEN_SEMICOLON, TOKEN_COMMA, TOKEN_LEFT_BRACKET, TOKEN_RIGHT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_RIGHT_PAREN, TOKEN_LEFT_BRACE, TOKEN_RIGHT_BRACE, TOKEN_COMMENT, TOKEN_EOF, type Token, type TokenType, } from './token-types';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { parse_selector } from './parse-selector.js';
|
|
|
3
3
|
export { parse_atrule_prelude } from './parse-atrule-prelude.js';
|
|
4
4
|
export { parse_value } from './parse-value.js';
|
|
5
5
|
export { tokenize } from './tokenize.js';
|
|
6
|
-
export { h as ATTR_FLAG_CASE_INSENSITIVE, i as ATTR_FLAG_CASE_SENSITIVE, g as ATTR_FLAG_NONE, d as ATTR_OPERATOR_CARET_EQUAL, e as ATTR_OPERATOR_DOLLAR_EQUAL, a as ATTR_OPERATOR_EQUAL, A as ATTR_OPERATOR_NONE, c as ATTR_OPERATOR_PIPE_EQUAL, f as ATTR_OPERATOR_STAR_EQUAL, b as ATTR_OPERATOR_TILDE_EQUAL, C as CSSNode,
|
|
6
|
+
export { h as ATTR_FLAG_CASE_INSENSITIVE, i as ATTR_FLAG_CASE_SENSITIVE, g as ATTR_FLAG_NONE, d as ATTR_OPERATOR_CARET_EQUAL, e as ATTR_OPERATOR_DOLLAR_EQUAL, a as ATTR_OPERATOR_EQUAL, A as ATTR_OPERATOR_NONE, c as ATTR_OPERATOR_PIPE_EQUAL, f as ATTR_OPERATOR_STAR_EQUAL, b as ATTR_OPERATOR_TILDE_EQUAL, C as CSSNode, X as FLAG_IMPORTANT, j as NODE_AT_RULE, k as NODE_COMMENT, l as NODE_DECLARATION, P as NODE_PRELUDE_CONTAINER_QUERY, S as NODE_PRELUDE_IDENTIFIER, V as NODE_PRELUDE_IMPORT_LAYER, W as NODE_PRELUDE_IMPORT_SUPPORTS, U as NODE_PRELUDE_IMPORT_URL, R as NODE_PRELUDE_LAYER_NAME, M as NODE_PRELUDE_MEDIA_FEATURE, L as NODE_PRELUDE_MEDIA_QUERY, O as NODE_PRELUDE_MEDIA_TYPE, T as NODE_PRELUDE_OPERATOR, Q as NODE_PRELUDE_SUPPORTS_QUERY, m as NODE_SELECTOR, B as NODE_SELECTOR_ATTRIBUTE, y as NODE_SELECTOR_CLASS, F as NODE_SELECTOR_COMBINATOR, z as NODE_SELECTOR_ID, K as NODE_SELECTOR_LANG, w as NODE_SELECTOR_LIST, H as NODE_SELECTOR_NESTING, I as NODE_SELECTOR_NTH, J as NODE_SELECTOR_NTH_OF, D as NODE_SELECTOR_PSEUDO_CLASS, E as NODE_SELECTOR_PSEUDO_ELEMENT, x as NODE_SELECTOR_TYPE, G as NODE_SELECTOR_UNIVERSAL, n as NODE_STYLESHEET, N as NODE_STYLE_RULE, s as NODE_VALUE_COLOR, q as NODE_VALUE_DIMENSION, t as NODE_VALUE_FUNCTION, o as NODE_VALUE_KEYWORD, p as NODE_VALUE_NUMBER, u as NODE_VALUE_OPERATOR, v as NODE_VALUE_PARENTHESIS, r as NODE_VALUE_STRING } from './css-node-aIMm9_Cb.js';
|
|
7
7
|
export { b as TOKEN_AT_KEYWORD, e as TOKEN_BAD_STRING, g as TOKEN_BAD_URL, n as TOKEN_CDC, m as TOKEN_CDO, o as TOKEN_COLON, q as TOKEN_COMMA, x as TOKEN_COMMENT, h as TOKEN_DELIM, k as TOKEN_DIMENSION, y as TOKEN_EOF, a as TOKEN_FUNCTION, c as TOKEN_HASH, T as TOKEN_IDENT, v as TOKEN_LEFT_BRACE, r as TOKEN_LEFT_BRACKET, t as TOKEN_LEFT_PAREN, i as TOKEN_NUMBER, j as TOKEN_PERCENTAGE, w as TOKEN_RIGHT_BRACE, s as TOKEN_RIGHT_BRACKET, u as TOKEN_RIGHT_PAREN, p as TOKEN_SEMICOLON, d as TOKEN_STRING, f as TOKEN_URL, l as TOKEN_WHITESPACE } from './lexer-CtBKgfVv.js';
|
|
8
8
|
|
|
9
9
|
function walk(node, callback, depth = 0) {
|
package/dist/parse-anplusb.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { L as Lexer, T as TOKEN_IDENT, h as TOKEN_DELIM, k as TOKEN_DIMENSION, i as TOKEN_NUMBER } from './lexer-CtBKgfVv.js';
|
|
2
|
-
import {
|
|
2
|
+
import { an as CHAR_MINUS_HYPHEN, a4 as CHAR_PLUS, al as skip_whitespace_forward, I as NODE_SELECTOR_NTH, C as CSSNode, Y as CSSDataArena } from './css-node-aIMm9_Cb.js';
|
|
3
3
|
|
|
4
4
|
class ANplusBParser {
|
|
5
5
|
lexer;
|
|
@@ -8,6 +8,7 @@ export declare class AtRulePreludeParser {
|
|
|
8
8
|
constructor(arena: CSSDataArena, source: string);
|
|
9
9
|
parse_prelude(at_rule_name: string, start: number, end: number, line?: number, column?: number): number[];
|
|
10
10
|
private parse_media_query_list;
|
|
11
|
+
private create_node;
|
|
11
12
|
private is_and_or_not;
|
|
12
13
|
private parse_single_media_query;
|
|
13
14
|
private parse_media_feature;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { L as Lexer, q as TOKEN_COMMA, T as TOKEN_IDENT, t as TOKEN_LEFT_PAREN, u as TOKEN_RIGHT_PAREN, l as TOKEN_WHITESPACE, f as TOKEN_URL, a as TOKEN_FUNCTION, d as TOKEN_STRING, y as TOKEN_EOF } from './lexer-CtBKgfVv.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Y as CSSDataArena, C as CSSNode, am as str_equals, T as NODE_PRELUDE_OPERATOR, O as NODE_PRELUDE_MEDIA_TYPE, L as NODE_PRELUDE_MEDIA_QUERY, M as NODE_PRELUDE_MEDIA_FEATURE, a2 as trim_boundaries, S as NODE_PRELUDE_IDENTIFIER, P as NODE_PRELUDE_CONTAINER_QUERY, Q as NODE_PRELUDE_SUPPORTS_QUERY, R as NODE_PRELUDE_LAYER_NAME, U as NODE_PRELUDE_IMPORT_URL, V as NODE_PRELUDE_IMPORT_LAYER, W as NODE_PRELUDE_IMPORT_SUPPORTS, al as skip_whitespace_forward } from './css-node-aIMm9_Cb.js';
|
|
3
3
|
|
|
4
4
|
class AtRulePreludeParser {
|
|
5
5
|
lexer;
|
|
@@ -52,6 +52,15 @@ class AtRulePreludeParser {
|
|
|
52
52
|
}
|
|
53
53
|
return nodes;
|
|
54
54
|
}
|
|
55
|
+
create_node(type, start, end) {
|
|
56
|
+
let node = this.arena.create_node();
|
|
57
|
+
this.arena.set_type(node, type);
|
|
58
|
+
this.arena.set_start_offset(node, start);
|
|
59
|
+
this.arena.set_length(node, end - start);
|
|
60
|
+
this.arena.set_start_line(node, this.lexer.token_line);
|
|
61
|
+
this.arena.set_start_column(node, this.lexer.token_column);
|
|
62
|
+
return node;
|
|
63
|
+
}
|
|
55
64
|
is_and_or_not(str) {
|
|
56
65
|
if (str.length > 3 || str.length < 2) return false;
|
|
57
66
|
return str_equals("and", str) || str_equals("or", str) || str_equals("not", str);
|
|
@@ -59,7 +68,7 @@ class AtRulePreludeParser {
|
|
|
59
68
|
// Parse a single media query: screen and (min-width: 768px)
|
|
60
69
|
parse_single_media_query() {
|
|
61
70
|
let query_start = this.lexer.pos;
|
|
62
|
-
|
|
71
|
+
this.lexer.line;
|
|
63
72
|
this.skip_whitespace();
|
|
64
73
|
if (this.lexer.pos >= this.prelude_end) return null;
|
|
65
74
|
let token_start = this.lexer.pos;
|
|
@@ -87,19 +96,10 @@ class AtRulePreludeParser {
|
|
|
87
96
|
} else if (token_type === TOKEN_IDENT) {
|
|
88
97
|
let text = this.source.substring(this.lexer.token_start, this.lexer.token_end);
|
|
89
98
|
if (this.is_and_or_not(text)) {
|
|
90
|
-
let op = this.
|
|
91
|
-
this.arena.set_type(op, NODE_PRELUDE_OPERATOR);
|
|
92
|
-
this.arena.set_start_offset(op, this.lexer.token_start);
|
|
93
|
-
this.arena.set_length(op, this.lexer.token_end - this.lexer.token_start);
|
|
94
|
-
this.arena.set_start_line(op, this.lexer.token_line);
|
|
99
|
+
let op = this.create_node(NODE_PRELUDE_OPERATOR, this.lexer.token_start, this.lexer.token_end);
|
|
95
100
|
components.push(op);
|
|
96
101
|
} else {
|
|
97
|
-
let media_type = this.
|
|
98
|
-
this.arena.set_type(media_type, NODE_PRELUDE_MEDIA_TYPE);
|
|
99
|
-
this.arena.set_start_offset(media_type, this.lexer.token_start);
|
|
100
|
-
this.arena.set_length(media_type, this.lexer.token_end - this.lexer.token_start);
|
|
101
|
-
this.arena.set_start_line(media_type, this.lexer.token_line);
|
|
102
|
-
this.arena.set_start_column(media_type, this.lexer.token_column);
|
|
102
|
+
let media_type = this.create_node(NODE_PRELUDE_MEDIA_TYPE, this.lexer.token_start, this.lexer.token_end);
|
|
103
103
|
components.push(media_type);
|
|
104
104
|
}
|
|
105
105
|
} else {
|
|
@@ -107,11 +107,7 @@ class AtRulePreludeParser {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
if (components.length === 0) return null;
|
|
110
|
-
let query_node = this.
|
|
111
|
-
this.arena.set_type(query_node, NODE_PRELUDE_MEDIA_QUERY);
|
|
112
|
-
this.arena.set_start_offset(query_node, query_start);
|
|
113
|
-
this.arena.set_length(query_node, this.lexer.pos - query_start);
|
|
114
|
-
this.arena.set_start_line(query_node, query_line);
|
|
110
|
+
let query_node = this.create_node(NODE_PRELUDE_MEDIA_QUERY, query_start, this.lexer.pos);
|
|
115
111
|
for (let component of components) {
|
|
116
112
|
this.arena.append_child(query_node, component);
|
|
117
113
|
}
|
|
@@ -120,7 +116,7 @@ class AtRulePreludeParser {
|
|
|
120
116
|
// Parse media feature: (min-width: 768px)
|
|
121
117
|
parse_media_feature() {
|
|
122
118
|
let feature_start = this.lexer.token_start;
|
|
123
|
-
|
|
119
|
+
this.lexer.token_line;
|
|
124
120
|
let depth = 1;
|
|
125
121
|
let content_start = this.lexer.pos;
|
|
126
122
|
while (this.lexer.pos < this.prelude_end && depth > 0) {
|
|
@@ -135,11 +131,7 @@ class AtRulePreludeParser {
|
|
|
135
131
|
if (depth !== 0) return null;
|
|
136
132
|
let content_end = this.lexer.token_start;
|
|
137
133
|
let feature_end = this.lexer.token_end;
|
|
138
|
-
let feature = this.
|
|
139
|
-
this.arena.set_type(feature, NODE_PRELUDE_MEDIA_FEATURE);
|
|
140
|
-
this.arena.set_start_offset(feature, feature_start);
|
|
141
|
-
this.arena.set_length(feature, feature_end - feature_start);
|
|
142
|
-
this.arena.set_start_line(feature, feature_line);
|
|
134
|
+
let feature = this.create_node(NODE_PRELUDE_MEDIA_FEATURE, feature_start, feature_end);
|
|
143
135
|
let trimmed = trim_boundaries(this.source, content_start, content_end);
|
|
144
136
|
if (trimmed) {
|
|
145
137
|
this.arena.set_value_start(feature, trimmed[0]);
|
|
@@ -151,7 +143,7 @@ class AtRulePreludeParser {
|
|
|
151
143
|
parse_container_query() {
|
|
152
144
|
let nodes = [];
|
|
153
145
|
let query_start = this.lexer.pos;
|
|
154
|
-
|
|
146
|
+
this.lexer.line;
|
|
155
147
|
let components = [];
|
|
156
148
|
while (this.lexer.pos < this.prelude_end) {
|
|
157
149
|
this.skip_whitespace();
|
|
@@ -166,28 +158,16 @@ class AtRulePreludeParser {
|
|
|
166
158
|
} else if (token_type === TOKEN_IDENT) {
|
|
167
159
|
let text = this.source.substring(this.lexer.token_start, this.lexer.token_end);
|
|
168
160
|
if (this.is_and_or_not(text)) {
|
|
169
|
-
let op = this.
|
|
170
|
-
this.arena.set_type(op, NODE_PRELUDE_OPERATOR);
|
|
171
|
-
this.arena.set_start_offset(op, this.lexer.token_start);
|
|
172
|
-
this.arena.set_length(op, this.lexer.token_end - this.lexer.token_start);
|
|
173
|
-
this.arena.set_start_line(op, this.lexer.token_line);
|
|
161
|
+
let op = this.create_node(NODE_PRELUDE_OPERATOR, this.lexer.token_start, this.lexer.token_end);
|
|
174
162
|
components.push(op);
|
|
175
163
|
} else {
|
|
176
|
-
let name = this.
|
|
177
|
-
this.arena.set_type(name, NODE_PRELUDE_IDENTIFIER);
|
|
178
|
-
this.arena.set_start_offset(name, this.lexer.token_start);
|
|
179
|
-
this.arena.set_length(name, this.lexer.token_end - this.lexer.token_start);
|
|
180
|
-
this.arena.set_start_line(name, this.lexer.token_line);
|
|
164
|
+
let name = this.create_node(NODE_PRELUDE_IDENTIFIER, this.lexer.token_start, this.lexer.token_end);
|
|
181
165
|
components.push(name);
|
|
182
166
|
}
|
|
183
167
|
}
|
|
184
168
|
}
|
|
185
169
|
if (components.length === 0) return [];
|
|
186
|
-
let query_node = this.
|
|
187
|
-
this.arena.set_type(query_node, NODE_PRELUDE_CONTAINER_QUERY);
|
|
188
|
-
this.arena.set_start_offset(query_node, query_start);
|
|
189
|
-
this.arena.set_length(query_node, this.lexer.pos - query_start);
|
|
190
|
-
this.arena.set_start_line(query_node, query_line);
|
|
170
|
+
let query_node = this.create_node(NODE_PRELUDE_CONTAINER_QUERY, query_start, this.lexer.pos);
|
|
191
171
|
for (let component of components) {
|
|
192
172
|
this.arena.append_child(query_node, component);
|
|
193
173
|
}
|
|
@@ -204,7 +184,7 @@ class AtRulePreludeParser {
|
|
|
204
184
|
let token_type = this.lexer.token_type;
|
|
205
185
|
if (token_type === TOKEN_LEFT_PAREN) {
|
|
206
186
|
let feature_start = this.lexer.token_start;
|
|
207
|
-
|
|
187
|
+
this.lexer.token_line;
|
|
208
188
|
let depth = 1;
|
|
209
189
|
let content_start = this.lexer.pos;
|
|
210
190
|
while (this.lexer.pos < this.prelude_end && depth > 0) {
|
|
@@ -219,11 +199,7 @@ class AtRulePreludeParser {
|
|
|
219
199
|
if (depth === 0) {
|
|
220
200
|
let content_end = this.lexer.token_start;
|
|
221
201
|
let feature_end = this.lexer.token_end;
|
|
222
|
-
let query = this.
|
|
223
|
-
this.arena.set_type(query, NODE_PRELUDE_SUPPORTS_QUERY);
|
|
224
|
-
this.arena.set_start_offset(query, feature_start);
|
|
225
|
-
this.arena.set_length(query, feature_end - feature_start);
|
|
226
|
-
this.arena.set_start_line(query, feature_line);
|
|
202
|
+
let query = this.create_node(NODE_PRELUDE_SUPPORTS_QUERY, feature_start, feature_end);
|
|
227
203
|
let trimmed = trim_boundaries(this.source, content_start, content_end);
|
|
228
204
|
if (trimmed) {
|
|
229
205
|
this.arena.set_value_start(query, trimmed[0]);
|
|
@@ -234,11 +210,7 @@ class AtRulePreludeParser {
|
|
|
234
210
|
} else if (token_type === TOKEN_IDENT) {
|
|
235
211
|
let text = this.source.substring(this.lexer.token_start, this.lexer.token_end);
|
|
236
212
|
if (this.is_and_or_not(text)) {
|
|
237
|
-
let op = this.
|
|
238
|
-
this.arena.set_type(op, NODE_PRELUDE_OPERATOR);
|
|
239
|
-
this.arena.set_start_offset(op, this.lexer.token_start);
|
|
240
|
-
this.arena.set_length(op, this.lexer.token_end - this.lexer.token_start);
|
|
241
|
-
this.arena.set_start_line(op, this.lexer.token_line);
|
|
213
|
+
let op = this.create_node(NODE_PRELUDE_OPERATOR, this.lexer.token_start, this.lexer.token_end);
|
|
242
214
|
nodes.push(op);
|
|
243
215
|
}
|
|
244
216
|
}
|
|
@@ -254,11 +226,7 @@ class AtRulePreludeParser {
|
|
|
254
226
|
this.next_token();
|
|
255
227
|
let token_type = this.lexer.token_type;
|
|
256
228
|
if (token_type === TOKEN_IDENT) {
|
|
257
|
-
let layer = this.
|
|
258
|
-
this.arena.set_type(layer, NODE_PRELUDE_LAYER_NAME);
|
|
259
|
-
this.arena.set_start_offset(layer, this.lexer.token_start);
|
|
260
|
-
this.arena.set_length(layer, this.lexer.token_end - this.lexer.token_start);
|
|
261
|
-
this.arena.set_start_line(layer, this.lexer.token_line);
|
|
229
|
+
let layer = this.create_node(NODE_PRELUDE_LAYER_NAME, this.lexer.token_start, this.lexer.token_end);
|
|
262
230
|
nodes.push(layer);
|
|
263
231
|
} else if (token_type === TOKEN_COMMA) {
|
|
264
232
|
continue;
|
|
@@ -274,11 +242,7 @@ class AtRulePreludeParser {
|
|
|
274
242
|
if (this.lexer.pos >= this.prelude_end) return [];
|
|
275
243
|
this.next_token();
|
|
276
244
|
if (this.lexer.token_type !== TOKEN_IDENT) return [];
|
|
277
|
-
let ident = this.
|
|
278
|
-
this.arena.set_type(ident, NODE_PRELUDE_IDENTIFIER);
|
|
279
|
-
this.arena.set_start_offset(ident, this.lexer.token_start);
|
|
280
|
-
this.arena.set_length(ident, this.lexer.token_end - this.lexer.token_start);
|
|
281
|
-
this.arena.set_start_line(ident, this.lexer.token_line);
|
|
245
|
+
let ident = this.create_node(NODE_PRELUDE_IDENTIFIER, this.lexer.token_start, this.lexer.token_end);
|
|
282
246
|
return [ident];
|
|
283
247
|
}
|
|
284
248
|
// Parse @import prelude: url() [layer] [supports()] [media-query-list]
|
|
@@ -319,7 +283,7 @@ class AtRulePreludeParser {
|
|
|
319
283
|
}
|
|
320
284
|
let url_start = this.lexer.token_start;
|
|
321
285
|
let url_end = this.lexer.token_end;
|
|
322
|
-
|
|
286
|
+
this.lexer.token_line;
|
|
323
287
|
if (this.lexer.token_type === TOKEN_FUNCTION) {
|
|
324
288
|
let paren_depth = 1;
|
|
325
289
|
while (this.lexer.pos < this.prelude_end && paren_depth > 0) {
|
|
@@ -336,11 +300,7 @@ class AtRulePreludeParser {
|
|
|
336
300
|
}
|
|
337
301
|
}
|
|
338
302
|
}
|
|
339
|
-
let url_node = this.
|
|
340
|
-
this.arena.set_type(url_node, NODE_PRELUDE_IMPORT_URL);
|
|
341
|
-
this.arena.set_start_offset(url_node, url_start);
|
|
342
|
-
this.arena.set_length(url_node, url_end - url_start);
|
|
343
|
-
this.arena.set_start_line(url_node, url_line);
|
|
303
|
+
let url_node = this.create_node(NODE_PRELUDE_IMPORT_URL, url_start, url_end);
|
|
344
304
|
return url_node;
|
|
345
305
|
}
|
|
346
306
|
// Parse import layer: layer or layer(name)
|
|
@@ -355,7 +315,7 @@ class AtRulePreludeParser {
|
|
|
355
315
|
if (str_equals("layer", text)) {
|
|
356
316
|
let layer_start = this.lexer.token_start;
|
|
357
317
|
let layer_end = this.lexer.token_end;
|
|
358
|
-
|
|
318
|
+
this.lexer.token_line;
|
|
359
319
|
let content_start = 0;
|
|
360
320
|
let content_length = 0;
|
|
361
321
|
if (this.lexer.token_type === TOKEN_FUNCTION) {
|
|
@@ -376,11 +336,7 @@ class AtRulePreludeParser {
|
|
|
376
336
|
}
|
|
377
337
|
}
|
|
378
338
|
}
|
|
379
|
-
let layer_node = this.
|
|
380
|
-
this.arena.set_type(layer_node, NODE_PRELUDE_IMPORT_LAYER);
|
|
381
|
-
this.arena.set_start_offset(layer_node, layer_start);
|
|
382
|
-
this.arena.set_length(layer_node, layer_end - layer_start);
|
|
383
|
-
this.arena.set_start_line(layer_node, layer_line);
|
|
339
|
+
let layer_node = this.create_node(NODE_PRELUDE_IMPORT_LAYER, layer_start, layer_end);
|
|
384
340
|
if (content_length > 0) {
|
|
385
341
|
let trimmed = trim_boundaries(this.source, content_start, content_start + content_length);
|
|
386
342
|
if (trimmed) {
|
|
@@ -402,7 +358,7 @@ class AtRulePreludeParser {
|
|
|
402
358
|
let text = this.source.substring(this.lexer.token_start, this.lexer.token_end - 1);
|
|
403
359
|
if (str_equals("supports", text)) {
|
|
404
360
|
let supports_start = this.lexer.token_start;
|
|
405
|
-
|
|
361
|
+
this.lexer.token_line;
|
|
406
362
|
let paren_depth = 1;
|
|
407
363
|
let supports_end = this.lexer.token_end;
|
|
408
364
|
while (this.lexer.pos < this.prelude_end && paren_depth > 0) {
|
|
@@ -418,11 +374,7 @@ class AtRulePreludeParser {
|
|
|
418
374
|
break;
|
|
419
375
|
}
|
|
420
376
|
}
|
|
421
|
-
let supports_node = this.
|
|
422
|
-
this.arena.set_type(supports_node, NODE_PRELUDE_IMPORT_SUPPORTS);
|
|
423
|
-
this.arena.set_start_offset(supports_node, supports_start);
|
|
424
|
-
this.arena.set_length(supports_node, supports_end - supports_start);
|
|
425
|
-
this.arena.set_start_line(supports_node, supports_line);
|
|
377
|
+
let supports_node = this.create_node(NODE_PRELUDE_IMPORT_SUPPORTS, supports_start, supports_end);
|
|
426
378
|
return supports_node;
|
|
427
379
|
}
|
|
428
380
|
}
|
package/dist/parse-selector.d.ts
CHANGED
|
@@ -22,11 +22,7 @@ export declare class SelectorParser {
|
|
|
22
22
|
private parse_lang_identifiers;
|
|
23
23
|
private parse_nth_expression;
|
|
24
24
|
private find_of_keyword;
|
|
25
|
-
private
|
|
26
|
-
private create_id_selector;
|
|
27
|
-
private create_universal_selector;
|
|
28
|
-
private create_nesting_selector;
|
|
29
|
-
private create_combinator;
|
|
25
|
+
private create_node;
|
|
30
26
|
private skip_whitespace;
|
|
31
27
|
}
|
|
32
28
|
/**
|
package/dist/parse-selector.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { L as Lexer, q as TOKEN_COMMA, h as TOKEN_DELIM, y as TOKEN_EOF, l as TOKEN_WHITESPACE, a as TOKEN_FUNCTION, o as TOKEN_COLON, r as TOKEN_LEFT_BRACKET, c as TOKEN_HASH, T as TOKEN_IDENT, s as TOKEN_RIGHT_BRACKET, t as TOKEN_LEFT_PAREN, u as TOKEN_RIGHT_PAREN, d as TOKEN_STRING } from './lexer-CtBKgfVv.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Y as CSSDataArena, w as NODE_SELECTOR_LIST, C as CSSNode, m as NODE_SELECTOR, a3 as CHAR_GREATER_THAN, a4 as CHAR_PLUS, a5 as CHAR_TILDE, F as NODE_SELECTOR_COMBINATOR, a6 as CHAR_PERIOD, a7 as CHAR_ASTERISK, G as NODE_SELECTOR_UNIVERSAL, a8 as CHAR_AMPERSAND, H as NODE_SELECTOR_NESTING, z as NODE_SELECTOR_ID, x as NODE_SELECTOR_TYPE, a9 as is_whitespace, aa as is_combinator, y as NODE_SELECTOR_CLASS, B as NODE_SELECTOR_ATTRIBUTE, ab as skip_whitespace_and_comments_forward, ac as skip_whitespace_and_comments_backward, ad as CHAR_EQUALS, ae as CHAR_PIPE, af as CHAR_CARET, ag as CHAR_DOLLAR, A as ATTR_OPERATOR_NONE, g as ATTR_FLAG_NONE, a as ATTR_OPERATOR_EQUAL, b as ATTR_OPERATOR_TILDE_EQUAL, c as ATTR_OPERATOR_PIPE_EQUAL, d as ATTR_OPERATOR_CARET_EQUAL, e as ATTR_OPERATOR_DOLLAR_EQUAL, f as ATTR_OPERATOR_STAR_EQUAL, ah as CHAR_SINGLE_QUOTE, ai as CHAR_DOUBLE_QUOTE, h as ATTR_FLAG_CASE_INSENSITIVE, i as ATTR_FLAG_CASE_SENSITIVE, aj as CHAR_COLON, E as NODE_SELECTOR_PSEUDO_ELEMENT, D as NODE_SELECTOR_PSEUDO_CLASS, a0 as is_vendor_prefixed, a1 as FLAG_VENDOR_PREFIXED, ak as FLAG_HAS_PARENS, K as NODE_SELECTOR_LANG, al as skip_whitespace_forward, J as NODE_SELECTOR_NTH_OF } from './css-node-aIMm9_Cb.js';
|
|
3
3
|
import { ANplusBParser } from './parse-anplusb.js';
|
|
4
4
|
|
|
5
5
|
class SelectorParser {
|
|
@@ -15,7 +15,7 @@ class SelectorParser {
|
|
|
15
15
|
}
|
|
16
16
|
// Parse a selector range into selector nodes
|
|
17
17
|
// Always returns a NODE_SELECTOR_LIST with selector components as children
|
|
18
|
-
parse_selector(start, end, line = 1, column = 1, allow_relative =
|
|
18
|
+
parse_selector(start, end, line = 1, column = 1, allow_relative = true) {
|
|
19
19
|
this.selector_end = end;
|
|
20
20
|
this.lexer.pos = start;
|
|
21
21
|
this.lexer.line = line;
|
|
@@ -23,23 +23,16 @@ class SelectorParser {
|
|
|
23
23
|
return this.parse_selector_list(allow_relative);
|
|
24
24
|
}
|
|
25
25
|
// Parse comma-separated selectors
|
|
26
|
-
parse_selector_list(allow_relative =
|
|
26
|
+
parse_selector_list(allow_relative = true) {
|
|
27
27
|
let selectors = [];
|
|
28
28
|
let list_start = this.lexer.pos;
|
|
29
29
|
let list_line = this.lexer.line;
|
|
30
30
|
let list_column = this.lexer.column;
|
|
31
31
|
while (this.lexer.pos < this.selector_end) {
|
|
32
32
|
let selector_start = this.lexer.pos;
|
|
33
|
-
let selector_line = this.lexer.line;
|
|
34
|
-
let selector_column = this.lexer.column;
|
|
35
33
|
let complex_selector = this.parse_complex_selector(allow_relative);
|
|
36
34
|
if (complex_selector !== null) {
|
|
37
|
-
let selector_wrapper = this.
|
|
38
|
-
this.arena.set_type(selector_wrapper, NODE_SELECTOR);
|
|
39
|
-
this.arena.set_start_offset(selector_wrapper, selector_start);
|
|
40
|
-
this.arena.set_length(selector_wrapper, this.lexer.pos - selector_start);
|
|
41
|
-
this.arena.set_start_line(selector_wrapper, selector_line);
|
|
42
|
-
this.arena.set_start_column(selector_wrapper, selector_column);
|
|
35
|
+
let selector_wrapper = this.create_node(NODE_SELECTOR, selector_start, this.lexer.pos);
|
|
43
36
|
let last_component = complex_selector;
|
|
44
37
|
while (this.arena.get_next_sibling(last_component) !== 0) {
|
|
45
38
|
last_component = this.arena.get_next_sibling(last_component);
|
|
@@ -77,7 +70,8 @@ class SelectorParser {
|
|
|
77
70
|
}
|
|
78
71
|
// Parse a complex selector (with combinators)
|
|
79
72
|
// e.g., "div.class > p + span"
|
|
80
|
-
|
|
73
|
+
// Also supports CSS Nesting relaxed syntax: "> a", "~ span", etc.
|
|
74
|
+
parse_complex_selector(allow_relative = true) {
|
|
81
75
|
let components = [];
|
|
82
76
|
this.skip_whitespace();
|
|
83
77
|
if (allow_relative && this.lexer.pos < this.selector_end) {
|
|
@@ -87,7 +81,7 @@ class SelectorParser {
|
|
|
87
81
|
if (token_type === TOKEN_DELIM) {
|
|
88
82
|
let ch = this.source.charCodeAt(this.lexer.token_start);
|
|
89
83
|
if (ch === CHAR_GREATER_THAN || ch === CHAR_PLUS || ch === CHAR_TILDE) {
|
|
90
|
-
let combinator = this.
|
|
84
|
+
let combinator = this.create_node(NODE_SELECTOR_COMBINATOR, this.lexer.token_start, this.lexer.token_end);
|
|
91
85
|
components.push(combinator);
|
|
92
86
|
this.skip_whitespace();
|
|
93
87
|
} else {
|
|
@@ -164,17 +158,17 @@ class SelectorParser {
|
|
|
164
158
|
let end = this.lexer.token_end;
|
|
165
159
|
switch (token_type) {
|
|
166
160
|
case TOKEN_IDENT:
|
|
167
|
-
return this.
|
|
161
|
+
return this.create_node(NODE_SELECTOR_TYPE, start, end);
|
|
168
162
|
case TOKEN_HASH:
|
|
169
|
-
return this.
|
|
163
|
+
return this.create_node(NODE_SELECTOR_ID, start, end);
|
|
170
164
|
case TOKEN_DELIM:
|
|
171
165
|
let ch = this.source.charCodeAt(start);
|
|
172
166
|
if (ch === CHAR_PERIOD) {
|
|
173
167
|
return this.parse_class_selector(start);
|
|
174
168
|
} else if (ch === CHAR_ASTERISK) {
|
|
175
|
-
return this.
|
|
169
|
+
return this.create_node(NODE_SELECTOR_UNIVERSAL, start, end);
|
|
176
170
|
} else if (ch === CHAR_AMPERSAND) {
|
|
177
|
-
return this.
|
|
171
|
+
return this.create_node(NODE_SELECTOR_NESTING, start, end);
|
|
178
172
|
}
|
|
179
173
|
return null;
|
|
180
174
|
case TOKEN_LEFT_BRACKET:
|
|
@@ -208,7 +202,7 @@ class SelectorParser {
|
|
|
208
202
|
if (this.lexer.token_type === TOKEN_DELIM) {
|
|
209
203
|
let ch = this.source.charCodeAt(this.lexer.token_start);
|
|
210
204
|
if (is_combinator(ch)) {
|
|
211
|
-
return this.
|
|
205
|
+
return this.create_node(NODE_SELECTOR_COMBINATOR, this.lexer.token_start, this.lexer.token_end);
|
|
212
206
|
}
|
|
213
207
|
}
|
|
214
208
|
if (has_whitespace) {
|
|
@@ -221,7 +215,7 @@ class SelectorParser {
|
|
|
221
215
|
break;
|
|
222
216
|
}
|
|
223
217
|
}
|
|
224
|
-
return this.
|
|
218
|
+
return this.create_node(NODE_SELECTOR_COMBINATOR, whitespace_start, this.lexer.pos);
|
|
225
219
|
}
|
|
226
220
|
this.lexer.pos = whitespace_start;
|
|
227
221
|
return null;
|
|
@@ -234,15 +228,7 @@ class SelectorParser {
|
|
|
234
228
|
this.lexer.restore_position(saved);
|
|
235
229
|
return null;
|
|
236
230
|
}
|
|
237
|
-
|
|
238
|
-
this.arena.set_type(node, NODE_SELECTOR_CLASS);
|
|
239
|
-
this.arena.set_start_offset(node, dot_pos);
|
|
240
|
-
this.arena.set_length(node, this.lexer.token_end - dot_pos);
|
|
241
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
242
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
243
|
-
this.arena.set_content_start(node, this.lexer.token_start);
|
|
244
|
-
this.arena.set_content_length(node, this.lexer.token_end - this.lexer.token_start);
|
|
245
|
-
return node;
|
|
231
|
+
return this.create_node(NODE_SELECTOR_CLASS, dot_pos, this.lexer.token_end);
|
|
246
232
|
}
|
|
247
233
|
// Parse attribute selector ([attr], [attr=value], etc.)
|
|
248
234
|
parse_attribute_selector(start) {
|
|
@@ -264,12 +250,7 @@ class SelectorParser {
|
|
|
264
250
|
}
|
|
265
251
|
}
|
|
266
252
|
}
|
|
267
|
-
let node = this.
|
|
268
|
-
this.arena.set_type(node, NODE_SELECTOR_ATTRIBUTE);
|
|
269
|
-
this.arena.set_start_offset(node, start);
|
|
270
|
-
this.arena.set_length(node, end - start);
|
|
271
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
272
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
253
|
+
let node = this.create_node(NODE_SELECTOR_ATTRIBUTE, start, end);
|
|
273
254
|
this.parse_attribute_content(node, content_start, content_end);
|
|
274
255
|
return node;
|
|
275
256
|
}
|
|
@@ -387,12 +368,11 @@ class SelectorParser {
|
|
|
387
368
|
this.lexer.next_token_fast(false);
|
|
388
369
|
let token_type = this.lexer.token_type;
|
|
389
370
|
if (token_type === TOKEN_IDENT) {
|
|
390
|
-
let node = this.
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
371
|
+
let node = this.create_node(
|
|
372
|
+
is_pseudo_element ? NODE_SELECTOR_PSEUDO_ELEMENT : NODE_SELECTOR_PSEUDO_CLASS,
|
|
373
|
+
start,
|
|
374
|
+
this.lexer.token_end
|
|
375
|
+
);
|
|
396
376
|
this.arena.set_content_start(node, this.lexer.token_start);
|
|
397
377
|
this.arena.set_content_length(node, this.lexer.token_end - this.lexer.token_start);
|
|
398
378
|
if (is_vendor_prefixed(this.source, this.lexer.token_start, this.lexer.token_end)) {
|
|
@@ -431,12 +411,7 @@ class SelectorParser {
|
|
|
431
411
|
}
|
|
432
412
|
}
|
|
433
413
|
}
|
|
434
|
-
let node = this.
|
|
435
|
-
this.arena.set_type(node, is_pseudo_element ? NODE_SELECTOR_PSEUDO_ELEMENT : NODE_SELECTOR_PSEUDO_CLASS);
|
|
436
|
-
this.arena.set_start_offset(node, start);
|
|
437
|
-
this.arena.set_length(node, end - start);
|
|
438
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
439
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
414
|
+
let node = this.create_node(is_pseudo_element ? NODE_SELECTOR_PSEUDO_ELEMENT : NODE_SELECTOR_PSEUDO_CLASS, start, end);
|
|
440
415
|
this.arena.set_content_start(node, func_name_start);
|
|
441
416
|
this.arena.set_content_length(node, func_name_end - func_name_start);
|
|
442
417
|
this.arena.set_flag(node, FLAG_HAS_PARENS);
|
|
@@ -493,12 +468,7 @@ class SelectorParser {
|
|
|
493
468
|
continue;
|
|
494
469
|
}
|
|
495
470
|
if (token_type === TOKEN_STRING || token_type === TOKEN_IDENT) {
|
|
496
|
-
let lang_node = this.
|
|
497
|
-
this.arena.set_type(lang_node, NODE_SELECTOR_LANG);
|
|
498
|
-
this.arena.set_start_offset(lang_node, token_start);
|
|
499
|
-
this.arena.set_length(lang_node, token_end - token_start);
|
|
500
|
-
this.arena.set_start_line(lang_node, this.lexer.line);
|
|
501
|
-
this.arena.set_start_column(lang_node, this.lexer.column);
|
|
471
|
+
let lang_node = this.create_node(NODE_SELECTOR_LANG, token_start, token_end);
|
|
502
472
|
if (first_child === null) {
|
|
503
473
|
first_child = lang_node;
|
|
504
474
|
}
|
|
@@ -568,54 +538,9 @@ class SelectorParser {
|
|
|
568
538
|
}
|
|
569
539
|
return -1;
|
|
570
540
|
}
|
|
571
|
-
|
|
572
|
-
create_type_selector(start, end) {
|
|
573
|
-
let node = this.arena.create_node();
|
|
574
|
-
this.arena.set_type(node, NODE_SELECTOR_TYPE);
|
|
575
|
-
this.arena.set_start_offset(node, start);
|
|
576
|
-
this.arena.set_length(node, end - start);
|
|
577
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
578
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
579
|
-
this.arena.set_content_start(node, start);
|
|
580
|
-
this.arena.set_content_length(node, end - start);
|
|
581
|
-
return node;
|
|
582
|
-
}
|
|
583
|
-
create_id_selector(start, end) {
|
|
584
|
-
let node = this.arena.create_node();
|
|
585
|
-
this.arena.set_type(node, NODE_SELECTOR_ID);
|
|
586
|
-
this.arena.set_start_offset(node, start);
|
|
587
|
-
this.arena.set_length(node, end - start);
|
|
588
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
589
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
590
|
-
this.arena.set_content_start(node, start + 1);
|
|
591
|
-
this.arena.set_content_length(node, end - start - 1);
|
|
592
|
-
return node;
|
|
593
|
-
}
|
|
594
|
-
create_universal_selector(start, end) {
|
|
595
|
-
let node = this.arena.create_node();
|
|
596
|
-
this.arena.set_type(node, NODE_SELECTOR_UNIVERSAL);
|
|
597
|
-
this.arena.set_start_offset(node, start);
|
|
598
|
-
this.arena.set_length(node, end - start);
|
|
599
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
600
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
601
|
-
this.arena.set_content_start(node, start);
|
|
602
|
-
this.arena.set_content_length(node, end - start);
|
|
603
|
-
return node;
|
|
604
|
-
}
|
|
605
|
-
create_nesting_selector(start, end) {
|
|
606
|
-
let node = this.arena.create_node();
|
|
607
|
-
this.arena.set_type(node, NODE_SELECTOR_NESTING);
|
|
608
|
-
this.arena.set_start_offset(node, start);
|
|
609
|
-
this.arena.set_length(node, end - start);
|
|
610
|
-
this.arena.set_start_line(node, this.lexer.line);
|
|
611
|
-
this.arena.set_start_column(node, this.lexer.column);
|
|
612
|
-
this.arena.set_content_start(node, start);
|
|
613
|
-
this.arena.set_content_length(node, end - start);
|
|
614
|
-
return node;
|
|
615
|
-
}
|
|
616
|
-
create_combinator(start, end) {
|
|
541
|
+
create_node(type, start, end) {
|
|
617
542
|
let node = this.arena.create_node();
|
|
618
|
-
this.arena.set_type(node,
|
|
543
|
+
this.arena.set_type(node, type);
|
|
619
544
|
this.arena.set_start_offset(node, start);
|
|
620
545
|
this.arena.set_length(node, end - start);
|
|
621
546
|
this.arena.set_start_line(node, this.lexer.line);
|
package/dist/parse-value.d.ts
CHANGED
package/dist/parse-value.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as Lexer, y as TOKEN_EOF, q as TOKEN_COMMA, h as TOKEN_DELIM, a as TOKEN_FUNCTION, c as TOKEN_HASH, d as TOKEN_STRING, k as TOKEN_DIMENSION, j as TOKEN_PERCENTAGE, i as TOKEN_NUMBER, T as TOKEN_IDENT,
|
|
2
|
-
import {
|
|
1
|
+
import { L as Lexer, y as TOKEN_EOF, t as TOKEN_LEFT_PAREN, q as TOKEN_COMMA, h as TOKEN_DELIM, a as TOKEN_FUNCTION, c as TOKEN_HASH, d as TOKEN_STRING, k as TOKEN_DIMENSION, j as TOKEN_PERCENTAGE, i as TOKEN_NUMBER, T as TOKEN_IDENT, u as TOKEN_RIGHT_PAREN } from './lexer-CtBKgfVv.js';
|
|
2
|
+
import { Y as CSSDataArena, C as CSSNode, a9 as is_whitespace, u as NODE_VALUE_OPERATOR, s as NODE_VALUE_COLOR, r as NODE_VALUE_STRING, q as NODE_VALUE_DIMENSION, p as NODE_VALUE_NUMBER, o as NODE_VALUE_KEYWORD, a4 as CHAR_PLUS, an as CHAR_MINUS_HYPHEN, a7 as CHAR_ASTERISK, ao as CHAR_FORWARD_SLASH, t as NODE_VALUE_FUNCTION, v as NODE_VALUE_PARENTHESIS } from './css-node-aIMm9_Cb.js';
|
|
3
3
|
|
|
4
4
|
class ValueParser {
|
|
5
5
|
lexer;
|
|
@@ -68,6 +68,8 @@ class ValueParser {
|
|
|
68
68
|
return this.parse_operator_node(start, end);
|
|
69
69
|
case TOKEN_COMMA:
|
|
70
70
|
return this.create_node(NODE_VALUE_OPERATOR, start, end);
|
|
71
|
+
case TOKEN_LEFT_PAREN:
|
|
72
|
+
return this.parse_parenthesis_node(start, end);
|
|
71
73
|
default:
|
|
72
74
|
return null;
|
|
73
75
|
}
|
|
@@ -98,9 +100,46 @@ class ValueParser {
|
|
|
98
100
|
let name_end = end - 1;
|
|
99
101
|
this.arena.set_content_start(node, start);
|
|
100
102
|
this.arena.set_content_length(node, name_end - start);
|
|
103
|
+
let func_name = this.source.substring(start, name_end).toLowerCase();
|
|
104
|
+
if (func_name === "url" || func_name === "src") {
|
|
105
|
+
let save_pos = this.lexer.save_position();
|
|
106
|
+
this.lexer.next_token_fast(false);
|
|
107
|
+
while (this.is_whitespace_token() && this.lexer.pos < this.value_end) {
|
|
108
|
+
this.lexer.next_token_fast(false);
|
|
109
|
+
}
|
|
110
|
+
let first_token_type = this.lexer.token_type;
|
|
111
|
+
this.lexer.restore_position(save_pos);
|
|
112
|
+
if (first_token_type === TOKEN_STRING) ; else {
|
|
113
|
+
let paren_depth2 = 1;
|
|
114
|
+
let func_end2 = end;
|
|
115
|
+
let content_start2 = end;
|
|
116
|
+
let content_end2 = end;
|
|
117
|
+
while (paren_depth2 > 0) {
|
|
118
|
+
this.lexer.next_token_fast(false);
|
|
119
|
+
let token_type = this.lexer.token_type;
|
|
120
|
+
if (token_type === TOKEN_EOF) break;
|
|
121
|
+
if (token_type === TOKEN_LEFT_PAREN || token_type === TOKEN_FUNCTION) {
|
|
122
|
+
paren_depth2++;
|
|
123
|
+
} else if (token_type === TOKEN_RIGHT_PAREN) {
|
|
124
|
+
paren_depth2--;
|
|
125
|
+
if (paren_depth2 === 0) {
|
|
126
|
+
content_end2 = this.lexer.token_start;
|
|
127
|
+
func_end2 = this.lexer.token_end;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
this.arena.set_length(node, func_end2 - start);
|
|
133
|
+
this.arena.set_value_start(node, content_start2);
|
|
134
|
+
this.arena.set_value_length(node, content_end2 - content_start2);
|
|
135
|
+
return node;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
101
138
|
let args = [];
|
|
102
139
|
let paren_depth = 1;
|
|
103
140
|
let func_end = end;
|
|
141
|
+
let content_start = end;
|
|
142
|
+
let content_end = end;
|
|
104
143
|
while (this.lexer.pos < this.value_end && paren_depth > 0) {
|
|
105
144
|
this.lexer.next_token_fast(false);
|
|
106
145
|
let token_type = this.lexer.token_type;
|
|
@@ -111,6 +150,7 @@ class ValueParser {
|
|
|
111
150
|
} else if (token_type === TOKEN_RIGHT_PAREN) {
|
|
112
151
|
paren_depth--;
|
|
113
152
|
if (paren_depth === 0) {
|
|
153
|
+
content_end = this.lexer.token_start;
|
|
114
154
|
func_end = this.lexer.token_end;
|
|
115
155
|
break;
|
|
116
156
|
}
|
|
@@ -122,6 +162,8 @@ class ValueParser {
|
|
|
122
162
|
}
|
|
123
163
|
}
|
|
124
164
|
this.arena.set_length(node, func_end - start);
|
|
165
|
+
this.arena.set_value_start(node, content_start);
|
|
166
|
+
this.arena.set_value_length(node, content_end - content_start);
|
|
125
167
|
if (args.length > 0) {
|
|
126
168
|
this.arena.set_first_child(node, args[0]);
|
|
127
169
|
this.arena.set_last_child(node, args[args.length - 1]);
|
|
@@ -131,6 +173,41 @@ class ValueParser {
|
|
|
131
173
|
}
|
|
132
174
|
return node;
|
|
133
175
|
}
|
|
176
|
+
parse_parenthesis_node(start, end) {
|
|
177
|
+
let node = this.arena.create_node();
|
|
178
|
+
this.arena.set_type(node, NODE_VALUE_PARENTHESIS);
|
|
179
|
+
this.arena.set_start_offset(node, start);
|
|
180
|
+
let children = [];
|
|
181
|
+
let paren_depth = 1;
|
|
182
|
+
let paren_end = end;
|
|
183
|
+
while (this.lexer.pos < this.value_end && paren_depth > 0) {
|
|
184
|
+
this.lexer.next_token_fast(false);
|
|
185
|
+
let token_type = this.lexer.token_type;
|
|
186
|
+
if (token_type === TOKEN_EOF) break;
|
|
187
|
+
if (this.lexer.token_start >= this.value_end) break;
|
|
188
|
+
if (token_type === TOKEN_RIGHT_PAREN) {
|
|
189
|
+
paren_depth--;
|
|
190
|
+
if (paren_depth === 0) {
|
|
191
|
+
paren_end = this.lexer.token_end;
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (this.is_whitespace_token()) continue;
|
|
196
|
+
let child_node = this.parse_value_node();
|
|
197
|
+
if (child_node !== null) {
|
|
198
|
+
children.push(child_node);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
this.arena.set_length(node, paren_end - start);
|
|
202
|
+
if (children.length > 0) {
|
|
203
|
+
this.arena.set_first_child(node, children[0]);
|
|
204
|
+
this.arena.set_last_child(node, children[children.length - 1]);
|
|
205
|
+
for (let i = 0; i < children.length - 1; i++) {
|
|
206
|
+
this.arena.set_next_sibling(children[i], children[i + 1]);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return node;
|
|
210
|
+
}
|
|
134
211
|
}
|
|
135
212
|
function parse_value(value_string) {
|
|
136
213
|
const arena = new CSSDataArena(CSSDataArena.capacity_for_source(value_string.length));
|
package/dist/parse.d.ts
CHANGED
|
@@ -38,4 +38,4 @@ export declare class Parser {
|
|
|
38
38
|
* @returns The root CSSNode of the AST
|
|
39
39
|
*/
|
|
40
40
|
export declare function parse(source: string, options?: ParserOptions): CSSNode;
|
|
41
|
-
export { NODE_STYLESHEET, NODE_STYLE_RULE, NODE_AT_RULE, NODE_DECLARATION, NODE_SELECTOR, NODE_COMMENT, NODE_BLOCK, NODE_VALUE_KEYWORD, NODE_VALUE_NUMBER, NODE_VALUE_DIMENSION, NODE_VALUE_STRING, NODE_VALUE_COLOR, NODE_VALUE_FUNCTION, NODE_VALUE_OPERATOR, NODE_SELECTOR_LIST, NODE_SELECTOR_TYPE, NODE_SELECTOR_CLASS, NODE_SELECTOR_ID, NODE_SELECTOR_ATTRIBUTE, NODE_SELECTOR_PSEUDO_CLASS, NODE_SELECTOR_PSEUDO_ELEMENT, NODE_SELECTOR_COMBINATOR, NODE_SELECTOR_UNIVERSAL, NODE_SELECTOR_NESTING, NODE_SELECTOR_NTH, NODE_SELECTOR_NTH_OF, NODE_SELECTOR_LANG, NODE_PRELUDE_MEDIA_QUERY, NODE_PRELUDE_MEDIA_FEATURE, NODE_PRELUDE_MEDIA_TYPE, NODE_PRELUDE_CONTAINER_QUERY, NODE_PRELUDE_SUPPORTS_QUERY, NODE_PRELUDE_LAYER_NAME, NODE_PRELUDE_IDENTIFIER, NODE_PRELUDE_OPERATOR, NODE_PRELUDE_IMPORT_URL, NODE_PRELUDE_IMPORT_LAYER, NODE_PRELUDE_IMPORT_SUPPORTS, FLAG_IMPORTANT, } from './arena';
|
|
41
|
+
export { NODE_STYLESHEET, NODE_STYLE_RULE, NODE_AT_RULE, NODE_DECLARATION, NODE_SELECTOR, NODE_COMMENT, NODE_BLOCK, NODE_VALUE_KEYWORD, NODE_VALUE_NUMBER, NODE_VALUE_DIMENSION, NODE_VALUE_STRING, NODE_VALUE_COLOR, NODE_VALUE_FUNCTION, NODE_VALUE_OPERATOR, NODE_VALUE_PARENTHESIS, NODE_SELECTOR_LIST, NODE_SELECTOR_TYPE, NODE_SELECTOR_CLASS, NODE_SELECTOR_ID, NODE_SELECTOR_ATTRIBUTE, NODE_SELECTOR_PSEUDO_CLASS, NODE_SELECTOR_PSEUDO_ELEMENT, NODE_SELECTOR_COMBINATOR, NODE_SELECTOR_UNIVERSAL, NODE_SELECTOR_NESTING, NODE_SELECTOR_NTH, NODE_SELECTOR_NTH_OF, NODE_SELECTOR_LANG, NODE_PRELUDE_MEDIA_QUERY, NODE_PRELUDE_MEDIA_FEATURE, NODE_PRELUDE_MEDIA_TYPE, NODE_PRELUDE_CONTAINER_QUERY, NODE_PRELUDE_SUPPORTS_QUERY, NODE_PRELUDE_LAYER_NAME, NODE_PRELUDE_IDENTIFIER, NODE_PRELUDE_OPERATOR, NODE_PRELUDE_IMPORT_URL, NODE_PRELUDE_IMPORT_LAYER, NODE_PRELUDE_IMPORT_SUPPORTS, FLAG_IMPORTANT, } from './arena';
|
package/dist/parse.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as Lexer, y as TOKEN_EOF, b as TOKEN_AT_KEYWORD, v as TOKEN_LEFT_BRACE, w as TOKEN_RIGHT_BRACE, T as TOKEN_IDENT, o as TOKEN_COLON, p as TOKEN_SEMICOLON, h as TOKEN_DELIM } from './lexer-CtBKgfVv.js';
|
|
2
|
-
import {
|
|
3
|
-
export { k as NODE_COMMENT,
|
|
2
|
+
import { Y as CSSDataArena, n as NODE_STYLESHEET, C as CSSNode, N as NODE_STYLE_RULE, Z as FLAG_HAS_BLOCK, _ as NODE_BLOCK, $ as FLAG_HAS_DECLARATIONS, w as NODE_SELECTOR_LIST, l as NODE_DECLARATION, a0 as is_vendor_prefixed, a1 as FLAG_VENDOR_PREFIXED, a2 as trim_boundaries, X as FLAG_IMPORTANT, j as NODE_AT_RULE } from './css-node-aIMm9_Cb.js';
|
|
3
|
+
export { k as NODE_COMMENT, P as NODE_PRELUDE_CONTAINER_QUERY, S as NODE_PRELUDE_IDENTIFIER, V as NODE_PRELUDE_IMPORT_LAYER, W as NODE_PRELUDE_IMPORT_SUPPORTS, U as NODE_PRELUDE_IMPORT_URL, R as NODE_PRELUDE_LAYER_NAME, M as NODE_PRELUDE_MEDIA_FEATURE, L as NODE_PRELUDE_MEDIA_QUERY, O as NODE_PRELUDE_MEDIA_TYPE, T as NODE_PRELUDE_OPERATOR, Q as NODE_PRELUDE_SUPPORTS_QUERY, m as NODE_SELECTOR, B as NODE_SELECTOR_ATTRIBUTE, y as NODE_SELECTOR_CLASS, F as NODE_SELECTOR_COMBINATOR, z as NODE_SELECTOR_ID, K as NODE_SELECTOR_LANG, H as NODE_SELECTOR_NESTING, I as NODE_SELECTOR_NTH, J as NODE_SELECTOR_NTH_OF, D as NODE_SELECTOR_PSEUDO_CLASS, E as NODE_SELECTOR_PSEUDO_ELEMENT, x as NODE_SELECTOR_TYPE, G as NODE_SELECTOR_UNIVERSAL, s as NODE_VALUE_COLOR, q as NODE_VALUE_DIMENSION, t as NODE_VALUE_FUNCTION, o as NODE_VALUE_KEYWORD, p as NODE_VALUE_NUMBER, u as NODE_VALUE_OPERATOR, v as NODE_VALUE_PARENTHESIS, r as NODE_VALUE_STRING } from './css-node-aIMm9_Cb.js';
|
|
4
4
|
import { ValueParser } from './parse-value.js';
|
|
5
5
|
import { SelectorParser } from './parse-selector.js';
|
|
6
6
|
import { AtRulePreludeParser } from './parse-atrule-prelude.js';
|
package/package.json
CHANGED