aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-06-23 12:36:13 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-06-23 12:36:13 +0300
commit44e29458a6355ad64e8d89676a441b224ce76cbc (patch)
treec2cdddd3f873301845db9c6ad5cabe2b9c30df13 /awkgram.y
parent3f061027b6f0e2fe75b59d17efe93c0b84535b1a (diff)
downloadegawk-44e29458a6355ad64e8d89676a441b224ce76cbc.tar.gz
egawk-44e29458a6355ad64e8d89676a441b224ce76cbc.tar.bz2
egawk-44e29458a6355ad64e8d89676a441b224ce76cbc.zip
Fix parenthesization in the pretty printer for real (we hope!).
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/awkgram.y b/awkgram.y
index ad6873bb..d06faf8d 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1738,7 +1738,12 @@ non_post_simp_exp
}
}
| '(' exp r_paren
- { $$ = $2; }
+ {
+ if (do_pretty_print)
+ $$ = list_append($2, bcalloc(Op_parens, 1, sourceline));
+ else
+ $$ = $2;
+ }
| LEX_BUILTIN '(' opt_fcall_expression_list r_paren
{
$$ = snode($3, $1);
@@ -5909,7 +5914,7 @@ add_lint(INSTRUCTION *list, LINTTYPE linttype)
// closest to the opcode if that opcode doesn't have one
if (ip->source_line != 0)
line = ip->source_line;
- }
+ }
if (do_lint) { /* compile-time warning */
if (isnoeffect(ip->opcode)) {