diff options
| author | WormHeamer | 2025-08-04 23:05:46 -0400 |
|---|---|---|
| committer | WormHeamer | 2025-08-04 23:05:46 -0400 |
| commit | a4eca17c4156863108cd9bec7834bbb1681c0bf7 (patch) | |
| tree | c979e040bdf40277800972acc0f0f35824a774d0 /main.c | |
| parent | 88b01f43312eeceba87a1378be5cd63bb11f167f (diff) | |
NODE_KEEP macro
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -245,11 +245,11 @@ Node *parse_expr(Lexer *l, Proc *p) { lex_next(l); /* necessary because if lhs is a deduplicated literal, it may be an input to rhs * and therefore culled by peephole optimizations */ - node_add(p, lhs, p->keepalive); - Node *rhs = parse_expr(l, p); - Node *n = node_peephole(node_new(p, nt, lhs, rhs), p, l); - node_remove(p, lhs, p->keepalive); - lhs = n; + Node *rhs; + NODE_KEEP(p, lhs, { + rhs = parse_expr(l, p); + }); + lhs = node_peephole(node_new(p, nt, lhs, rhs), p, l); } lhs->src_pos = (LexSpan) { pos.ofs, l->pos.ofs - pos.ofs }; return lhs; |
