diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 16:56:19 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 16:56:19 -0500 |
| commit | de3eeacfa0151243e4ef52af3d6c2e2b731fc720 (patch) | |
| tree | 4bf2ee295698a89a6378701f6e1e7aecbc552da2 /parse.c | |
| parent | 60f3e91b80dee6fcd995066730058dd5bc29414d (diff) | |
Major cleanup
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -723,8 +723,8 @@ PARSER(parse_reduction) { if (op == BINOP_UNKNOWN) return NULL; ast_t *combination; - ast_t *lhs = NewAST(ctx->file, pos, pos, Var, .name="lhs.0"); - ast_t *rhs = NewAST(ctx->file, pos, pos, Var, .name="rhs.0"); + ast_t *lhs = NewAST(ctx->file, pos, pos, Var, .name="$lhs"); + ast_t *rhs = NewAST(ctx->file, pos, pos, Var, .name="$rhs"); if (op == BINOP_MIN || op == BINOP_MAX) { for (bool progress = true; progress; ) { ast_t *new_term; @@ -844,7 +844,7 @@ PARSER(parse_heap_alloc) { if (!match(&pos, "@")) return NULL; spaces(&pos); ast_t *val = expect(ctx, start, &pos, parse_expr, "I expected an expression for this '@'"); - return NewAST(ctx->file, start, pos, UnaryOp, .op=UNOP_HEAP_ALLOCATE, .value=val); + return NewAST(ctx->file, start, pos, HeapAllocate, .value=val); } PARSER(parse_stack_reference) { @@ -852,7 +852,7 @@ PARSER(parse_stack_reference) { if (!match(&pos, "&")) return NULL; spaces(&pos); ast_t *val = expect(ctx, start, &pos, parse_expr, "I expected an expression for this '&'"); - return NewAST(ctx->file, start, pos, UnaryOp, .op=UNOP_STACK_REFERENCE, .value=val); + return NewAST(ctx->file, start, pos, StackReference, .value=val); } PARSER(parse_not) { @@ -860,7 +860,7 @@ PARSER(parse_not) { if (!match_word(&pos, "not")) return NULL; spaces(&pos); ast_t *val = expect(ctx, start, &pos, parse_expr, "I expected an expression for this 'not'"); - return NewAST(ctx->file, start, pos, UnaryOp, .op=UNOP_NOT, .value=val); + return NewAST(ctx->file, start, pos, Not, .value=val); } PARSER(parse_negative) { @@ -868,7 +868,7 @@ PARSER(parse_negative) { if (!match(&pos, "-")) return NULL; spaces(&pos); ast_t *val = expect(ctx, start, &pos, parse_term, "I expected an expression for this '-'"); - return NewAST(ctx->file, start, pos, UnaryOp, .op=UNOP_NEGATIVE, .value=val); + return NewAST(ctx->file, start, pos, Negative, .value=val); } PARSER(parse_bool) { |
