Add required array element constraints
This commit is contained in:
@@ -54,6 +54,7 @@ module.exports = grammar({
|
||||
$.regex_literal,
|
||||
$.comparison_constraint,
|
||||
$.object,
|
||||
$.array_constraint,
|
||||
$.array,
|
||||
$.let_expression,
|
||||
$.function_expression,
|
||||
@@ -116,6 +117,14 @@ module.exports = grammar({
|
||||
']',
|
||||
),
|
||||
|
||||
array_constraint: $ => seq(
|
||||
'[',
|
||||
'...',
|
||||
field('element', $._expression),
|
||||
optional(','),
|
||||
']',
|
||||
),
|
||||
|
||||
let_expression: $ => seq(
|
||||
'let',
|
||||
repeat(seq($.field_definition, ';')),
|
||||
|
||||
Reference in New Issue
Block a user