Add map expressions
This commit is contained in:
parent
e13f15e8db
commit
db2e88a539
5 changed files with 912 additions and 268 deletions
17
grammar.js
17
grammar.js
|
|
@ -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),
|
||||
),
|
||||
|
||||
// }}}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue