Add async syntax
This commit is contained in:
parent
69778781ee
commit
0f58ea5a7a
@ -2,7 +2,7 @@
|
||||
Simple Async Statements
|
||||
==================
|
||||
|
||||
async (output 'Whaddup')
|
||||
async { (output 'Whaddup') }
|
||||
|
||||
---
|
||||
|
||||
@ -20,16 +20,18 @@ async (output 'Whaddup')
|
||||
(string)))))))))))
|
||||
|
||||
==================
|
||||
Complex Run Statements
|
||||
Complex Async Statements
|
||||
==================
|
||||
|
||||
async if 1 % 2 == 0 {
|
||||
async {
|
||||
if 1 % 2 == 0 {
|
||||
(output 'true')
|
||||
} else {
|
||||
} else {
|
||||
(output 'false')
|
||||
}
|
||||
}
|
||||
|
||||
async (output 'foobar')
|
||||
(output 'foobar')
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
@ -70,11 +72,7 @@ async (output 'foobar')
|
||||
(tool)
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))))
|
||||
(item
|
||||
(statement
|
||||
(async
|
||||
(item
|
||||
(string)))))))))
|
||||
(statement
|
||||
(expression
|
||||
(function_call
|
||||
|
@ -236,6 +236,6 @@ module.exports = grammar({
|
||||
),
|
||||
)),
|
||||
|
||||
async: $ => seq('async', $.item),
|
||||
async: $ => seq('async', '{', $.item, '}'),
|
||||
}
|
||||
});
|
@ -954,9 +954,17 @@
|
||||
"type": "STRING",
|
||||
"value": "async"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "item"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
8759
src/parser.c
8759
src/parser.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user