@formulavize/lezer-fiz 1.0.0 → 2.1.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/.github/workflows/ci.yml +2 -2
- package/dist/index.cjs +8 -8
- package/dist/index.es.js +8 -8
- package/package.json +9 -9
- package/src/fiz.grammar +6 -7
- package/test/namespaces.txt +1 -1
- package/test/qualifiers.txt +1 -1
- package/test/styling.txt +133 -3
package/.github/workflows/ci.yml
CHANGED
|
@@ -19,12 +19,12 @@ jobs:
|
|
|
19
19
|
- name: Install pnpm
|
|
20
20
|
uses: pnpm/action-setup@v4
|
|
21
21
|
with:
|
|
22
|
-
version:
|
|
22
|
+
version: 10
|
|
23
23
|
|
|
24
24
|
- name: Set up Node.js
|
|
25
25
|
uses: actions/setup-node@v4
|
|
26
26
|
with:
|
|
27
|
-
node-version:
|
|
27
|
+
node-version: 24
|
|
28
28
|
cache: pnpm
|
|
29
29
|
|
|
30
30
|
- run: pnpm install --frozen-lockfile
|
package/dist/index.cjs
CHANGED
|
@@ -110,24 +110,24 @@ const fizHighlighting = highlight.styleTags({
|
|
|
110
110
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
111
111
|
const parser = lr.LRParser.deserialize({
|
|
112
112
|
version: 14,
|
|
113
|
-
states: "
|
|
114
|
-
stateData: ")
|
|
115
|
-
goto: "
|
|
116
|
-
nodeNames: "⚠ Unit LineComment BlockComment Recipe Call Identifier ) ( ArgList RhsVariable QualifiableIdentifier . } { StyleArgList StyleDeclaration PropertyName : ColorLiteral NumberLiteral StringLiteral StyleTag # Assignment LhsVariable Eq Namespace ] [ StatementList Import @ StyleTagDeclaration StyleBinding %
|
|
113
|
+
states: "+|Q`QSOOO!YQdO'#CgOOQ`'#Cf'#CfO!gQSO'#CzO!nQdO'#CwO!|QSO'#C{O#RQSO'#CtO#ZQSO'#C}O#`QSO'#DOO#eQSO'#DQO#jQdO'#D`OOQO'#DS'#DSQ`QSOOO#rQSO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O~Ol!TO~P`OU!UO~Oj!XO!UjO~OU!YOmROpTO~O^`O~OW_O[]OVZX!UZX~OV!aO!U!_O~Ob!bO~OU!cO~O]!fOe|Og{O}yO~O^`O!Oki!Yki~O^`OjiX!UiX~OUuO~OV!kO!U!_O~Oc!mOe!mO!W!lO~O[]O]ZXeZXgZX}ZX~OP!oO!OdX!UdX!YdX~O!OpO!U!pO!YpO~O!Q!RU!R~",
|
|
115
|
+
goto: "&^!YPPPPP!ZPPP!k!Z!vPPP#T#o#sPP#wP#oP#{$RP$[PP$h$[P#{#{P#{P$t%O%X%_%e%kPPPPPP%q%wP%}P&TWYOR[fSv_!_Q!ZlR!h!XUaPu!YQhSR!Rc`QOR[_fl!X!_R!d{SbP!UQgSQ!PaS!QchQ![mQ!]nQ!^oR!g!RT|`}Tz`}T!m!b!pXYOR[fWUOR[fR!VjWYOR[fQ!ZlR!h!X[SOR[fl!XTcP!YQ[OQfRTr[fW^Pu!Y!cRt^Q!`xR!j!`Q}`R!e}Q!q!nR!t!qQkUR!WkXZOR[fQx_R!i!_Q!n!bR!s!pQqYQ!r!nR!u!q",
|
|
116
|
+
nodeNames: "⚠ Unit LineComment BlockComment Recipe Call Identifier ) ( ArgList RhsVariable QualifiableIdentifier . } { StyleArgList StyleDeclaration PropertyName : ColorLiteral NumberLiteral StringLiteral StyleTag # Assignment LhsVariable Eq Namespace ] [ StatementList Import @ StyleTagDeclaration StyleBinding % GlobalStyleBinding *",
|
|
117
117
|
maxTerm: 56,
|
|
118
118
|
context: trackNewline,
|
|
119
119
|
nodeProps: [
|
|
120
|
-
["group", -2,5,10,"Statement Value",-3,19,20,21,"StyleValue",-
|
|
120
|
+
["group", -2,5,10,"Statement Value",-3,19,20,21,"StyleValue",-6,24,27,31,33,34,36,"Statement"],
|
|
121
121
|
["openedBy", 7,"(",13,"{",28,"["],
|
|
122
122
|
["closedBy", 8,")",14,"}",29,"]"]
|
|
123
123
|
],
|
|
124
124
|
propSources: [fizHighlighting],
|
|
125
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O*T#O#P*p#P;'S*T;'S;=`+l;=`<%l*T<%lO*T~+oP;=`<%l*T~+wOW~~+|OV~~,ROu~Q,UQ!O!P,[!Q![-[Q,_P!Q![,bQ,gR!WQ!Q![,b!g!h,p#X#Y,pQ,sR{|,|}!O,|!Q![-SQ-PP!Q![-SQ-XP!WQ!Q![-SQ-aS!WQ!O!P,b!Q![-[!g!h,p#X#Y,p~-rO!U~R-wP[P!Q![,b~-}Qz{.T!P!Q/[~.WTOz.Tz{.g{;'S.T;'S;=`/U<%lO.T~.jVOz.Tz{.g{!P.T!P!Q/P!Q;'S.T;'S;=`/U<%lO.T~/UOR~~/XP;=`<%l.T~/aSQ~OY/[Z;'S/[;'S;=`/m<%lO/[~/pP;=`<%l/[~/xOb~~/}O!Y~~0SOj~~0XOp~~0^Om~~0cOl~~0hO^~~0mO]~~0th!Q~U~XY$[Z[$[pq$[tu)Z!Q![)Z!c!})Z#R#S)Z#T#o)Z$f$g$[$g#BY)Z#BY#BZ0m#BZ$IS)Z$IS$I_0m$I_$JT)Z$JT$JU0m$JU$KV)Z$KV$KW0m$KW&FU)Z&FU&FV0m&FV;'S)Z;'S;=`)x<%l?HT)Z?HT?HU0m?HUO)Z~2gW!R~U~tu)Z!Q![)Z!c!})Z#R#S)Z#T#o)Z$g;'S)Z;'S;=`)x<%lO)Z",
|
|
128
128
|
tokenizers: [unitToken, cssIdentifierToken, 0, 1, insertSemicolon],
|
|
129
129
|
topRules: {"Recipe":[0,4]},
|
|
130
|
-
tokenPrec:
|
|
130
|
+
tokenPrec: 388
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
exports.parser = parser;
|
package/dist/index.es.js
CHANGED
|
@@ -108,24 +108,24 @@ const fizHighlighting = styleTags({
|
|
|
108
108
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
109
109
|
const parser = LRParser.deserialize({
|
|
110
110
|
version: 14,
|
|
111
|
-
states: "
|
|
112
|
-
stateData: ")
|
|
113
|
-
goto: "
|
|
114
|
-
nodeNames: "⚠ Unit LineComment BlockComment Recipe Call Identifier ) ( ArgList RhsVariable QualifiableIdentifier . } { StyleArgList StyleDeclaration PropertyName : ColorLiteral NumberLiteral StringLiteral StyleTag # Assignment LhsVariable Eq Namespace ] [ StatementList Import @ StyleTagDeclaration StyleBinding %
|
|
111
|
+
states: "+|Q`QSOOO!YQdO'#CgOOQ`'#Cf'#CfO!gQSO'#CzO!nQdO'#CwO!|QSO'#C{O#RQSO'#CtO#ZQSO'#C}O#`QSO'#DOO#eQSO'#DQO#jQdO'#D`OOQO'#DS'#DSQ`QSOOO#rQSO'#DTO#wQfO,59RO$fQSO'#CeO$nQUO'#CkO$|QdO,58{OOQO,59a,59aO%_QdO,59cO%mQSO,59gOOQ`,59f,59fO%rQSO,59fOOQ`,59c,59cO%bQdO,59cOOQ`,59g,59gO%yQSO'#DXO&OQSO,59`O&WQSO,59`O&cQSO,59iO&cQSO,59jO&cQSO,59lOOQQ'#De'#DeOOQO,59z,59zOOQO-E7Q-E7QOOQb,59o,59oOOQb-E7R-E7RO&hQSO'#CgOOQO'#Da'#DaOOQ`,59P,59PO&vQSO,59POOQO'#Cm'#CmO'OQSO'#ClO'TQSO'#CrOOQQ'#DV'#DVO'YQUO,59VOOQ`,59V,59VOOQ`1G.g1G.gOOQ`1G.}1G.}O'hQdO1G.}OOQ`1G/R1G/ROOQ`1G/Q1G/QO'sQSO'#CuOOQO,59s,59sOOQO-E7V-E7VO&WQSO1G.zOtQdO'#CgOOQ`1G.z1G.zOOQ`1G/T1G/TOOQ`1G/U1G/UOOQ`1G/W1G/WO(OQSO'#DUO(TQSO1G.kOOQ`1G.k1G.kO(]QWO,59WO(hQUO'#CgOOQQ,59^,59^OOQQ-E7T-E7TOOQ`1G.q1G.qOOQ`7+$i7+$iOOQ`7+$f7+$fOOQO,59p,59pOOQO-E7S-E7SOOQ`7+$V7+$VO(yQeO'#CpOOQ`'#Dc'#DcO)XQdO1G.rOOQ`,59[,59[O(]QWO'#DWO)XQdO7+$^OOQQ7+$^7+$^OOQ`,59r,59rOOQ`-E7U-E7UOOQQ<<Gx<<Gx",
|
|
112
|
+
stateData: ")i~O!QOS!ROSQOSROS~OUPOgVOmROpTOsWOuXO~OW_O[]OmROpdO!OZX!YZX~O^`OjiX!UiX~PtOleO~P`OW_O^`O!OkX!YkX~OeiO~OjlO!UjO~OUmO~OUnO~OUoO~O!OpO!YpO~OUsO~O[]O!OZa!YZaVZa!UZa]ZaeZagZa}Za~OUuOVwO~O]!OOe|Og{O}yO~O^`O!OTa!YTaVTa!UTa~OW_O^`O!Oka!Yka~Oe!SO~Ol!TO~P`OU!UO~Oj!XO!UjO~OU!YOmROpTO~O^`O~OW_O[]OVZX!UZX~OV!aO!U!_O~Ob!bO~OU!cO~O]!fOe|Og{O}yO~O^`O!Oki!Yki~O^`OjiX!UiX~OUuO~OV!kO!U!_O~Oc!mOe!mO!W!lO~O[]O]ZXeZXgZX}ZX~OP!oO!OdX!UdX!YdX~O!OpO!U!pO!YpO~O!Q!RU!R~",
|
|
113
|
+
goto: "&^!YPPPPP!ZPPP!k!Z!vPPP#T#o#sPP#wP#oP#{$RP$[PP$h$[P#{#{P#{P$t%O%X%_%e%kPPPPPP%q%wP%}P&TWYOR[fSv_!_Q!ZlR!h!XUaPu!YQhSR!Rc`QOR[_fl!X!_R!d{SbP!UQgSQ!PaS!QchQ![mQ!]nQ!^oR!g!RT|`}Tz`}T!m!b!pXYOR[fWUOR[fR!VjWYOR[fQ!ZlR!h!X[SOR[fl!XTcP!YQ[OQfRTr[fW^Pu!Y!cRt^Q!`xR!j!`Q}`R!e}Q!q!nR!t!qQkUR!WkXZOR[fQx_R!i!_Q!n!bR!s!pQqYQ!r!nR!u!q",
|
|
114
|
+
nodeNames: "⚠ Unit LineComment BlockComment Recipe Call Identifier ) ( ArgList RhsVariable QualifiableIdentifier . } { StyleArgList StyleDeclaration PropertyName : ColorLiteral NumberLiteral StringLiteral StyleTag # Assignment LhsVariable Eq Namespace ] [ StatementList Import @ StyleTagDeclaration StyleBinding % GlobalStyleBinding *",
|
|
115
115
|
maxTerm: 56,
|
|
116
116
|
context: trackNewline,
|
|
117
117
|
nodeProps: [
|
|
118
|
-
["group", -2,5,10,"Statement Value",-3,19,20,21,"StyleValue",-
|
|
118
|
+
["group", -2,5,10,"Statement Value",-3,19,20,21,"StyleValue",-6,24,27,31,33,34,36,"Statement"],
|
|
119
119
|
["openedBy", 7,"(",13,"{",28,"["],
|
|
120
120
|
["closedBy", 8,")",14,"}",29,"]"]
|
|
121
121
|
],
|
|
122
122
|
propSources: [fizHighlighting],
|
|
123
123
|
skippedNodes: [0,2,3],
|
|
124
|
-
repeatNodeCount:
|
|
125
|
-
tokenData: "
|
|
124
|
+
repeatNodeCount: 6,
|
|
125
|
+
tokenData: "3P~R!RXY$[YZ%PZ[$[]^%Ppq$[rs%Ust&xtu)Zuv*Owx*Txy+ryz+wz{+|{|,R|}-m}!O,R!O!P-r!P!Q-z!Q![-[![!]/s!]!^/x!_!`/}!b!c0S!c!})Z!}#O0X#P#Q0^#R#S)Z#T#o)Z#o#p0c#q#r0h$f$g$[$g#BY)Z#BY#BZ0m#BZ$IS)Z$IS$I_0m$I_$I|)Z$I|$I}2`$I}$JO2`$JO$JT)Z$JT$JU0m$JU$KV)Z$KV$KW0m$KW&FU)Z&FU&FV0m&FV;'S)Z;'S;=`)x<%l?HT)Z?HT?HU0m?HUO)Z~$aY!Q~XY$[Z[$[pq$[$f$g$[#BY#BZ$[$IS$I_$[$JT$JU$[$KV$KW$[&FU&FV$[?HT?HU$[~%UO!R~~%XWOY%UZr%Urs%qs#O%U#O#P%v#P;'S%U;'S;=`&r<%lO%U~%vOe~~%yRO;'S%U;'S;=`&S;=`O%U~&VXOY%UZr%Urs%qs#O%U#O#P%v#P;'S%U;'S;=`&r;=`<%l%U<%lO%U~&uP;=`<%l%UR&}RgP!Q!['W!c!i'W#T#Z'WQ'ZR!Q!['d!c!i'd#T#Z'dQ'gR!Q!['p!c!i'p#T#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ken, 0, 1, insertSemicolon],
|
|
127
127
|
topRules: {"Recipe":[0,4]},
|
|
128
|
-
tokenPrec:
|
|
128
|
+
tokenPrec: 388
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
export { parser };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formulavize/lezer-fiz",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "fiz grammar for lezer",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
"module": "dist/index.es.js",
|
|
12
12
|
"types": "dist/index.d.ts",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lezer/highlight": "^1.2.
|
|
15
|
-
"@lezer/lr": "^1.4.
|
|
14
|
+
"@lezer/highlight": "^1.2.3",
|
|
15
|
+
"@lezer/lr": "^1.4.8"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@lezer/generator": "^1.8.0",
|
|
19
19
|
"chokidar-cli": "^3.0.0",
|
|
20
|
-
"mocha": "^11.7.
|
|
20
|
+
"mocha": "^11.7.5",
|
|
21
21
|
"npm-run-all": "^4.1.5",
|
|
22
|
-
"only-allow": "^1.2.
|
|
23
|
-
"prettier": "^3.
|
|
24
|
-
"rollup": "^4.
|
|
22
|
+
"only-allow": "^1.2.2",
|
|
23
|
+
"prettier": "^3.8.1",
|
|
24
|
+
"rollup": "^4.60.1"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
28
|
-
"pnpm": ">=
|
|
27
|
+
"node": ">=24.0",
|
|
28
|
+
"pnpm": ">=10"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"preinstall": "npx only-allow pnpm",
|
package/src/fiz.grammar
CHANGED
|
@@ -7,6 +7,7 @@ statement[@isGroup=Statement] {
|
|
|
7
7
|
Assignment |
|
|
8
8
|
StyleTagDeclaration |
|
|
9
9
|
StyleBinding |
|
|
10
|
+
GlobalStyleBinding |
|
|
10
11
|
Namespace |
|
|
11
12
|
Import
|
|
12
13
|
)
|
|
@@ -20,7 +21,7 @@ Call { Identifier ArgList StyleArgList? }
|
|
|
20
21
|
ArgList { "(" ( value ("," value)* )? ")" }
|
|
21
22
|
|
|
22
23
|
value[@isGroup=Value] { RhsVariable | Call }
|
|
23
|
-
// Though inconsistent with Assignment, we disallow Namespace and Imports in ArgList for
|
|
24
|
+
// Though inconsistent with Assignment, we disallow Namespace and Imports in ArgList for readability
|
|
24
25
|
|
|
25
26
|
RhsVariable { QualifiableIdentifier }
|
|
26
27
|
|
|
@@ -48,13 +49,9 @@ StyleTag { "#" QualifiableIdentifier }
|
|
|
48
49
|
|
|
49
50
|
StyleArgList { "{" (StyleDeclaration | StyleTag | StringLiteral)* "}" }
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
Although disallowing StyleDeclarations is inconsistent with other curly brackets
|
|
53
|
-
(i.e. StyleArgList), this forces StyleBinding users to define StyleTags
|
|
54
|
-
that can be reused by others */
|
|
55
|
-
StyleTagList { "{" StyleTag* "}" }
|
|
52
|
+
StyleBinding { "%" Identifier StyleArgList }
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
GlobalStyleBinding { "*" Identifier StyleArgList }
|
|
58
55
|
|
|
59
56
|
StatementList { "[" statement* "]" }
|
|
60
57
|
|
|
@@ -112,6 +109,8 @@ Import { Identifier? "@" StringLiteral }
|
|
|
112
109
|
|
|
113
110
|
"@"
|
|
114
111
|
|
|
112
|
+
"*"
|
|
113
|
+
|
|
115
114
|
"(" ")" "{" "}" "[" "]"
|
|
116
115
|
|
|
117
116
|
}
|
package/test/namespaces.txt
CHANGED
package/test/qualifiers.txt
CHANGED
package/test/styling.txt
CHANGED
|
@@ -217,7 +217,7 @@ Recipe(
|
|
|
217
217
|
)
|
|
218
218
|
)
|
|
219
219
|
|
|
220
|
-
# Style Binding
|
|
220
|
+
# Style Binding with StyleTags
|
|
221
221
|
|
|
222
222
|
%a{}
|
|
223
223
|
%b{
|
|
@@ -227,16 +227,146 @@ Recipe(
|
|
|
227
227
|
==>
|
|
228
228
|
|
|
229
229
|
Recipe(
|
|
230
|
-
StyleBinding(Identifier,
|
|
230
|
+
StyleBinding(Identifier, StyleArgList())
|
|
231
231
|
StyleBinding(
|
|
232
232
|
Identifier,
|
|
233
|
-
|
|
233
|
+
StyleArgList(
|
|
234
234
|
StyleTag(QualifiableIdentifier(Identifier))
|
|
235
235
|
StyleTag(QualifiableIdentifier(Identifier)),
|
|
236
236
|
)
|
|
237
237
|
)
|
|
238
238
|
)
|
|
239
239
|
|
|
240
|
+
# Style Binding with Style Declarations
|
|
241
|
+
|
|
242
|
+
%c{
|
|
243
|
+
color: #ff0000
|
|
244
|
+
font-size: 12px
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
==>
|
|
248
|
+
|
|
249
|
+
Recipe(
|
|
250
|
+
StyleBinding(
|
|
251
|
+
Identifier,
|
|
252
|
+
StyleArgList(
|
|
253
|
+
StyleDeclaration(PropertyName, ColorLiteral),
|
|
254
|
+
StyleDeclaration(PropertyName, NumberLiteral(Unit))
|
|
255
|
+
)
|
|
256
|
+
)
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
# Style Binding with StringLiteral
|
|
260
|
+
|
|
261
|
+
%d{
|
|
262
|
+
"description"
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
==>
|
|
266
|
+
|
|
267
|
+
Recipe(
|
|
268
|
+
StyleBinding(
|
|
269
|
+
Identifier,
|
|
270
|
+
StyleArgList(StringLiteral)
|
|
271
|
+
)
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
# Style Binding Mixed Content
|
|
275
|
+
|
|
276
|
+
%e{
|
|
277
|
+
#base
|
|
278
|
+
color: #abc
|
|
279
|
+
"note"
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
==>
|
|
283
|
+
|
|
284
|
+
Recipe(
|
|
285
|
+
StyleBinding(
|
|
286
|
+
Identifier,
|
|
287
|
+
StyleArgList(
|
|
288
|
+
StyleTag(QualifiableIdentifier(Identifier)),
|
|
289
|
+
StyleDeclaration(PropertyName, ColorLiteral),
|
|
290
|
+
StringLiteral
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
# Global Style Binding with StyleTags
|
|
296
|
+
|
|
297
|
+
*nodes{}
|
|
298
|
+
*edges{
|
|
299
|
+
#x #y
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
==>
|
|
303
|
+
|
|
304
|
+
Recipe(
|
|
305
|
+
GlobalStyleBinding(Identifier, StyleArgList())
|
|
306
|
+
GlobalStyleBinding(
|
|
307
|
+
Identifier,
|
|
308
|
+
StyleArgList(
|
|
309
|
+
StyleTag(QualifiableIdentifier(Identifier))
|
|
310
|
+
StyleTag(QualifiableIdentifier(Identifier)),
|
|
311
|
+
)
|
|
312
|
+
)
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
# Global Style Binding with Style Declarations
|
|
316
|
+
|
|
317
|
+
*nodes{
|
|
318
|
+
color: #ff0000
|
|
319
|
+
font-size: 12px
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
==>
|
|
323
|
+
|
|
324
|
+
Recipe(
|
|
325
|
+
GlobalStyleBinding(
|
|
326
|
+
Identifier,
|
|
327
|
+
StyleArgList(
|
|
328
|
+
StyleDeclaration(PropertyName, ColorLiteral),
|
|
329
|
+
StyleDeclaration(PropertyName, NumberLiteral(Unit))
|
|
330
|
+
)
|
|
331
|
+
)
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
# Global Style Binding with StringLiteral
|
|
335
|
+
|
|
336
|
+
*nodes{
|
|
337
|
+
"description"
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
==>
|
|
341
|
+
|
|
342
|
+
Recipe(
|
|
343
|
+
GlobalStyleBinding(
|
|
344
|
+
Identifier,
|
|
345
|
+
StyleArgList(StringLiteral)
|
|
346
|
+
)
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
# Global Style Binding Mixed Content
|
|
350
|
+
|
|
351
|
+
*nodes{
|
|
352
|
+
#base
|
|
353
|
+
color: #abc
|
|
354
|
+
"note"
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
==>
|
|
358
|
+
|
|
359
|
+
Recipe(
|
|
360
|
+
GlobalStyleBinding(
|
|
361
|
+
Identifier,
|
|
362
|
+
StyleArgList(
|
|
363
|
+
StyleTag(QualifiableIdentifier(Identifier)),
|
|
364
|
+
StyleDeclaration(PropertyName, ColorLiteral),
|
|
365
|
+
StringLiteral
|
|
366
|
+
)
|
|
367
|
+
)
|
|
368
|
+
)
|
|
369
|
+
|
|
240
370
|
# Description Shortcut
|
|
241
371
|
|
|
242
372
|
#a{
|