Add 'element' field name to list

This commit is contained in:
Bruno BELANYI 2024-04-08 01:46:43 +01:00
parent d232c089df
commit 644f6483fe
4 changed files with 851 additions and 811 deletions

View file

@ -169,7 +169,7 @@ module.exports = grammar({
list_expression: ($) => seq( list_expression: ($) => seq(
"[", "[",
optional(commaSeparated($._expr)), optional(commaSeparated(field("element", $._expr))),
"]", "]",
), ),

16
src/grammar.json generated
View file

@ -682,8 +682,12 @@
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
"type": "SYMBOL", "type": "FIELD",
"name": "_expr" "name": "element",
"content": {
"type": "SYMBOL",
"name": "_expr"
}
}, },
{ {
"type": "REPEAT", "type": "REPEAT",
@ -695,8 +699,12 @@
"value": "," "value": ","
}, },
{ {
"type": "SYMBOL", "type": "FIELD",
"name": "_expr" "name": "element",
"content": {
"type": "SYMBOL",
"name": "_expr"
}
} }
] ]
} }

77
src/node-types.json generated
View file

@ -158,44 +158,45 @@
{ {
"type": "list_expression", "type": "list_expression",
"named": true, "named": true,
"fields": {}, "fields": {
"children": { "element": {
"multiple": true, "multiple": true,
"required": false, "required": false,
"types": [ "types": [
{ {
"type": "boolean_literal", "type": "boolean_literal",
"named": true "named": true
}, },
{ {
"type": "identifier", "type": "identifier",
"named": true "named": true
}, },
{ {
"type": "integer_literal", "type": "integer_literal",
"named": true "named": true
}, },
{ {
"type": "interpreted_string_literal", "type": "interpreted_string_literal",
"named": true "named": true
}, },
{ {
"type": "list_expression", "type": "list_expression",
"named": true "named": true
}, },
{ {
"type": "map_expression", "type": "map_expression",
"named": true "named": true
}, },
{ {
"type": "raw_string_literal", "type": "raw_string_literal",
"named": true "named": true
}, },
{ {
"type": "select_expression", "type": "select_expression",
"named": true "named": true
} }
] ]
}
} }
}, },
{ {

1567
src/parser.c generated

File diff suppressed because it is too large Load diff