Add 'property' alias
It makes the syntax tree more readable.
This commit is contained in:
parent
644f6483fe
commit
2549f6f0db
6 changed files with 210 additions and 284 deletions
12
grammar.js
12
grammar.js
|
|
@ -41,14 +41,18 @@ module.exports = grammar({
|
|||
_old_module: ($) => seq(
|
||||
field("type", $.identifier),
|
||||
"{",
|
||||
optional(commaSeparated(field("property", $._colon_property))),
|
||||
optional(commaSeparated(
|
||||
alias(field("property", $._colon_property), $.property)
|
||||
)),
|
||||
"}",
|
||||
),
|
||||
|
||||
_new_module: ($) => seq(
|
||||
$.identifier,
|
||||
"(",
|
||||
optional(commaSeparated(field("property", $._equal_property))),
|
||||
optional(commaSeparated(
|
||||
alias(field("property", $._equal_property), $.property)
|
||||
)),
|
||||
")",
|
||||
),
|
||||
|
||||
|
|
@ -175,7 +179,9 @@ module.exports = grammar({
|
|||
|
||||
map_expression: ($) => seq(
|
||||
"{",
|
||||
optional(commaSeparated(field("property", $._colon_property))),
|
||||
optional(commaSeparated(
|
||||
alias(field("property", $._colon_property), $.property)
|
||||
)),
|
||||
"}",
|
||||
),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue