Skip to content

Commit f27d28b

Browse files
committed
Accept name = expr in attributes
Supports the syntax added in the extended_key_value_attributes feature.
1 parent 09a504b commit f27d28b

File tree

4 files changed

+56058
-55359
lines changed

4 files changed

+56058
-55359
lines changed

grammar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ module.exports = grammar({
273273
custom_attr: $ => seq(
274274
$._path,
275275
optional(choice(
276-
seq('=', field('value', $._literal)),
276+
seq('=', field('value', $._expression)),
277277
field('arguments', $.delim_token_tree)
278278
))
279279
),
@@ -297,7 +297,7 @@ module.exports = grammar({
297297
built_in_attr: $ => seq(
298298
$._built_in_attr_path,
299299
optional(choice(
300-
seq('=', field('value', $._literal)),
300+
seq('=', field('value', $._expression)),
301301
field('arguments', $.meta_arguments)
302302
))
303303
),
@@ -309,7 +309,7 @@ module.exports = grammar({
309309
meta_item: $ => seq(
310310
$._path,
311311
optional(choice(
312-
seq('=', field('value', $._literal)),
312+
seq('=', field('value', $._expression)),
313313
field('arguments', $.meta_arguments)
314314
))
315315
),

src/grammar.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@
974974
"name": "value",
975975
"content": {
976976
"type": "SYMBOL",
977-
"name": "_literal"
977+
"name": "_expression"
978978
}
979979
}
980980
]
@@ -1112,7 +1112,7 @@
11121112
"name": "value",
11131113
"content": {
11141114
"type": "SYMBOL",
1115-
"name": "_literal"
1115+
"name": "_expression"
11161116
}
11171117
}
11181118
]
@@ -1569,7 +1569,7 @@
15691569
"name": "value",
15701570
"content": {
15711571
"type": "SYMBOL",
1572-
"name": "_literal"
1572+
"name": "_expression"
15731573
}
15741574
}
15751575
]

src/node-types.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@
658658
"required": false,
659659
"types": [
660660
{
661-
"type": "_literal",
661+
"type": "_expression",
662662
"named": true
663663
}
664664
]
@@ -2826,7 +2826,7 @@
28262826
"required": false,
28272827
"types": [
28282828
{
2829-
"type": "_literal",
2829+
"type": "_expression",
28302830
"named": true
28312831
}
28322832
]

0 commit comments

Comments
 (0)