@eslint/css-tree 3.4.0 → 3.5.0
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/cjs/syntax/node/Block.cjs +15 -1
- package/dist/csstree.esm.js +5 -5
- package/dist/csstree.js +5 -5
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/lib/syntax/node/Block.js +19 -1
- package/package.json +1 -1
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
const types = require('../../tokenizer/types.cjs');
|
|
4
4
|
|
|
5
5
|
const AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)
|
|
6
|
+
const DOT = 0x002E; // U+002E FULL STOP (.)
|
|
7
|
+
const STAR = 0x002A; // U+002A ASTERISK (*);
|
|
8
|
+
|
|
9
|
+
const selectorStarts = new Set([
|
|
10
|
+
AMPERSAND,
|
|
11
|
+
DOT,
|
|
12
|
+
STAR
|
|
13
|
+
]);
|
|
6
14
|
|
|
7
15
|
function consumeRaw() {
|
|
8
16
|
return this.Raw(null, true);
|
|
@@ -27,6 +35,12 @@ function consumeDeclaration() {
|
|
|
27
35
|
return node;
|
|
28
36
|
}
|
|
29
37
|
|
|
38
|
+
function isSelectorStart() {
|
|
39
|
+
return this.tokenType === types.Delim && selectorStarts.has(this.source.charCodeAt(this.tokenStart)) ||
|
|
40
|
+
this.tokenType === types.Hash || this.tokenType === types.LeftSquareBracket ||
|
|
41
|
+
this.tokenType === types.Colon;
|
|
42
|
+
}
|
|
43
|
+
|
|
30
44
|
const name = 'Block';
|
|
31
45
|
const walkContext = 'block';
|
|
32
46
|
const structure = {
|
|
@@ -60,7 +74,7 @@ function parse(isStyleBlock) {
|
|
|
60
74
|
break;
|
|
61
75
|
|
|
62
76
|
default:
|
|
63
|
-
if (isStyleBlock &&
|
|
77
|
+
if (isStyleBlock && isSelectorStart.call(this)) {
|
|
64
78
|
children.push(consumeRule.call(this));
|
|
65
79
|
} else {
|
|
66
80
|
children.push(consumer.call(this));
|