Continue syntax revision
This commit is contained in:
parent
47f50931d9
commit
02cded4af4
@ -7,16 +7,14 @@ async { (output 'Whaddup') }
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(async
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
Complex Async Statements
|
||||
@ -35,10 +33,8 @@ async {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(async
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
@ -57,18 +53,15 @@ async {
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))
|
||||
(else
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))
|
||||
(string)))))))
|
||||
|
@ -7,16 +7,14 @@ function { "Hiya" }
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(function
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
Function Call
|
||||
@ -27,14 +25,13 @@ Function Call
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(function_call
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
(string)))))))
|
||||
|
||||
==================
|
||||
Complex Function
|
||||
@ -48,24 +45,21 @@ function <message number> {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(function
|
||||
(identifier)
|
||||
(identifier)
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier)))))
|
||||
(statement
|
||||
(identifier))))
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier))))))))))))
|
||||
(identifier))))))))))
|
||||
|
||||
==================
|
||||
Complex Function Call
|
||||
@ -83,7 +77,6 @@ Complex Function Call
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(function_call
|
||||
@ -104,4 +97,4 @@ Complex Function Call
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))
|
||||
(integer))))))))))
|
||||
|
@ -8,16 +8,14 @@ false
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))
|
||||
|
||||
==================
|
||||
Integers
|
||||
@ -29,31 +27,26 @@ Integers
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(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))))))
|
||||
|
@ -9,20 +9,17 @@ x
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(item
|
||||
(string))))
|
||||
(statement
|
||||
(expression
|
||||
(identifier)))))
|
||||
(identifier))))
|
||||
|
||||
==================
|
||||
Simple Assignment
|
||||
@ -64,12 +61,15 @@ x = if 1 + 1 == 2 {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
@ -78,7 +78,20 @@ x = if 1 + 1 == 2 {
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))))
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
||||
|
||||
==================
|
||||
Expression Precedence
|
||||
|
@ -47,7 +47,7 @@ while true {
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(integer)))))
|
||||
(while
|
||||
(expression
|
||||
(logic
|
||||
@ -64,4 +64,4 @@ while true {
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))))
|
||||
(integer)))))))))))
|
||||
|
@ -304,7 +304,7 @@ module.exports = grammar({
|
||||
async: $ => seq(
|
||||
'async',
|
||||
'{',
|
||||
repeat($.statement),
|
||||
$.statement,
|
||||
'}'
|
||||
),
|
||||
|
||||
|
@ -1398,11 +1398,8 @@
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "statement"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user