Add map expressions

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

View file

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