diff options
| author | 2022-08-16 05:42:36 +0200 | |
|---|---|---|
| committer | 2022-08-16 05:42:36 +0200 | |
| commit | 04c7892134d49f3b295a51cc741affe9f02e374d (patch) | |
| tree | c94c4501b9d448c057bd736ee7b718daefcb304f /bootstrap/cgen.c | |
| parent | 5bc23671b5569d86196643f58f4f70997383b4a4 (diff) | |
nullish coalescing operator ??
Diffstat (limited to 'bootstrap/cgen.c')
| -rw-r--r-- | bootstrap/cgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c index 665bdc5..15fab93 100644 --- a/bootstrap/cgen.c +++ b/bootstrap/cgen.c @@ -222,7 +222,7 @@ genexpr(struct expr *ex) { pri("(%e)%c", ex->unop.child, ex->unop.op); break; case Ebinop: - pri("(%e %c %e)", ex->binop.lhs, ex->binop.op, ex->binop.rhs); + pri("((%e) %c (%e))", ex->binop.lhs, ex->binop.op == '?\?' ? '?:' : ex->binop.op, ex->binop.rhs); break; case Econd: pri("((%e) ? (%e) : (%e))", ex->cond.test, ex->cond.t, ex->cond.f); |