Add record expression

This commit is contained in:
Bruno BELANYI 2022-06-01 19:54:09 +02:00
parent babf666642
commit 136924cb26
5 changed files with 1134 additions and 509 deletions

View file

@ -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),
),
),
"}",
),
}
});