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

View File

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

View File

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

16101
src/parser.c

File diff suppressed because it is too large Load Diff