1
0

Continue syntax revision

This commit is contained in:
Jeff 2023-10-31 06:21:21 -04:00
parent 47f50931d9
commit 02cded4af4
9 changed files with 5441 additions and 5611 deletions

View File

@ -7,16 +7,14 @@ async { (output 'Whaddup') }
---
(root
(item
(statement
(async
(item
(statement
(statement
(async
(statement
(expression
(tool
(expression
(tool
(expression
(value
(string)))))))))))
(value
(string)))))))))
==================
Complex Async Statements
@ -35,40 +33,35 @@ async {
---
(root
(item
(statement
(async
(item
(statement
(if_else
(if
(statement
(async
(statement
(if_else
(if
(expression
(logic
(expression
(logic
(math
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(item
(statement
(expression
(value
(boolean))))))
(else
(item
(statement
(expression
(value
(boolean))))))))
(statement
(expression
(value
(string)))))))))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(boolean)))))
(else
(statement
(expression
(value
(boolean))))))
(expression
(value
(string)))))))

View File

@ -7,16 +7,14 @@ function { "Hiya" }
---
(root
(item
(statement
(expression
(value
(function
(item
(statement
(expression
(value
(string)))))))))))
(statement
(expression
(value
(function
(statement
(expression
(value
(string)))))))))
==================
Function Call
@ -27,14 +25,13 @@ Function Call
---
(root
(item
(statement
(expression
(function_call
(identifier)
(expression
(value
(string))))))))
(statement
(expression
(function_call
(identifier)
(expression
(value
(string)))))))
==================
Complex Function
@ -48,24 +45,21 @@ function <message number> {
---
(root
(item
(statement
(expression
(value
(function
(identifier)
(identifier)
(item
(statement
(statement
(expression
(value
(function
(identifier)
(identifier)
(statement
(expression
(tool
(expression
(tool
(expression
(identifier)))))
(statement
(identifier))))
(expression
(tool
(expression
(tool
(expression
(identifier))))))))))))
(identifier))))))))))
==================
Complex Function Call
@ -83,25 +77,24 @@ Complex Function Call
---
(root
(item
(statement
(expression
(function_call
(identifier)
(expression
(value
(string)))
(expression
(value
(integer)))
(expression
(value
(map
(identifier)
(expression
(value
(integer)))
(identifier)
(expression
(value
(integer)))))))))))
(statement
(expression
(function_call
(identifier)
(expression
(value
(string)))
(expression
(value
(integer)))
(expression
(value
(map
(identifier)
(expression
(value
(integer)))
(identifier)
(expression
(value
(integer))))))))))

View File

@ -8,16 +8,14 @@ false
---
(root
(item
(statement
(expression
(value
(boolean)))))
(item
(statement
(expression
(value
(boolean))))))
(statement
(expression
(value
(boolean))))
(statement
(expression
(value
(boolean)))))
==================
Integers
@ -29,31 +27,26 @@ Integers
---
(root
(item
(statement
(expression
(value
(integer)))))
(item
(statement
(expression
(value
(integer)))))
(item
(statement
(expression
(value
(integer)))))
(item
(statement
(expression
(value
(integer)))))
(item
(statement
(expression
(value
(integer))))))
(statement
(expression
(value
(integer))))
(statement
(expression
(value
(integer))))
(statement
(expression
(value
(integer))))
(statement
(expression
(value
(integer))))
(statement
(expression
(value
(integer)))))
==================
Strings
@ -64,28 +57,23 @@ Strings
---
(root
(item
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string)))))
(item
(statement
(expression
(value
(string)))))
(item
(statement
(expression
(value
(string)))))
(item
(statement
(expression
(value
(string)))))
(item
(statement
(expression
(value
(string))))))

View File

@ -9,20 +9,17 @@ x
---
(root
(item
(statement
(expression
(value
(integer)))))
(item
(statement
(expression
(value
(string)))))
(item
(statement
(expression
(identifier)))))
(statement
(expression
(value
(integer))))
(statement
(expression
(value
(string))))
(statement
(expression
(identifier))))
==================
Simple Assignment
@ -64,21 +61,37 @@ x = if 1 + 1 == 2 {
---
(root
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(math
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(if_else
(if
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(integer)))
(math_operator)
(string)))))
(else
(statement
(expression
(value
(integer))))))))))
(string))))))))))
==================
Expression Precedence

View File

@ -47,21 +47,21 @@ while true {
(statement
(expression
(value
(integer)))
(while
(integer)))))
(while
(expression
(logic
(expression
(logic
(expression
(identifier))
(logic_operator)
(expression
(value
(integer)))))
(identifier))
(logic_operator)
(expression
(value
(integer)))))
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(integer)))))))))))))
(expression
(value
(integer)))))))))))

View File

@ -304,7 +304,7 @@ module.exports = grammar({
async: $ => seq(
'async',
'{',
repeat($.statement),
$.statement,
'}'
),

View File

@ -1398,11 +1398,8 @@
"value": "{"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "statement"
}
"type": "SYMBOL",
"name": "statement"
},
{
"type": "STRING",

View File

@ -27,8 +27,8 @@
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"multiple": false,
"required": true,
"types": [
{
"type": "statement",

File diff suppressed because it is too large Load Diff