diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-12-21 12:21:55 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-12-21 12:21:55 +0200 |
commit | 60503a285ce7884ae2b58c864a0407a23dec17fd (patch) | |
tree | 9b3c649634cd5bcbeea9bab1b3e372a625014b7f | |
parent | 041e792f6b4990d617d4e2c4b1445d874b1c9298 (diff) | |
parent | 57ce0c9d0bd5d0dca6f009238170731d853dc891 (diff) | |
download | egawk-60503a285ce7884ae2b58c864a0407a23dec17fd.tar.gz egawk-60503a285ce7884ae2b58c864a0407a23dec17fd.tar.bz2 egawk-60503a285ce7884ae2b58c864a0407a23dec17fd.zip |
Merge branch 'gawk-4.2-stable'
-rwxr-xr-x | ChangeLog | 4 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | support/ChangeLog | 5 | ||||
-rw-r--r-- | support/dfa.c | 35 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/dfacheck1.awk | 1 | ||||
-rw-r--r-- | test/dfacheck1.in | 1 | ||||
-rw-r--r-- | test/dfacheck1.ok | 1 |
12 files changed, 71 insertions, 9 deletions
@@ -1,3 +1,7 @@ +2018-12-21 Arnold D. Robbins <arnold@skeeve.com> + + * configure.ac: Remove -O only if .developing has 'debug' in it. + 2018-12-18 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (distclean-local): Remove .deps directory. @@ -12800,7 +12800,9 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -if test "$GCC" = yes && test -f $srcdir/.developing +if test "$GCC" = yes && + test -f $srcdir/.developing && + grep -i debug $srcdir/.developing > /dev/null then for i in . support extension do diff --git a/configure.ac b/configure.ac index fe89e96d..9e11f8ca 100644 --- a/configure.ac +++ b/configure.ac @@ -469,7 +469,9 @@ then AC_CONFIG_SUBDIRS(extension) fi AC_OUTPUT -if test "$GCC" = yes && test -f $srcdir/.developing +if test "$GCC" = yes && + test -f $srcdir/.developing && + grep -i debug $srcdir/.developing > /dev/null then for i in . support extension do diff --git a/support/ChangeLog b/support/ChangeLog index 1fd2ded5..64dca2e7 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,8 @@ +2018-12-21 Arnold D. Robbins <arnold@skeeve.com> + + * dfa.c; Sync with GNULIB, bugfix for \b (\y in gawk) + in the C locale. + 2018-12-18 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (distclean-local): Remove .deps directory. diff --git a/support/dfa.c b/support/dfa.c index 612faa10..7687aca0 100644 --- a/support/dfa.c +++ b/support/dfa.c @@ -2345,6 +2345,26 @@ epsclosure (struct dfa const *d) free (tmp.elems); } +/* Returns the set of contexts for which there is at least one + character included in C. */ + +static int +charclass_context (struct dfa const *dfa, charclass const *c) +{ + int context = 0; + + for (unsigned int j = 0; j < CHARCLASS_WORDS; ++j) + { + if (c->w[j] & dfa->syntax.newline.w[j]) + context |= CTX_NEWLINE; + if (c->w[j] & dfa->syntax.letters.w[j]) + context |= CTX_LETTER; + if (c->w[j] & ~(dfa->syntax.letters.w[j] | dfa->syntax.newline.w[j])) + context |= CTX_NONE; + } + + return context; +} /* Returns the contexts on which the position set S depends. Each context in the set of returned contexts (let's call it SC) may have a different follow set than other contexts in SC, and also different from the @@ -3137,17 +3157,22 @@ build_state (state_num s, struct dfa *d, unsigned char uc) /* Find out if the new state will want any context information, by calculating possible contexts that the group can match, and separate contexts that the new state wants to know. */ + int possible_contexts = charclass_context (d, &label); int separate_contexts = state_separate_contexts (d, &group); /* Find the state(s) corresponding to the union of the follows. */ - if (d->syntax.sbit[uc] & separate_contexts & CTX_NEWLINE) - state = state_index (d, &group, CTX_NEWLINE); - else if (d->syntax.sbit[uc] & separate_contexts & CTX_LETTER) - state = state_index (d, &group, CTX_LETTER); - else + if (possible_contexts & ~separate_contexts) state = state_index (d, &group, separate_contexts ^ CTX_ANY); + else + state = -1; + if (separate_contexts & possible_contexts & CTX_NEWLINE) + state_newline = state_index (d, &group, CTX_NEWLINE); + else state_newline = state; + if (separate_contexts & possible_contexts & CTX_LETTER) + state_letter = state_index (d, &group, CTX_LETTER); + else state_letter = state; /* Reallocate now, to reallocate any newline transition properly. */ diff --git a/test/ChangeLog b/test/ChangeLog index cd6626e6..fe8d5899 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2018-12-21 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): New test: dfacheck1. + * dfacheck1.awk, dfacheck1.in, dfacheck1.ok: New files. + 2018-11-28 Arnold D. Robbins <arnold@skeeve.com> * profile11.ok: Updated after code change. diff --git a/test/Makefile.am b/test/Makefile.am index 98406a59..2b9c5d62 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -241,6 +241,9 @@ EXTRA_DIST = \ devfd1.awk \ devfd1.ok \ devfd2.ok \ + dfacheck.awk \ + dfacheck.in \ + dfacheck.ok \ dfamb1.awk \ dfamb1.in \ dfamb1.ok \ @@ -1295,7 +1298,7 @@ GAWK_EXT_TESTS = \ charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \ clos1way6 crlf \ dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ - devfd devfd1 devfd2 dumpvars \ + devfd devfd1 devfd2 dfacheck1 dumpvars \ errno exit \ fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpatnull fsfwfs \ funlen functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \ diff --git a/test/Makefile.in b/test/Makefile.in index 54c6b986..751eedc9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -499,6 +499,9 @@ EXTRA_DIST = \ devfd1.awk \ devfd1.ok \ devfd2.ok \ + dfacheck.awk \ + dfacheck.in \ + dfacheck.ok \ dfamb1.awk \ dfamb1.in \ dfamb1.ok \ @@ -1553,7 +1556,7 @@ GAWK_EXT_TESTS = \ charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \ clos1way6 crlf \ dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ - devfd devfd1 devfd2 dumpvars \ + devfd devfd1 devfd2 dfacheck1 dumpvars \ errno exit \ fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpatnull fsfwfs \ funlen functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \ @@ -4003,6 +4006,11 @@ delsub: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +dfacheck1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + exit: @echo $@ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 067854e3..08d92ba3 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1330,6 +1330,11 @@ delsub: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +dfacheck1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + exit: @echo $@ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/dfacheck1.awk b/test/dfacheck1.awk new file mode 100644 index 00000000..e7c812d1 --- /dev/null +++ b/test/dfacheck1.awk @@ -0,0 +1 @@ +/.\<x/ diff --git a/test/dfacheck1.in b/test/dfacheck1.in new file mode 100644 index 00000000..b85da3c9 --- /dev/null +++ b/test/dfacheck1.in @@ -0,0 +1 @@ +123-x diff --git a/test/dfacheck1.ok b/test/dfacheck1.ok new file mode 100644 index 00000000..b85da3c9 --- /dev/null +++ b/test/dfacheck1.ok @@ -0,0 +1 @@ +123-x |