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))),
"]", "]",
), ),

8
src/grammar.json generated
View file

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

5
src/node-types.json generated
View file

@ -158,8 +158,8 @@
{ {
"type": "list_expression", "type": "list_expression",
"named": true, "named": true,
"fields": {}, "fields": {
"children": { "element": {
"multiple": true, "multiple": true,
"required": false, "required": false,
"types": [ "types": [
@ -197,6 +197,7 @@
} }
] ]
} }
}
}, },
{ {
"type": "map_expression", "type": "map_expression",

1567
src/parser.c generated

File diff suppressed because it is too large Load diff