diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | interpret.h | 2 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/typedregex3.awk | 11 | ||||
-rw-r--r-- | test/typedregex3.ok | 4 |
8 files changed, 37 insertions, 5 deletions
@@ -4,6 +4,8 @@ a function in a user-defined function body, treat it normally. Makes eval "print and(a, 1)" work in the debugger again. Thanks, yet again, to Hermann Peifer. + * interpret.h (r_interpret): Op_subscript. UPREF if the + element value is a typed regexp. Thanks to Hermann Peifer. 2015-06-28 Arnold D. Robbins <arnold@skeeve.com> diff --git a/interpret.h b/interpret.h index 0a5cbbfe..f165ef70 100644 --- a/interpret.h +++ b/interpret.h @@ -268,7 +268,7 @@ uninitialized_scalar: r = r->var_value; } - if (r->type == Node_val) + if (r->type == Node_val || r->type == Node_typedregex) UPREF(r); PUSH(r); break; diff --git a/test/ChangeLog b/test/ChangeLog index c9a8e301..8cc7915e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,8 +1,9 @@ 2015-06-29 Arnold D. Robbins <arnold@skeeve.com> - * Makefile.am (dbugeval2): New test. + * Makefile.am (dbugeval2, typedregex3): New tests. * dbugeval2.awk, dbugeval2.in, dbugeval2.ok: New files. - Thanks to Hermann Peifer for the report. + * typedregex3.awk, typedregex3.ok: New files. + Thanks to Hermann Peifer for the reports. 2015-06-28 Arnold D. Robbins <arnold@skeeve.com> diff --git a/test/Makefile.am b/test/Makefile.am index f646bc09..b9e14468 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -994,6 +994,8 @@ EXTRA_DIST = \ typedregex1.ok \ typedregex2.awk \ typedregex2.ok \ + typedregex3.awk \ + typedregex3.ok \ typeof1.awk \ typeof1.ok \ typeof2.awk \ @@ -1117,7 +1119,7 @@ GAWK_EXT_TESTS = \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 \ - typedregex1 typedregex2 typeof1 typeof2 typeof3 typeof4 + typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 timeout EXTRA_TESTS = inftest regtest diff --git a/test/Makefile.in b/test/Makefile.in index 981b6377..0ae51917 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1251,6 +1251,8 @@ EXTRA_DIST = \ typedregex1.ok \ typedregex2.awk \ typedregex2.ok \ + typedregex3.awk \ + typedregex3.ok \ typeof1.awk \ typeof1.ok \ typeof2.awk \ @@ -1373,7 +1375,7 @@ GAWK_EXT_TESTS = \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 \ - typedregex1 typedregex2 typeof1 typeof2 typeof3 typeof4 + typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht @@ -3938,6 +3940,11 @@ typedregex2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typedregex3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + typeof1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 462128ea..f9dee6d8 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1342,6 +1342,11 @@ typedregex2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typedregex3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + typeof1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/typedregex3.awk b/test/typedregex3.awk new file mode 100644 index 00000000..ee6bcb69 --- /dev/null +++ b/test/typedregex3.awk @@ -0,0 +1,11 @@ +BEGIN { + a[1] = @/abc/ + b[1][2][3] = @/xyz/ + print typeof(a[1]), typeof(b[1][2][3]) + print a[1], b[1][2][3] + + a[1]++ + b[1][2][3] "" + print typeof(a[1]), typeof(b[1][2][3]) + print a[1], b[1][2][3] +} diff --git a/test/typedregex3.ok b/test/typedregex3.ok new file mode 100644 index 00000000..9f8b881a --- /dev/null +++ b/test/typedregex3.ok @@ -0,0 +1,4 @@ +regexp regexp +abc xyz +number regexp +1 xyz |