Add record expression
This commit is contained in:
parent
babf666642
commit
136924cb26
5 changed files with 1134 additions and 509 deletions
15
grammar.js
15
grammar.js
|
|
@ -31,6 +31,7 @@ module.exports = grammar({
|
|||
$.string_literal,
|
||||
|
||||
$.array_expression,
|
||||
$.record_expression,
|
||||
|
||||
$.unary_expression,
|
||||
$.binary_expression,
|
||||
|
|
@ -106,6 +107,20 @@ module.exports = grammar({
|
|||
"of",
|
||||
field("init", $._expr),
|
||||
),
|
||||
|
||||
record_expression: ($) => seq(
|
||||
field("type", $.identifier),
|
||||
"{",
|
||||
sepBy(
|
||||
",",
|
||||
seq(
|
||||
field("field", $.identifier),
|
||||
"=",
|
||||
field("init", $._expr),
|
||||
),
|
||||
),
|
||||
"}",
|
||||
),
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue