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(
"[",
optional(commaSeparated($._expr)),
optional(commaSeparated(field("element", $._expr))),
"]",
),

16
src/grammar.json generated
View file

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

77
src/node-types.json generated
View file

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

1567
src/parser.c generated

File diff suppressed because it is too large Load diff