diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-02 20:43:56 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-02 20:43:56 +0300 |
commit | b32c67e0f99672ad4104cee4695b5eb040df16f4 (patch) | |
tree | f59c2329e2183fb12e4496306bb7893620bb966c /awkgram.y | |
parent | b98257919b20bdfc14f363761cc6215c1ad8bcee (diff) | |
parent | 3998ed059bbcfc189cd0d6c5762913fbd4ff4e77 (diff) | |
download | egawk-b32c67e0f99672ad4104cee4695b5eb040df16f4.tar.gz egawk-b32c67e0f99672ad4104cee4695b5eb040df16f4.tar.bz2 egawk-b32c67e0f99672ad4104cee4695b5eb040df16f4.zip |
Merge branch 'gawk-4.2-stable' into feature/gnulib-regex
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1296,6 +1296,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); } ; @@ -1729,10 +1731,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 { @@ -3849,6 +3852,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; } |