diff options
author | glenda <glenda@cirno> | 2022-10-05 13:07:14 +0000 |
---|---|---|
committer | glenda <glenda@cirno> | 2022-10-05 13:07:14 +0000 |
commit | 65fc8018457f595ec9800946914f37133dae0667 (patch) | |
tree | 710aa1a4433434bd2d3e3a51b70c5eee5be4a8db /print.c | |
parent | 043beb2fbabb1f617e561ead2d01b1617de8c249 (diff) |
Minor changes
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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; |