Add async syntax

This commit is contained in:
Jeff 2023-10-16 16:47:43 -04:00
parent 69778781ee
commit 0f58ea5a7a
4 changed files with 4373 additions and 4420 deletions

View File

@ -2,7 +2,7 @@
Simple Async Statements Simple Async Statements
================== ==================
async (output 'Whaddup') async { (output 'Whaddup') }
--- ---
@ -20,16 +20,18 @@ async (output 'Whaddup')
(string))))))))))) (string)))))))))))
================== ==================
Complex Run Statements Complex Async Statements
================== ==================
async if 1 % 2 == 0 { async {
if 1 % 2 == 0 {
(output 'true') (output 'true')
} else { } else {
(output 'false') (output 'false')
} }
async (output 'foobar') (output 'foobar')
}
--- ---
@ -70,11 +72,7 @@ async (output 'foobar')
(tool) (tool)
(expression (expression
(value (value
(string))))))))))))) (string)))))))))
(item
(statement
(async
(item
(statement (statement
(expression (expression
(function_call (function_call

View File

@ -236,6 +236,6 @@ module.exports = grammar({
), ),
)), )),
async: $ => seq('async', $.item), async: $ => seq('async', '{', $.item, '}'),
} }
}); });

View File

@ -954,9 +954,17 @@
"type": "STRING", "type": "STRING",
"value": "async" "value": "async"
}, },
{
"type": "STRING",
"value": "{"
},
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "item" "name": "item"
},
{
"type": "STRING",
"value": "}"
} }
] ]
} }

File diff suppressed because it is too large Load Diff