[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-687
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-687-g14df926 |
Date: |
Tue, 05 May 2015 09:03:04 +0000 |
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, gawk-4.1-stable has been updated
via 14df926d1e796b1227b34384c388b1580f05e840 (commit)
from f077fdd5c7580e5b6e9caf36e322dcdd19bd7316 (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=14df926d1e796b1227b34384c388b1580f05e840
commit 14df926d1e796b1227b34384c388b1580f05e840
Author: Arnold D. Robbins <address@hidden>
Date: Tue May 5 12:02:36 2015 +0300
Fix parsing brackets in regexps (again).
diff --git a/ChangeLog b/ChangeLog
index 334b00b..0833d26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-05 Arnold D. Robbins <address@hidden>
+
+ * awkgram.y (yylex): Yet Another Fix for parsing bracket
+ expressions. Thanks yet again to Andrew Schorr. Maybe it's
+ even finally nailed down now.
+
2015-05-01 Arnold D. Robbins <address@hidden>
* awkgram.y: Make sure values are not null in param list.
diff --git a/awkgram.c b/awkgram.c
index 4f62694..fa88a50 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -5389,11 +5389,12 @@ yylex(void)
cur_index = tok - tokstart;
if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch
(c) {
case '[':
- if (nextc(false) == ':' || in_brack == 0)
+ if (nextc(false) == ':' || in_brack == 0) {
in_brack++;
+ if (in_brack == 1)
+ b_index = tok - tokstart;
+ }
pushback();
- if (in_brack == 1)
- b_index = tok - tokstart;
break;
case ']':
if (in_brack > 0
diff --git a/awkgram.y b/awkgram.y
index c740320..f311f29 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3050,11 +3050,12 @@ yylex(void)
cur_index = tok - tokstart;
if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch
(c) {
case '[':
- if (nextc(false) == ':' || in_brack == 0)
+ if (nextc(false) == ':' || in_brack == 0) {
in_brack++;
+ if (in_brack == 1)
+ b_index = tok - tokstart;
+ }
pushback();
- if (in_brack == 1)
- b_index = tok - tokstart;
break;
case ']':
if (in_brack > 0
diff --git a/test/ChangeLog b/test/ChangeLog
index b191e86..92a341d 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-05 Andrew J. Schorr <address@hidden>
+
+ * Makefile.am (rebrackloc): New test.
+ * rebrackloc.awk, rebrackloc.in, rebrackloc.ok: New files.
+
2015-04-29 Arnold D. Robbins <address@hidden>
* 4.1.2: Release tar ball made.
diff --git a/test/Makefile.am b/test/Makefile.am
index edad8bb..db3cc86 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -755,6 +755,9 @@ EXTRA_DIST = \
readdir0.awk \
readfile2.awk \
readfile2.ok \
+ rebrackloc.awk \
+ rebrackloc.in \
+ rebrackloc.ok \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
@@ -1032,7 +1035,8 @@ BASIC_TESTS = \
paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \
pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
prt1eval prtoeval \
- rand range1 rebt8b1 redfilnm regeq regexpbrack regexpbrack2 regexprange
regrange reindops \
+ rand range1 rebrackloc rebt8b1 redfilnm regeq regexpbrack regexpbrack2 \
+ regexprange regrange reindops \
reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
rstest3 rstest4 rstest5 rswhite \
scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \
diff --git a/test/Makefile.in b/test/Makefile.in
index b549226..ed095af 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1012,6 +1012,9 @@ EXTRA_DIST = \
readdir0.awk \
readfile2.awk \
readfile2.ok \
+ rebrackloc.awk \
+ rebrackloc.in \
+ rebrackloc.ok \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
@@ -1288,7 +1291,8 @@ BASIC_TESTS = \
paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \
pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
prt1eval prtoeval \
- rand range1 rebt8b1 redfilnm regeq regexpbrack regexpbrack2 regexprange
regrange reindops \
+ rand range1 rebrackloc rebt8b1 redfilnm regeq regexpbrack regexpbrack2 \
+ regexprange regrange reindops \
reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
rstest3 rstest4 rstest5 rswhite \
scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \
@@ -3208,6 +3212,11 @@ range1:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+rebrackloc:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
rebt8b1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 95d9e80..651ff03 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -702,6 +702,11 @@ range1:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+rebrackloc:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
rebt8b1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/rebrackloc.awk b/test/rebrackloc.awk
new file mode 100644
index 0000000..c5987fc
--- /dev/null
+++ b/test/rebrackloc.awk
@@ -0,0 +1,31 @@
+match($0, /([Nn]ew) Value +[\([]? *([[:upper:]]+)/, f) {
+ print "re1", NR, f[1], f[2]
+}
+
+match($0, /([][])/, f) {
+ print "re2", NR, f[1]
+}
+
+/[]]/ {
+ print "re3", NR, $0
+}
+
+/[\[]/ {
+ print "re4", NR, $0
+}
+
+/[[]/ {
+ print "re5", NR, $0
+}
+
+/[][]/ {
+ print "re6", NR, $0
+}
+
+/[\([][[:upper:]]*/ {
+ print "re7", NR, $0
+}
+
+/[\([]/ {
+ print "re8", NR, $0
+}
diff --git a/test/rebrackloc.in b/test/rebrackloc.in
new file mode 100644
index 0000000..d82369b
--- /dev/null
+++ b/test/rebrackloc.in
@@ -0,0 +1,3 @@
+New Value [XYZ]
+[
+]
diff --git a/test/rebrackloc.ok b/test/rebrackloc.ok
new file mode 100644
index 0000000..ec98bf5
--- /dev/null
+++ b/test/rebrackloc.ok
@@ -0,0 +1,17 @@
+re1 1 New XYZ
+re2 1 [
+re3 1 New Value [XYZ]
+re4 1 New Value [XYZ]
+re5 1 New Value [XYZ]
+re6 1 New Value [XYZ]
+re7 1 New Value [XYZ]
+re8 1 New Value [XYZ]
+re2 2 [
+re4 2 [
+re5 2 [
+re6 2 [
+re7 2 [
+re8 2 [
+re2 3 ]
+re3 3 ]
+re6 3 ]
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
awkgram.c | 7 ++++---
awkgram.y | 7 ++++---
test/ChangeLog | 5 +++++
test/Makefile.am | 6 +++++-
test/Makefile.in | 11 ++++++++++-
test/Maketests | 5 +++++
test/rebrackloc.awk | 31 +++++++++++++++++++++++++++++++
test/rebrackloc.in | 3 +++
test/rebrackloc.ok | 17 +++++++++++++++++
10 files changed, 90 insertions(+), 8 deletions(-)
create mode 100644 test/rebrackloc.awk
create mode 100644 test/rebrackloc.in
create mode 100644 test/rebrackloc.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-687-g14df926,
Arnold Robbins <=