diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-09-26 23:25:04 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-09-26 23:25:04 +0300 |
commit | 98d31787c2212d51c382681420e14eec44091034 (patch) | |
tree | ba95f6f08bb6a9bf4aa690d2ab5b05fbff6b6a35 | |
parent | 53246371c1395de55e1952859e14129226699370 (diff) | |
parent | 0e54ab845160a222556047482ea02f7221f34e59 (diff) | |
download | egawk-98d31787c2212d51c382681420e14eec44091034.tar.gz egawk-98d31787c2212d51c382681420e14eec44091034.tar.bz2 egawk-98d31787c2212d51c382681420e14eec44091034.zip |
Merge branch 'gawk-4.1-stable'
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | awkgram.c | 4 | ||||
-rw-r--r-- | awkgram.y | 4 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 8 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/muldimposix.awk | 1 | ||||
-rw-r--r-- | test/muldimposix.ok | 2 |
8 files changed, 39 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2015-09-26 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y (yylex): Diagnose multidimensional arrays for + traditional/posix (fatal) or lint. Thanks to Ed Morton + for the bug report. + 2015-09-25 Arnold D. Robbins <arnold@skeeve.com> * config.guess, config.sub, config.rpath: Updated. @@ -5963,6 +5963,10 @@ retry: c = nextc(true); pushback(); if (c == '[') { + if (do_traditional) + fatal(_("multidimensional arrays are a gawk extension")); + if (do_lint) + lintwarn(_("multidimensional arrays are a gawk extension")); yylval = GET_INSTRUCTION(Op_sub_array); lasttok = ']'; } else { @@ -3543,6 +3543,10 @@ retry: c = nextc(true); pushback(); if (c == '[') { + if (do_traditional) + fatal(_("multidimensional arrays are a gawk extension")); + if (do_lint) + lintwarn(_("multidimensional arrays are a gawk extension")); yylval = GET_INSTRUCTION(Op_sub_array); lasttok = ']'; } else { diff --git a/test/ChangeLog b/test/ChangeLog index 49b64cbd..2e4217f2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-09-26 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (muldimposix): New test. + * muldimposix.awk, muldimposix.ok: New files. + 2015-09-18 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (fpat5): New test. diff --git a/test/Makefile.am b/test/Makefile.am index db842fb4..9545920c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -525,6 +525,8 @@ EXTRA_DIST = \ manglprm.ok \ manyfiles.awk \ manyfiles.ok \ + muldimposix.awk \ + muldimposix.ok \ match1.awk \ match1.ok \ match2.awk \ @@ -1114,6 +1116,7 @@ GAWK_EXT_TESTS = \ include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 mbstr2 \ + muldimposix \ nastyparm negtime next nondec nondec2 \ nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ @@ -2173,6 +2176,11 @@ dbugeval2: @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +muldimposix:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index c140d966..ce791a2f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -782,6 +782,8 @@ EXTRA_DIST = \ manglprm.ok \ manyfiles.awk \ manyfiles.ok \ + muldimposix.awk \ + muldimposix.ok \ match1.awk \ match1.ok \ match2.awk \ @@ -1370,6 +1372,7 @@ GAWK_EXT_TESTS = \ include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 mbstr2 \ + muldimposix \ nastyparm negtime next nondec nondec2 \ nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ @@ -2608,6 +2611,12 @@ dbugeval2: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +muldimposix:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/muldimposix.awk b/test/muldimposix.awk new file mode 100644 index 00000000..135b3246 --- /dev/null +++ b/test/muldimposix.awk @@ -0,0 +1 @@ +BEGIN { a[1][2] = 3 } diff --git a/test/muldimposix.ok b/test/muldimposix.ok new file mode 100644 index 00000000..3594fab0 --- /dev/null +++ b/test/muldimposix.ok @@ -0,0 +1,2 @@ +gawk: muldimposix.awk:1: fatal: multidimensional arrays are a gawk extension +EXIT CODE: 2 |