Add map expressions

This commit is contained in:
Bruno BELANYI 2024-04-07 23:36:21 +01:00
parent 3cb30584df
commit 37ee75c64d
5 changed files with 912 additions and 268 deletions

View file

@ -39,6 +39,7 @@ module.exports = grammar({
$._string_literal,
// Composites
$.list_expression,
$.map_expression,
),
// The Blueprint scanner makes use of Go's lexer, so copy their rule
@ -85,6 +86,22 @@ module.exports = grammar({
"]",
),
map_expression: ($) => seq(
"{",
optional(commaSeparated($._colon_property)),
"}",
),
// }}}
// Properties {{{
_colon_property: ($) => seq(
field("field", $.identifier),
":",
field("value", $._expr),
),
// }}}
}
});