aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-08-02 20:41:40 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-08-02 20:41:40 +0300
commitef5a30e67615e1acc931e2f542b09f114ba30a97 (patch)
tree6f99a27e320b0a90830475bb53afcdae050726ab /awkgram.y
parent0b5a1bcd8b7189cb2d3048ef8e8d39dd33e2bec6 (diff)
parent48f02e6672003d218d4c0348a6add7931522603b (diff)
downloadegawk-ef5a30e67615e1acc931e2f542b09f114ba30a97.tar.gz
egawk-ef5a30e67615e1acc931e2f542b09f114ba30a97.tar.bz2
egawk-ef5a30e67615e1acc931e2f542b09f114ba30a97.zip
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y15
1 files changed, 11 insertions, 4 deletions
diff --git a/awkgram.y b/awkgram.y
index 40c5052f..1cebfe3b 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1313,6 +1313,8 @@ output_redir
&& $3->lasti->opcode == Op_K_getline_redir
&& $3->lasti->redir_type == redirect_twoway)
yyerror(_("multistage two-way pipelines don't work"));
+ if (do_lint && $1->redir_type == redirect_output && $3->lasti->opcode == Op_concat)
+ lintwarn(_("concatenation as I/O `>' redirection target is ambiguous"));
$$ = list_prepend($3, $1);
}
;
@@ -1746,10 +1748,11 @@ non_post_simp_exp
}
| '(' exp r_paren
{
- if (do_pretty_print)
- $$ = list_append($2, bcalloc(Op_parens, 1, sourceline));
- else
- $$ = $2;
+ // Always include. Allows us to lint warn on
+ // print "foo" > "bar" 1
+ // but not warn on
+ // print "foo" > ("bar" 1)
+ $$ = list_append($2, bcalloc(Op_parens, 1, sourceline));
}
| LEX_BUILTIN '(' opt_fcall_expression_list r_paren
{
@@ -3866,6 +3869,10 @@ retry:
if (c == '\r') /* allow MS-DOS files. bleah */
c = nextc(true);
if (c == '\n') {
+ if (do_posix)
+ fatal(_("POSIX does not allow physical newlines in string values"));
+ else if (do_lint)
+ lintwarn(_("backslash string continuation is not portable"));
sourceline++;
continue;
}