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 (root
(item (statement
(statement (async
(async (statement
(item (expression
(statement (tool
(expression (expression
(tool (value
(expression (string)))))))))
(value
(string)))))))))))
================== ==================
Complex Async Statements Complex Async Statements
@ -35,40 +33,35 @@ async {
--- ---
(root (root
(item (statement
(statement (async
(async (statement
(item (if_else
(statement (if
(if_else (expression
(if (logic
(expression (expression
(logic (math
(expression (expression
(math (value
(expression (integer)))
(value (math_operator)
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression (expression
(value (value
(integer))))) (integer)))))
(item (logic_operator)
(statement (expression
(expression (value
(value (integer)))))
(boolean)))))) (statement
(else (expression
(item (value
(statement (boolean)))))
(expression (else
(value (statement
(boolean)))))))) (expression
(statement (value
(expression (boolean))))))
(value (expression
(string))))))))) (value
(string)))))))

View File

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

View File

@ -8,16 +8,14 @@ false
--- ---
(root (root
(item (statement
(statement (expression
(expression (value
(value (boolean))))
(boolean))))) (statement
(item (expression
(statement (value
(expression (boolean)))))
(value
(boolean))))))
================== ==================
Integers Integers
@ -29,31 +27,26 @@ Integers
--- ---
(root (root
(item (statement
(statement (expression
(expression (value
(value (integer))))
(integer))))) (statement
(item (expression
(statement (value
(expression (integer))))
(value (statement
(integer))))) (expression
(item (value
(statement (integer))))
(expression (statement
(value (expression
(integer))))) (value
(item (integer))))
(statement (statement
(expression (expression
(value (value
(integer))))) (integer)))))
(item
(statement
(expression
(value
(integer))))))
================== ==================
Strings Strings
@ -64,28 +57,23 @@ Strings
--- ---
(root (root
(item (statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))
(statement (statement
(expression (expression
(value (value
(string))))) (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 (root
(item (statement
(statement (expression
(expression (value
(value (integer))))
(integer))))) (statement
(item (expression
(statement (value
(expression (string))))
(value (statement
(string))))) (expression
(item (identifier))))
(statement
(expression
(identifier)))))
================== ==================
Simple Assignment Simple Assignment
@ -64,21 +61,37 @@ x = if 1 + 1 == 2 {
--- ---
(root (root
(item (statement
(statement (assignment
(assignment (identifier)
(identifier) (assignment_operator)
(assignment_operator) (statement
(statement (if_else
(expression (if
(math (expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression (expression
(value (value
(integer))) (string)))))
(math_operator) (else
(statement
(expression (expression
(value (value
(integer)))))))))) (string))))))))))
================== ==================
Expression Precedence Expression Precedence

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff