diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-02-16 01:32:15 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-02-16 01:44:52 -0500 |
| commit | 7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991 (patch) | |
| tree | 1c726145e8b301beb25ab781ab9e06d27c146797 /src/parser.cpp | |
| parent | cb3a818699649a985d5879151936b3b88ffddfa4 (diff) | |
| download | zig-7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991.tar.gz zig-7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991.zip | |
Implement noasync awaits
Note that there is not yet runtime safety for this.
See #3157
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index ef2121e20d..c8c53e81b7 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -2596,10 +2596,14 @@ static AstNode *ast_parse_prefix_op(ParseContext *pc) { return res; } + Token *noasync_token = eat_token_if(pc, TokenIdKeywordNoAsync); Token *await = eat_token_if(pc, TokenIdKeywordAwait); if (await != nullptr) { AstNode *res = ast_create_node(pc, NodeTypeAwaitExpr, await); + res->data.await_expr.noasync_token = noasync_token; return res; + } else if (noasync_token != nullptr) { + put_back_token(pc); } return nullptr; |
