Skip to content

Commit ecbce1e

Browse files
committed
Accept name = expr in attributes
Supports the syntax added in the extended_key_value_attributes feature.
1 parent 2c4c443 commit ecbce1e

File tree

4 files changed

+48841
-48142
lines changed

4 files changed

+48841
-48142
lines changed

grammar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ module.exports = grammar({
278278
custom_attr: $ => seq(
279279
$._path,
280280
optional(choice(
281-
seq('=', field('value', $._literal)),
281+
seq('=', field('value', $._expression)),
282282
field('arguments', $.delim_token_tree)
283283
))
284284
),
285285

286286
built_in_attr: $ => seq(
287287
$._built_in_attr_path,
288288
optional(choice(
289-
seq('=', field('value', $._literal)),
289+
seq('=', field('value', $._expression)),
290290
field('arguments', $.meta_arguments)
291291
))
292292
),
@@ -298,7 +298,7 @@ module.exports = grammar({
298298
meta_item: $ => seq(
299299
$._path,
300300
optional(choice(
301-
seq('=', field('value', $._literal)),
301+
seq('=', field('value', $._expression)),
302302
field('arguments', $.meta_arguments)
303303
))
304304
),

src/grammar.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@
978978
"name": "value",
979979
"content": {
980980
"type": "SYMBOL",
981-
"name": "_literal"
981+
"name": "_expression"
982982
}
983983
}
984984
]
@@ -1025,7 +1025,7 @@
10251025
"name": "value",
10261026
"content": {
10271027
"type": "SYMBOL",
1028-
"name": "_literal"
1028+
"name": "_expression"
10291029
}
10301030
}
10311031
]
@@ -1482,7 +1482,7 @@
14821482
"name": "value",
14831483
"content": {
14841484
"type": "SYMBOL",
1485-
"name": "_literal"
1485+
"name": "_expression"
14861486
}
14871487
}
14881488
]

src/node-types.json

Lines changed: 2 additions & 2 deletions
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
]
@@ -2822,7 +2822,7 @@
28222822
"required": false,
28232823
"types": [
28242824
{
2825-
"type": "_literal",
2825+
"type": "_expression",
28262826
"named": true
28272827
}
28282828
]

0 commit comments

Comments
 (0)