diff options
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 29 |
1 files changed, 13 insertions, 16 deletions
@@ -808,10 +808,6 @@ non_compound_stmt } | LEX_NEXTFILE statement_term { - if (do_traditional) - error_ln($1->source_line, - _("`nextfile' is a gawk extension")); - /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) error_ln($1->source_line, @@ -978,16 +974,17 @@ regular_print: $2->memory = variable($2->source_line, arr, Node_var_new); if ($4 == NULL) { - static bool warned = false; - - if (do_lint && ! warned) { - warned = true; - lintwarn_ln($1->source_line, - _("`delete array' is a gawk extension")); - } - if (do_traditional) - error_ln($1->source_line, - _("`delete array' is a gawk extension")); + /* + * As of September 2012, POSIX has added support + * for `delete array'. See: + * http://austingroupbugs.net/view.php?id=544 + * + * Thanks to Nathan Weeks for the initiative. + * + * Thus we no longer warn or check do_posix. + * Also, since BWK awk supports it, we don't have to + * check do_traditional either. + */ $1->expr_count = 0; $$ = list_append(list_create($2), $1); } else { @@ -1011,7 +1008,7 @@ regular_print: } if (do_traditional) { error_ln($1->source_line, - _("`delete array' is a gawk extension")); + _("`delete(array)' is a non-portable tawk extension")); } $3->memory = variable($3->source_line, arr, Node_var_new); $3->opcode = Op_push_array; @@ -1862,7 +1859,7 @@ static const struct token tokentab[] = { {"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match, 0}, {"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mktime, 0}, {"next", Op_K_next, LEX_NEXT, 0, 0, 0}, -{"nextfile", Op_K_nextfile, LEX_NEXTFILE, GAWKX, 0, 0}, +{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0, 0}, {"or", Op_builtin, LEX_BUILTIN, GAWKX, do_or, MPF(or)}, {"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4), do_patsplit, 0}, {"print", Op_K_print, LEX_PRINT, 0, 0, 0}, |