ratel-rust / ratel-core

High performance JavaScript to JavaScript compiler with a Rust core
Apache License 2.0
435 stars 17 forks source link

async function #109

Open kdy1 opened 5 years ago

kdy1 commented 5 years ago
async function foo() {
}

I don't know how to parse this with single-token lookup table.

maciejhirsz commented 5 years ago

You'd have to tap into the parser for identifier (expression part here).

If the identifier is followed by the function keyword, check if that identifier as str equals "async", and if so use that as a flag.