[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, feature/mdim, updated. gawk-4.1.0-4682-gdcd751f1
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, feature/mdim, updated. gawk-4.1.0-4682-gdcd751f1 |
Date: |
Thu, 10 Mar 2022 02:34:17 -0500 (EST) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/mdim has been updated
via dcd751f1fdd7d6d934a4826b74842afda1907083 (commit)
from 68a50023aae8ecabee1cc03d81f08081026a52c1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=dcd751f1fdd7d6d934a4826b74842afda1907083
commit dcd751f1fdd7d6d934a4826b74842afda1907083
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Mar 10 09:33:55 2022 +0200
First fix for mdim, add test case.
diff --git a/ChangeLog b/ChangeLog
index bd095616..6387063b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-03-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * interpret.h (r_interpret): Op_assign: If LHS is Nnull_array_value,
+ use Nnull_string instead so that RHS becomes a scalar.
+
2022-03-03 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
diff --git a/interpret.h b/interpret.h
index 39b19abc..4588967a 100644
--- a/interpret.h
+++ b/interpret.h
@@ -826,6 +826,8 @@ mod:
lhs = POP_ADDRESS();
r = TOP_SCALAR();
unref(*lhs);
+ if (r == Nnull_array_value) // convert to scalar
+ r = Nnull_string;
UPREF(r);
UNFIELD(*lhs, r);
REPLACE(r);
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 342ae067..cff9c432 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-03-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Regenerated.
+
2022-12-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index d74172d1..f6d46423 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -202,6 +202,7 @@ GAWK_EXT_TESTS = \
inf-nan-torture intarray iolint isarrayunset lint lintexp \
lintindex lintint lintlength lintold lintplus lintset lintwarn \
manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \
+ mdim1 \
modifiers muldimposix nastyparm negtime next nondec nondec2 \
nonfatal1 nonfatal2 nonfatal3 nsawk1a nsawk1b nsawk1c nsawk2a \
nsawk2b nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 \
@@ -3023,6 +3024,11 @@ mktime:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mdim1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
modifiers:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index faa65692..c7081d68 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2022-03-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): mdim1, new test.
+ * mdim1.awk, mdim1.ok: New files.
+
2022-02-27 Arnold D. Robbins <arnold@skeeve.com>
* badargs.ok: Updated after code change.
diff --git a/test/Makefile.am b/test/Makefile.am
index ddca3f59..d4b03217 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -674,6 +674,8 @@ EXTRA_DIST = \
manglprm.ok \
manyfiles.awk \
manyfiles.ok \
+ mdim1.awk \
+ mdim1.ok \
modifiers.sh \
modifiers.ok \
muldimposix.awk \
@@ -1464,6 +1466,7 @@ GAWK_EXT_TESTS = \
inf-nan-torture intarray iolint isarrayunset lint lintexp \
lintindex lintint lintlength lintold lintplus lintset lintwarn \
manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \
+ mdim1 \
modifiers muldimposix nastyparm negtime next nondec nondec2 \
nonfatal1 nonfatal2 nonfatal3 nsawk1a nsawk1b nsawk1c nsawk2a \
nsawk2b nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 \
diff --git a/test/Makefile.in b/test/Makefile.in
index d974a98c..0e2a48ac 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -940,6 +940,8 @@ EXTRA_DIST = \
manglprm.ok \
manyfiles.awk \
manyfiles.ok \
+ mdim1.awk \
+ mdim1.ok \
modifiers.sh \
modifiers.ok \
muldimposix.awk \
@@ -1730,6 +1732,7 @@ GAWK_EXT_TESTS = \
inf-nan-torture intarray iolint isarrayunset lint lintexp \
lintindex lintint lintlength lintold lintplus lintset lintwarn \
manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \
+ mdim1 \
modifiers muldimposix nastyparm negtime next nondec nondec2 \
nonfatal1 nonfatal2 nonfatal3 nsawk1a nsawk1b nsawk1c nsawk2a \
nsawk2b nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 \
@@ -4712,6 +4715,11 @@ mktime:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mdim1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
modifiers:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 10ef252f..898b81c4 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1745,6 +1745,11 @@ mktime:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mdim1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
modifiers:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/mdim1.awk b/test/mdim1.awk
new file mode 100644
index 00000000..cd41afff
--- /dev/null
+++ b/test/mdim1.awk
@@ -0,0 +1,15 @@
+BEGIN {
+ print "typeof(x[0]) is", typeof(x[0])
+ x[1] = x[0]
+ print "typeof(x[1]) is", typeof(x[1])
+ x[0][1] = "xx"
+ print "typeof(x[0]) is", typeof(x[0])
+ print "typeof(x[0][1]) is", typeof(x[0][1])
+ print "typeof(y) is", typeof(y)
+ z = y
+ print "typeof(y) is", typeof(y)
+ print "tzpeof(z) is", typeof(z)
+
+ x[1][0] = "xx"
+ print x[1][0]
+}
diff --git a/test/mdim1.ok b/test/mdim1.ok
new file mode 100644
index 00000000..da905a69
--- /dev/null
+++ b/test/mdim1.ok
@@ -0,0 +1,9 @@
+typeof(x[0]) is untyped
+typeof(x[1]) is unassigned
+typeof(x[0]) is array
+typeof(x[0][1]) is string
+typeof(y) is untyped
+typeof(y) is unassigned
+tzpeof(z) is unassigned
+gawk: mdim1.awk:13: fatal: attempt to use scalar `x["1"]' as an array
+EXIT CODE: 2
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
interpret.h | 2 ++
pc/ChangeLog | 4 ++++
pc/Makefile.tst | 6 ++++++
test/ChangeLog | 5 +++++
test/Makefile.am | 3 +++
test/Makefile.in | 8 ++++++++
test/Maketests | 5 +++++
test/mdim1.awk | 15 +++++++++++++++
test/mdim1.ok | 9 +++++++++
10 files changed, 62 insertions(+)
create mode 100644 test/mdim1.awk
create mode 100644 test/mdim1.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, feature/mdim, updated. gawk-4.1.0-4682-gdcd751f1,
Arnold Robbins <=