diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-13 12:58:55 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-13 12:58:55 +0000 |
| commit | 8d7e628878aac07d0380463196f823502d1816ce (patch) | |
| tree | 276e19725a5c89e65b6fea30b358f64644212e6a /src/parser/parser_stmt.c | |
| parent | d561a63d8b5f6beadca30ab7b7846b387d67929a (diff) | |
Fix for #10
Diffstat (limited to 'src/parser/parser_stmt.c')
| -rw-r--r-- | src/parser/parser_stmt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parser/parser_stmt.c b/src/parser/parser_stmt.c index 8a89cc7..4478d22 100644 --- a/src/parser/parser_stmt.c +++ b/src/parser/parser_stmt.c @@ -37,6 +37,11 @@ ASTNode *parse_function(ParserContext *ctx, Lexer *l, int is_async) Token name_tok = lexer_next(l); char *name = token_strdup(name_tok); + if (is_async) + { + ctx->has_async = 1; + } + // Check for C reserved word conflict if (is_c_reserved_word(name)) { @@ -3876,7 +3881,7 @@ char *run_comptime_block(ParserContext *ctx, Lexer *l) zpanic("Could not create temp file %s", filename); } - emit_preamble(f); + emit_preamble(ctx, f); fprintf( f, "size_t _z_check_bounds(size_t index, size_t size) { if (index >= size) { fprintf(stderr, " |
