summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 8533e49..3ce67dc 100644
--- a/main.c
+++ b/main.c
@@ -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;