[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-677
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-677-g454ae7c |
Date: |
Mon, 27 Apr 2015 15:27:03 +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 454ae7c0f350842ab40a30ff4a2643cd76e8e277 (commit)
from 2ad3c45bed9aabe6bb8a05991a7fdbcff620810b (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=454ae7c0f350842ab40a30ff4a2643cd76e8e277
commit 454ae7c0f350842ab40a30ff4a2643cd76e8e277
Author: Arnold D. Robbins <address@hidden>
Date: Mon Apr 27 18:26:38 2015 +0300
Fix to Jan 7 2015 regexp parsing fix.
diff --git a/ChangeLog b/ChangeLog
index 3696d13..e5d473c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-27 Arnold D. Robbins <address@hidden>
+
+ * awkgram.y (yylex): Make change of Jan 7 for parsing regexps
+ work better. Thanks to Nelson Beebe.
+
2015-04-26 Arnold D. Robbins <address@hidden>
* dfa.c: Sync with grep.
diff --git a/awkgram.c b/awkgram.c
index 4fd53ce..530aa27 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -5388,8 +5388,8 @@ yylex(void)
pushback();
break;
case ']':
- if (tok[-1] == '['
- || (tok[-2] == '[' && tok[-1] == '^'))
+ if ((tok[-1] == '[' && tok[-2] != '\\')
+ || (tok[-2] == '[' && tok[-3] != '\\' &&
tok[-1] == '^'))
/* do nothing */;
else
in_brack--;
diff --git a/awkgram.y b/awkgram.y
index fad2b96..31751e8 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3049,8 +3049,8 @@ yylex(void)
pushback();
break;
case ']':
- if (tok[-1] == '['
- || (tok[-2] == '[' && tok[-1] == '^'))
+ if ((tok[-1] == '[' && tok[-2] != '\\')
+ || (tok[-2] == '[' && tok[-3] != '\\' &&
tok[-1] == '^'))
/* do nothing */;
else
in_brack--;
diff --git a/test/ChangeLog b/test/ChangeLog
index 201f8a3..cde85f8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2015-04-27 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (regexpbrack2): New test.
+ * regexpbrack2.awk, regexpbrack2.in, regexpbrack2.ok: New files.
+ Thanks to Nelson Beebe.
+
2015-04-14 Arnold D. Robbins <address@hidden>
* indirectbuiltin.awk: Add another test (gensub 3 args).
diff --git a/test/Makefile.am b/test/Makefile.am
index e2ccdc5..bf1d073 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -768,6 +768,9 @@ EXTRA_DIST = \
regexpbrack.awk \
regexpbrack.in \
regexpbrack.ok \
+ regexpbrack2.awk \
+ regexpbrack2.in \
+ regexpbrack2.ok \
regexprange.awk \
regexprange.ok \
reginttrad.awk \
@@ -1026,7 +1029,7 @@ 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 regexprange regrange
reindops \
+ rand range1 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 6ed035f..0cd1060 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1025,6 +1025,9 @@ EXTRA_DIST = \
regexpbrack.awk \
regexpbrack.in \
regexpbrack.ok \
+ regexpbrack2.awk \
+ regexpbrack2.in \
+ regexpbrack2.ok \
regexprange.awk \
regexprange.ok \
reginttrad.awk \
@@ -1282,7 +1285,7 @@ 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 regexprange regrange
reindops \
+ rand range1 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 \
@@ -3212,6 +3215,11 @@ regexpbrack:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+regexpbrack2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
regexprange:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 5ee4906..e9c8985 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -712,6 +712,11 @@ regexpbrack:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+regexpbrack2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
regexprange:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/regexpbrack2.awk b/test/regexpbrack2.awk
new file mode 100644
index 0000000..8142484
--- /dev/null
+++ b/test/regexpbrack2.awk
@@ -0,0 +1,2 @@
+NR == 1 { gsub(/\\\\[;?!,()<>|address@hidden/, " ") ; print "\"" $0 "\"" }
+NR == 2 { gsub(/\\\\[;?!,()<>|address@hidden/, " ") ; print "\"" $0 "\"" }
diff --git a/test/regexpbrack2.in b/test/regexpbrack2.in
new file mode 100644
index 0000000..42888dd
--- /dev/null
+++ b/test/regexpbrack2.in
@@ -0,0 +1,2 @@
+test: \\; \\? \\!
+test: \\; \\? \\!
diff --git a/test/regexpbrack2.ok b/test/regexpbrack2.ok
new file mode 100644
index 0000000..9c2a292
--- /dev/null
+++ b/test/regexpbrack2.ok
@@ -0,0 +1,2 @@
+"test: "
+"test: "
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
awkgram.c | 4 ++--
awkgram.y | 4 ++--
test/ChangeLog | 6 ++++++
test/Makefile.am | 5 ++++-
test/Makefile.in | 10 +++++++++-
test/Maketests | 5 +++++
test/regexpbrack2.awk | 2 ++
test/regexpbrack2.in | 2 ++
test/regexpbrack2.ok | 2 ++
10 files changed, 39 insertions(+), 6 deletions(-)
create mode 100644 test/regexpbrack2.awk
create mode 100644 test/regexpbrack2.in
create mode 100644 test/regexpbrack2.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-677-g454ae7c,
Arnold Robbins <=