From 65fc8018457f595ec9800946914f37133dae0667 Mon Sep 17 00:00:00 2001 From: glenda Date: Wed, 5 Oct 2022 13:07:14 +0000 Subject: Minor changes --- print.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'print.c') diff --git a/print.c b/print.c index b8b617d..55da3b3 100644 --- a/print.c +++ b/print.c @@ -186,15 +186,21 @@ ppoperator(Operator op) Rune *right = op.right ? ppdatum(op.right) : runestrdup(L""); Rune *res; if(op.type == OperatortypeDop) - res = runesmprint("(%S{%S}%S)", left, op.dop, right); + res = runesmprint("%S{%S}%S", left, op.dop, right); else if(op.type == OperatortypeHybrid){ - res = runesmprint("(%S%C)", left, primhybridnames[op.code]); + res = runesmprint("%S%C", left, primhybridnames[op.code]); }else{ - res = runesmprint("(%S%C%S)", + res = runesmprint("%S%C%S", left, op.dyadic ? primdyadopnames[op.code] : primmonopnames[op.code], right); } + if(op.left || op.right){ + Rune *tmp = res; + res = runesmprint("(%S)", res); + free(tmp); + } + free(left); free(right); return res; -- cgit v1.2.3