diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-09-25 12:30:29 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-09-25 12:30:29 +0200 |
commit | 07e825ba195cc9778bcdb75a831d11f26f99ef5a (patch) | |
tree | da339264f11ed16a4299f1f7e669ace2370e1ffb /awkgram.y | |
parent | b84831d5a75556aa732cfa3552b90b9c804d9991 (diff) | |
parent | cf1aa2d743d3f6d94ed6cbd3fae97889913c5d75 (diff) | |
download | egawk-07e825ba195cc9778bcdb75a831d11f26f99ef5a.tar.gz egawk-07e825ba195cc9778bcdb75a831d11f26f99ef5a.tar.bz2 egawk-07e825ba195cc9778bcdb75a831d11f26f99ef5a.zip |
Update some things that are now POSIX.
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}, |