Add async syntax
This commit is contained in:
parent
69778781ee
commit
0f58ea5a7a
@ -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,15 +72,11 @@ async (output 'foobar')
|
|||||||
(tool)
|
(tool)
|
||||||
(expression
|
(expression
|
||||||
(value
|
(value
|
||||||
(string)))))))))))))
|
(string)))))))))
|
||||||
(item
|
|
||||||
(statement
|
|
||||||
(async
|
|
||||||
(item
|
|
||||||
(statement
|
(statement
|
||||||
(expression
|
(expression
|
||||||
(function_call
|
(function_call
|
||||||
(tool)
|
(tool)
|
||||||
(expression
|
(expression
|
||||||
(value
|
(value
|
||||||
(string)))))))))))
|
(string)))))))))))
|
@ -236,6 +236,6 @@ module.exports = grammar({
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
|
||||||
async: $ => seq('async', $.item),
|
async: $ => seq('async', '{', $.item, '}'),
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -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": "}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
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