From a4eca17c4156863108cd9bec7834bbb1681c0bf7 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Mon, 4 Aug 2025 23:05:46 -0400 Subject: NODE_KEEP macro --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.c') 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; -- cgit v1.2.3