Continue syntax overhaul

This commit is contained in:
Jeff 2023-10-06 07:55:04 -04:00
parent dbe7991fc6
commit 405a2dc86c
5 changed files with 4523 additions and 7352 deletions

View File

@ -75,7 +75,7 @@ else if 4 == 9
then "math is broken"
---
(root
(item
(statement
@ -93,19 +93,21 @@ else if 4 == 9
(expression
(value
(string))))
(expression
(logic
(expression
(value
(integer)))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(string))))))))
(if_else
(expression
(logic
(expression
(value
(integer)))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(string))))))))))
==================
If Else Else If Else
@ -121,7 +123,6 @@ else "42"
---
(root
(item
(statement
@ -133,33 +134,37 @@ else "42"
(expression
(value
(string))))
(expression
(value
(boolean)))
(statement
(expression
(value
(string))))
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(if_else
(expression
(value
(integer)))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))))))
(boolean)))
(statement
(expression
(value
(string))))
(statement
(if_else
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))))))))))

View File

@ -151,12 +151,6 @@ module.exports = grammar({
$.expression,
'then',
$.statement,
repeat(seq(
'else if',
$.expression,
'then',
$.statement,
)),
optional(seq(
'else',
$.statement,

View File

@ -647,30 +647,6 @@
"type": "SYMBOL",
"name": "statement"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "else if"
},
{
"type": "SYMBOL",
"name": "expression"
},
{
"type": "STRING",
"value": "then"
},
{
"type": "SYMBOL",
"name": "statement"
}
]
}
},
{
"type": "CHOICE",
"members": [

View File

@ -532,10 +532,6 @@
"type": "else",
"named": false
},
{
"type": "else if",
"named": false
},
{
"type": "false",
"named": false

11754
src/parser.c

File diff suppressed because it is too large Load Diff