Update syntax

This commit is contained in:
Jeff 2023-10-05 08:03:37 -04:00
parent bcc3557b77
commit 0797a60677
5 changed files with 8077 additions and 8161 deletions

@ -1 +1 @@
Subproject commit a42b43ed7853b73e8bb42b0ab23765acc1fc78c1 Subproject commit 7fa5dd0f54e389052274affd8237040af545b938

View File

@ -8,7 +8,7 @@ module.exports = grammar({
item: $ => choice( item: $ => choice(
$.comment, $.comment,
field('source', $.statement), $.statement,
), ),
comment: $ => seq(token('#'), /.*/), comment: $ => seq(token('#'), /.*/),
@ -52,8 +52,8 @@ module.exports = grammar({
$.integer, $.integer,
$.float, $.float,
$.string, $.string,
$.list,
$.boolean, $.boolean,
$.list,
$.function, $.function,
$.table, $.table,
$.map, $.map,
@ -72,7 +72,7 @@ module.exports = grammar({
list: $ => seq( list: $ => seq(
'[', '[',
repeat1(seq(field('item', $.value), optional(','))), repeat1(seq($.value, optional(','))),
']' ']'
), ),
@ -95,7 +95,7 @@ module.exports = grammar({
map: $ => seq( map: $ => seq(
'map', 'map',
'{', '{',
repeat(field('key_value_pair', seq($.identifier, "=", $.value))), repeat(seq($.identifier, "=", $.value)),
'}', '}',
), ),

View File

@ -17,13 +17,9 @@
"name": "comment" "name": "comment"
}, },
{ {
"type": "FIELD",
"name": "source",
"content": {
"type": "SYMBOL", "type": "SYMBOL",
"name": "statement" "name": "statement"
} }
}
] ]
}, },
"comment": { "comment": {
@ -200,11 +196,11 @@
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "list" "name": "boolean"
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "boolean" "name": "list"
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
@ -258,12 +254,8 @@
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
"type": "FIELD",
"name": "item",
"content": {
"type": "SYMBOL", "type": "SYMBOL",
"name": "value" "name": "value"
}
}, },
{ {
"type": "CHOICE", "type": "CHOICE",
@ -429,9 +421,6 @@
}, },
{ {
"type": "REPEAT", "type": "REPEAT",
"content": {
"type": "FIELD",
"name": "key_value_pair",
"content": { "content": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
@ -449,7 +438,6 @@
} }
] ]
} }
}
}, },
{ {
"type": "STRING", "type": "STRING",

View File

@ -198,25 +198,18 @@
{ {
"type": "item", "type": "item",
"named": true, "named": true,
"fields": { "fields": {},
"source": {
"multiple": false,
"required": false,
"types": [
{
"type": "statement",
"named": true
}
]
}
},
"children": { "children": {
"multiple": false, "multiple": false,
"required": false, "required": true,
"types": [ "types": [
{ {
"type": "comment", "type": "comment",
"named": true "named": true
},
{
"type": "statement",
"named": true
} }
] ]
} }
@ -224,8 +217,8 @@
{ {
"type": "list", "type": "list",
"named": true, "named": true,
"fields": { "fields": {},
"item": { "children": {
"multiple": true, "multiple": true,
"required": true, "required": true,
"types": [ "types": [
@ -235,7 +228,6 @@
} }
] ]
} }
}
}, },
{ {
"type": "logic", "type": "logic",
@ -283,15 +275,11 @@
{ {
"type": "map", "type": "map",
"named": true, "named": true,
"fields": { "fields": {},
"key_value_pair": { "children": {
"multiple": true, "multiple": true,
"required": false, "required": false,
"types": [ "types": [
{
"type": "=",
"named": false
},
{ {
"type": "identifier", "type": "identifier",
"named": true "named": true
@ -302,7 +290,6 @@
} }
] ]
} }
}
}, },
{ {
"type": "match", "type": "match",

16101
src/parser.c

File diff suppressed because it is too large Load Diff