Skip to content

Commit

Permalink
Accept name = expr in attributes
Browse files Browse the repository at this point in the history
Supports the syntax added in the extended_key_value_attributes feature.
  • Loading branch information
ninevra committed Mar 8, 2022
1 parent 09a504b commit f27d28b
Show file tree
Hide file tree
Showing 4 changed files with 56,058 additions and 55,359 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ module.exports = grammar({
custom_attr: $ => seq(
$._path,
optional(choice(
seq('=', field('value', $._literal)),
seq('=', field('value', $._expression)),
field('arguments', $.delim_token_tree)
))
),
Expand All @@ -297,7 +297,7 @@ module.exports = grammar({
built_in_attr: $ => seq(
$._built_in_attr_path,
optional(choice(
seq('=', field('value', $._literal)),
seq('=', field('value', $._expression)),
field('arguments', $.meta_arguments)
))
),
Expand All @@ -309,7 +309,7 @@ module.exports = grammar({
meta_item: $ => seq(
$._path,
optional(choice(
seq('=', field('value', $._literal)),
seq('=', field('value', $._expression)),
field('arguments', $.meta_arguments)
))
),
Expand Down
6 changes: 3 additions & 3 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_literal"
"name": "_expression"
}
}
]
Expand Down Expand Up @@ -1112,7 +1112,7 @@
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_literal"
"name": "_expression"
}
}
]
Expand Down Expand Up @@ -1569,7 +1569,7 @@
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_literal"
"name": "_expression"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
"required": false,
"types": [
{
"type": "_literal",
"type": "_expression",
"named": true
}
]
Expand Down Expand Up @@ -2826,7 +2826,7 @@
"required": false,
"types": [
{
"type": "_literal",
"type": "_expression",
"named": true
}
]
Expand Down
Loading

0 comments on commit f27d28b

Please sign in to comment.