diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-07-01 11:31:50 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-07-01 11:31:50 -0400 |
| commit | 855a7d2ec120591a1995b7cc89c0ea5a4c42d75f (patch) | |
| tree | ca07f54f46342a5528b63699c230eab4fe72fdc8 /compile.c | |
| parent | 6290eb2719cd5500a15ff02c44815b76bf9f9441 (diff) | |
Show test output for update assignments
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -354,6 +354,16 @@ CORD compile_statement(env_t *env, ast_t *ast) (int64_t)(test->expr->end - test->expr->file->text)); return code; } + } else if (test->expr->tag == UpdateAssign) { + return CORD_asprintf( + "test(({ %r; &%r; }), %r, %r, %r, %ld, %ld);", + compile_statement(env, test->expr), + compile_lvalue(env, Match(test->expr, UpdateAssign)->lhs), + compile_type_info(env, get_type(env, Match(test->expr, UpdateAssign)->lhs)), + compile(env, WrapAST(test->expr, TextLiteral, .cord=test->output)), + compile(env, WrapAST(test->expr, TextLiteral, .cord=test->expr->file->filename)), + (int64_t)(test->expr->start - test->expr->file->text), + (int64_t)(test->expr->end - test->expr->file->text)); } else if (expr_t->tag == VoidType || expr_t->tag == AbortType) { return CORD_asprintf( "test(({ %r; NULL; }), NULL, NULL, %r, %ld, %ld);", |
