Replace '_typed_field' by more specific grammar
Instead of re-using a common rule, inline its definition and use '_field_identifier' where appropriate. This is useful for more accurate high-lighting.
This commit is contained in:
parent
5d37bf7bd1
commit
da494122ea
5 changed files with 1715 additions and 1573 deletions
24
grammar.js
24
grammar.js
|
|
@ -272,16 +272,17 @@ module.exports = grammar({
|
|||
|
||||
record_type: ($) => seq(
|
||||
"{",
|
||||
sepBy(",", $._typed_field),
|
||||
sepBy(
|
||||
",",
|
||||
seq(
|
||||
field("name", $._field_identifier),
|
||||
":",
|
||||
field("type", $._type_identifier),
|
||||
),
|
||||
),
|
||||
"}",
|
||||
),
|
||||
|
||||
_typed_field: ($) => seq(
|
||||
field("name", $.identifier),
|
||||
":",
|
||||
field("type", $.identifier),
|
||||
),
|
||||
|
||||
array_type: ($) => seq(
|
||||
"array",
|
||||
"of",
|
||||
|
|
@ -308,7 +309,14 @@ module.exports = grammar({
|
|||
|
||||
parameters: ($) => seq(
|
||||
"(",
|
||||
sepBy(",", $._typed_field),
|
||||
sepBy(
|
||||
",",
|
||||
seq(
|
||||
field("name", $.identifier),
|
||||
":",
|
||||
field("type", $._type_identifier),
|
||||
),
|
||||
),
|
||||
")",
|
||||
),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue