diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | awk.h | 1 | ||||
-rw-r--r-- | awklib/eg/lib/groupawk.in | 2 | ||||
-rw-r--r-- | doc/ChangeLog | 8 | ||||
-rw-r--r-- | doc/gawk.info | 638 | ||||
-rw-r--r-- | doc/gawk.texi | 6 | ||||
-rw-r--r-- | doc/gawktexi.in | 6 | ||||
-rw-r--r-- | re.c | 10 | ||||
-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/anchor.awk | 33 | ||||
-rw-r--r-- | test/anchor.in | 3 | ||||
-rw-r--r-- | test/anchor.ok | 6 |
15 files changed, 406 insertions, 337 deletions
@@ -1,3 +1,8 @@ +2016-09-09 Norihiro Tanaka <noritnk@kcn.ne.jp> + + * awk.h (struct Regexp): Remove member has_anchor. All uses removed. + * re.c (make_regexp, research): Use dfa matcher for regex with anchor. + 2016-09-09 Arnold D. Robbins <arnold@skeeve.com> * dfa.c: Sync with grep. @@ -210,7 +210,6 @@ typedef struct Regexp { struct re_pattern_buffer pat; struct re_registers regs; struct dfa *dfareg; - bool has_anchor; /* re has anchors which dfa avoids */ bool non_empty; /* for use in fpat_parse_field */ bool has_meta; /* re has meta chars so (probably) isn't simple string */ bool maybe_long; /* re has meta chars that can match long text */ diff --git a/awklib/eg/lib/groupawk.in b/awklib/eg/lib/groupawk.in index 54a27f3d..f9e1e203 100644 --- a/awklib/eg/lib/groupawk.in +++ b/awklib/eg/lib/groupawk.in @@ -38,7 +38,7 @@ function _gr_init( oldfs, oldrs, olddol0, grcat, n = split($4, a, "[ \t]*,[ \t]*") for (i = 1; i <= n; i++) if (a[i] in _gr_groupsbyuser) - _gr_groupsbyuser[a[i]] = gr_groupsbyuser[a[i]] " " $1 + _gr_groupsbyuser[a[i]] = _gr_groupsbyuser[a[i]] " " $1 else _gr_groupsbyuser[a[i]] = $1 diff --git a/doc/ChangeLog b/doc/ChangeLog index ce21ba92..294743ba 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,11 @@ +2016-09-20 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in (Group Functions): Typo fix. Reported + by Jaromir Obr <jaromir.obr@gmail.com>. + (Time Functions): Slightly enhance description of ISO 8601 + definition of first and last weeks. Thanks to + Michel de Ruiter <mdruiter@gmail.com> for the note. + 2016-08-25 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in (POSIX String Comparison): Update for new diff --git a/doc/gawk.info b/doc/gawk.info index c39afa4f..21aedf25 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13336,8 +13336,8 @@ the following date format specifications: of week one) as a decimal number (01-53). The method for determining the week number is as specified by ISO 8601. (To wit: if the week containing January 1 has four or more days in the new - year, then it is week one; otherwise it is week 53 of the previous - year and the next week is week one.) + year, then it is week one; otherwise it is the last week [52 or 53] + of the previous year and the next week is week one.) '%w' The weekday as a decimal number (0-6). Sunday is day zero. @@ -16424,7 +16424,7 @@ the same names: n = split($4, a, "[ \t]*,[ \t]*") for (i = 1; i <= n; i++) if (a[i] in _gr_groupsbyuser) - _gr_groupsbyuser[a[i]] = gr_groupsbyuser[a[i]] " " $1 + _gr_groupsbyuser[a[i]] = _gr_groupsbyuser[a[i]] " " $1 else _gr_groupsbyuser[a[i]] = $1 @@ -35581,321 +35581,321 @@ Ref: table-system-return-values558189 Ref: I/O Functions-Footnote-1560169 Ref: I/O Functions-Footnote-2560317 Node: Time Functions560437 -Ref: Time Functions-Footnote-1570942 -Ref: Time Functions-Footnote-2571010 -Ref: Time Functions-Footnote-3571168 -Ref: Time Functions-Footnote-4571279 -Ref: Time Functions-Footnote-5571391 -Ref: Time Functions-Footnote-6571618 -Node: Bitwise Functions571884 -Ref: table-bitwise-ops572478 -Ref: Bitwise Functions-Footnote-1576816 -Node: Type Functions576989 -Node: I18N Functions579650 -Node: User-defined581301 -Node: Definition Syntax582106 -Ref: Definition Syntax-Footnote-1587793 -Node: Function Example587864 -Ref: Function Example-Footnote-1590786 -Node: Function Caveats590808 -Node: Calling A Function591326 -Node: Variable Scope592284 -Node: Pass By Value/Reference595278 -Node: Return Statement598777 -Node: Dynamic Typing601756 -Node: Indirect Calls602686 -Ref: Indirect Calls-Footnote-1612937 -Node: Functions Summary613065 -Node: Library Functions615770 -Ref: Library Functions-Footnote-1619377 -Ref: Library Functions-Footnote-2619520 -Node: Library Names619691 -Ref: Library Names-Footnote-1623151 -Ref: Library Names-Footnote-2623374 -Node: General Functions623460 -Node: Strtonum Function624563 -Node: Assert Function627585 -Node: Round Function630911 -Node: Cliff Random Function632452 -Node: Ordinal Functions633468 -Ref: Ordinal Functions-Footnote-1636531 -Ref: Ordinal Functions-Footnote-2636783 -Node: Join Function636993 -Ref: Join Function-Footnote-1638763 -Node: Getlocaltime Function638963 -Node: Readfile Function642705 -Node: Shell Quoting644677 -Node: Data File Management646078 -Node: Filetrans Function646710 -Node: Rewind Function650806 -Node: File Checking652712 -Ref: File Checking-Footnote-1654046 -Node: Empty Files654247 -Node: Ignoring Assigns656226 -Node: Getopt Function657776 -Ref: Getopt Function-Footnote-1669245 -Node: Passwd Functions669445 -Ref: Passwd Functions-Footnote-1678284 -Node: Group Functions678372 -Ref: Group Functions-Footnote-1686269 -Node: Walking Arrays686476 -Node: Library Functions Summary689484 -Node: Library Exercises690890 -Node: Sample Programs691355 -Node: Running Examples692125 -Node: Clones692853 -Node: Cut Program694077 -Node: Egrep Program704006 -Ref: Egrep Program-Footnote-1711518 -Node: Id Program711628 -Node: Split Program715308 -Ref: Split Program-Footnote-1718767 -Node: Tee Program718896 -Node: Uniq Program721686 -Node: Wc Program729112 -Ref: Wc Program-Footnote-1733367 -Node: Miscellaneous Programs733461 -Node: Dupword Program734674 -Node: Alarm Program736704 -Node: Translate Program741559 -Ref: Translate Program-Footnote-1746124 -Node: Labels Program746394 -Ref: Labels Program-Footnote-1749745 -Node: Word Sorting749829 -Node: History Sorting753901 -Node: Extract Program755736 -Node: Simple Sed763265 -Node: Igawk Program766339 -Ref: Igawk Program-Footnote-1780670 -Ref: Igawk Program-Footnote-2780872 -Ref: Igawk Program-Footnote-3780994 -Node: Anagram Program781109 -Node: Signature Program784171 -Node: Programs Summary785418 -Node: Programs Exercises786632 -Ref: Programs Exercises-Footnote-1790761 -Node: Advanced Features790852 -Node: Nondecimal Data792842 -Node: Array Sorting794433 -Node: Controlling Array Traversal795133 -Ref: Controlling Array Traversal-Footnote-1803500 -Node: Array Sorting Functions803618 -Ref: Array Sorting Functions-Footnote-1808709 -Node: Two-way I/O808905 -Ref: Two-way I/O-Footnote-1815455 -Ref: Two-way I/O-Footnote-2815642 -Node: TCP/IP Networking815724 -Node: Profiling818842 -Ref: Profiling-Footnote-1827335 -Node: Advanced Features Summary827658 -Node: Internationalization829502 -Node: I18N and L10N830982 -Node: Explaining gettext831669 -Ref: Explaining gettext-Footnote-1837561 -Ref: Explaining gettext-Footnote-2837746 -Node: Programmer i18n837911 -Ref: Programmer i18n-Footnote-1842766 -Node: Translator i18n842815 -Node: String Extraction843609 -Ref: String Extraction-Footnote-1844741 -Node: Printf Ordering844827 -Ref: Printf Ordering-Footnote-1847613 -Node: I18N Portability847677 -Ref: I18N Portability-Footnote-1850133 -Node: I18N Example850196 -Ref: I18N Example-Footnote-1853002 -Node: Gawk I18N853075 -Node: I18N Summary853720 -Node: Debugger855061 -Node: Debugging856083 -Node: Debugging Concepts856524 -Node: Debugging Terms858333 -Node: Awk Debugging860908 -Node: Sample Debugging Session861814 -Node: Debugger Invocation862348 -Node: Finding The Bug863734 -Node: List of Debugger Commands870212 -Node: Breakpoint Control871545 -Node: Debugger Execution Control875239 -Node: Viewing And Changing Data878601 -Node: Execution Stack881975 -Node: Debugger Info883612 -Node: Miscellaneous Debugger Commands887683 -Node: Readline Support892771 -Node: Limitations893667 -Ref: Limitations-Footnote-1897898 -Node: Debugging Summary897949 -Node: Arbitrary Precision Arithmetic899228 -Node: Computer Arithmetic900644 -Ref: table-numeric-ranges904235 -Ref: Computer Arithmetic-Footnote-1904957 -Node: Math Definitions905014 -Ref: table-ieee-formats908328 -Ref: Math Definitions-Footnote-1908931 -Node: MPFR features909036 -Node: FP Math Caution910753 -Ref: FP Math Caution-Footnote-1911825 -Node: Inexactness of computations912194 -Node: Inexact representation913154 -Node: Comparing FP Values914514 -Node: Errors accumulate915596 -Node: Getting Accuracy917029 -Node: Try To Round919739 -Node: Setting precision920638 -Ref: table-predefined-precision-strings921335 -Node: Setting the rounding mode923165 -Ref: table-gawk-rounding-modes923539 -Ref: Setting the rounding mode-Footnote-1926947 -Node: Arbitrary Precision Integers927126 -Ref: Arbitrary Precision Integers-Footnote-1932043 -Node: POSIX Floating Point Problems932192 -Ref: POSIX Floating Point Problems-Footnote-1936074 -Node: Floating point summary936112 -Node: Dynamic Extensions938302 -Node: Extension Intro939855 -Node: Plugin License941121 -Node: Extension Mechanism Outline941918 -Ref: figure-load-extension942357 -Ref: figure-register-new-function943922 -Ref: figure-call-new-function945014 -Node: Extension API Description947076 -Node: Extension API Functions Introduction948608 -Node: General Data Types953467 -Ref: General Data Types-Footnote-1959422 -Node: Memory Allocation Functions959721 -Ref: Memory Allocation Functions-Footnote-1962566 -Node: Constructor Functions962665 -Node: Registration Functions964410 -Node: Extension Functions965095 -Node: Exit Callback Functions967718 -Node: Extension Version String968968 -Node: Input Parsers969631 -Node: Output Wrappers979513 -Node: Two-way processors984025 -Node: Printing Messages986290 -Ref: Printing Messages-Footnote-1987461 -Node: Updating ERRNO987614 -Node: Requesting Values988353 -Ref: table-value-types-returned989090 -Node: Accessing Parameters989973 -Node: Symbol Table Access991208 -Node: Symbol table by name991720 -Node: Symbol table by cookie993741 -Ref: Symbol table by cookie-Footnote-1997893 -Node: Cached values997957 -Ref: Cached values-Footnote-11001464 -Node: Array Manipulation1001555 -Ref: Array Manipulation-Footnote-11002646 -Node: Array Data Types1002683 -Ref: Array Data Types-Footnote-11005341 -Node: Array Functions1005433 -Node: Flattening Arrays1009291 -Node: Creating Arrays1016199 -Node: Redirection API1020968 -Node: Extension API Variables1023799 -Node: Extension Versioning1024432 -Ref: gawk-api-version1024869 -Node: Extension API Informational Variables1026625 -Node: Extension API Boilerplate1027689 -Node: Finding Extensions1031503 -Node: Extension Example1032062 -Node: Internal File Description1032860 -Node: Internal File Ops1036940 -Ref: Internal File Ops-Footnote-11048702 -Node: Using Internal File Ops1048842 -Ref: Using Internal File Ops-Footnote-11051225 -Node: Extension Samples1051499 -Node: Extension Sample File Functions1053028 -Node: Extension Sample Fnmatch1060677 -Node: Extension Sample Fork1062164 -Node: Extension Sample Inplace1063382 -Node: Extension Sample Ord1066592 -Node: Extension Sample Readdir1067428 -Ref: table-readdir-file-types1068317 -Node: Extension Sample Revout1069122 -Node: Extension Sample Rev2way1069711 -Node: Extension Sample Read write array1070451 -Node: Extension Sample Readfile1072393 -Node: Extension Sample Time1073488 -Node: Extension Sample API Tests1074836 -Node: gawkextlib1075328 -Node: Extension summary1077775 -Node: Extension Exercises1081477 -Node: Language History1082975 -Node: V7/SVR3.11084631 -Node: SVR41086783 -Node: POSIX1088217 -Node: BTL1089596 -Node: POSIX/GNU1090325 -Node: Feature History1096187 -Node: Common Extensions1110557 -Node: Ranges and Locales1111840 -Ref: Ranges and Locales-Footnote-11116456 -Ref: Ranges and Locales-Footnote-21116483 -Ref: Ranges and Locales-Footnote-31116718 -Node: Contributors1116939 -Node: History summary1122499 -Node: Installation1123879 -Node: Gawk Distribution1124823 -Node: Getting1125307 -Node: Extracting1126268 -Node: Distribution contents1127906 -Node: Unix Installation1134000 -Node: Quick Installation1134682 -Node: Shell Startup Files1137096 -Node: Additional Configuration Options1138174 -Node: Configuration Philosophy1139979 -Node: Non-Unix Installation1142348 -Node: PC Installation1142806 -Node: PC Binary Installation1144126 -Node: PC Compiling1145978 -Ref: PC Compiling-Footnote-11148772 -Node: PC Testing1148881 -Node: PC Using1150061 -Ref: PC Using-Footnote-11154214 -Node: Cygwin1154287 -Node: MSYS1155057 -Node: VMS Installation1155558 -Node: VMS Compilation1156349 -Ref: VMS Compilation-Footnote-11157578 -Node: VMS Dynamic Extensions1157636 -Node: VMS Installation Details1159321 -Node: VMS Running1161574 -Node: VMS GNV1165853 -Node: VMS Old Gawk1166588 -Node: Bugs1167059 -Node: Other Versions1171374 -Node: Installation summary1177958 -Node: Notes1179009 -Node: Compatibility Mode1179874 -Node: Additions1180656 -Node: Accessing The Source1181581 -Node: Adding Code1183016 -Node: New Ports1189235 -Node: Derived Files1193723 -Ref: Derived Files-Footnote-11199208 -Ref: Derived Files-Footnote-21199243 -Ref: Derived Files-Footnote-31199841 -Node: Future Extensions1199955 -Node: Implementation Limitations1200613 -Node: Extension Design1201796 -Node: Old Extension Problems1202950 -Ref: Old Extension Problems-Footnote-11204468 -Node: Extension New Mechanism Goals1204525 -Ref: Extension New Mechanism Goals-Footnote-11207889 -Node: Extension Other Design Decisions1208078 -Node: Extension Future Growth1210191 -Node: Old Extension Mechanism1211027 -Node: Notes summary1212790 -Node: Basic Concepts1213972 -Node: Basic High Level1214653 -Ref: figure-general-flow1214935 -Ref: figure-process-flow1215620 -Ref: Basic High Level-Footnote-11218921 -Node: Basic Data Typing1219106 -Node: Glossary1222434 -Node: Copying1254381 -Node: GNU Free Documentation License1291920 -Node: Index1317038 +Ref: Time Functions-Footnote-1570959 +Ref: Time Functions-Footnote-2571027 +Ref: Time Functions-Footnote-3571185 +Ref: Time Functions-Footnote-4571296 +Ref: Time Functions-Footnote-5571408 +Ref: Time Functions-Footnote-6571635 +Node: Bitwise Functions571901 +Ref: table-bitwise-ops572495 +Ref: Bitwise Functions-Footnote-1576833 +Node: Type Functions577006 +Node: I18N Functions579667 +Node: User-defined581318 +Node: Definition Syntax582123 +Ref: Definition Syntax-Footnote-1587810 +Node: Function Example587881 +Ref: Function Example-Footnote-1590803 +Node: Function Caveats590825 +Node: Calling A Function591343 +Node: Variable Scope592301 +Node: Pass By Value/Reference595295 +Node: Return Statement598794 +Node: Dynamic Typing601773 +Node: Indirect Calls602703 +Ref: Indirect Calls-Footnote-1612954 +Node: Functions Summary613082 +Node: Library Functions615787 +Ref: Library Functions-Footnote-1619394 +Ref: Library Functions-Footnote-2619537 +Node: Library Names619708 +Ref: Library Names-Footnote-1623168 +Ref: Library Names-Footnote-2623391 +Node: General Functions623477 +Node: Strtonum Function624580 +Node: Assert Function627602 +Node: Round Function630928 +Node: Cliff Random Function632469 +Node: Ordinal Functions633485 +Ref: Ordinal Functions-Footnote-1636548 +Ref: Ordinal Functions-Footnote-2636800 +Node: Join Function637010 +Ref: Join Function-Footnote-1638780 +Node: Getlocaltime Function638980 +Node: Readfile Function642722 +Node: Shell Quoting644694 +Node: Data File Management646095 +Node: Filetrans Function646727 +Node: Rewind Function650823 +Node: File Checking652729 +Ref: File Checking-Footnote-1654063 +Node: Empty Files654264 +Node: Ignoring Assigns656243 +Node: Getopt Function657793 +Ref: Getopt Function-Footnote-1669262 +Node: Passwd Functions669462 +Ref: Passwd Functions-Footnote-1678301 +Node: Group Functions678389 +Ref: Group Functions-Footnote-1686287 +Node: Walking Arrays686494 +Node: Library Functions Summary689502 +Node: Library Exercises690908 +Node: Sample Programs691373 +Node: Running Examples692143 +Node: Clones692871 +Node: Cut Program694095 +Node: Egrep Program704024 +Ref: Egrep Program-Footnote-1711536 +Node: Id Program711646 +Node: Split Program715326 +Ref: Split Program-Footnote-1718785 +Node: Tee Program718914 +Node: Uniq Program721704 +Node: Wc Program729130 +Ref: Wc Program-Footnote-1733385 +Node: Miscellaneous Programs733479 +Node: Dupword Program734692 +Node: Alarm Program736722 +Node: Translate Program741577 +Ref: Translate Program-Footnote-1746142 +Node: Labels Program746412 +Ref: Labels Program-Footnote-1749763 +Node: Word Sorting749847 +Node: History Sorting753919 +Node: Extract Program755754 +Node: Simple Sed763283 +Node: Igawk Program766357 +Ref: Igawk Program-Footnote-1780688 +Ref: Igawk Program-Footnote-2780890 +Ref: Igawk Program-Footnote-3781012 +Node: Anagram Program781127 +Node: Signature Program784189 +Node: Programs Summary785436 +Node: Programs Exercises786650 +Ref: Programs Exercises-Footnote-1790779 +Node: Advanced Features790870 +Node: Nondecimal Data792860 +Node: Array Sorting794451 +Node: Controlling Array Traversal795151 +Ref: Controlling Array Traversal-Footnote-1803518 +Node: Array Sorting Functions803636 +Ref: Array Sorting Functions-Footnote-1808727 +Node: Two-way I/O808923 +Ref: Two-way I/O-Footnote-1815473 +Ref: Two-way I/O-Footnote-2815660 +Node: TCP/IP Networking815742 +Node: Profiling818860 +Ref: Profiling-Footnote-1827353 +Node: Advanced Features Summary827676 +Node: Internationalization829520 +Node: I18N and L10N831000 +Node: Explaining gettext831687 +Ref: Explaining gettext-Footnote-1837579 +Ref: Explaining gettext-Footnote-2837764 +Node: Programmer i18n837929 +Ref: Programmer i18n-Footnote-1842784 +Node: Translator i18n842833 +Node: String Extraction843627 +Ref: String Extraction-Footnote-1844759 +Node: Printf Ordering844845 +Ref: Printf Ordering-Footnote-1847631 +Node: I18N Portability847695 +Ref: I18N Portability-Footnote-1850151 +Node: I18N Example850214 +Ref: I18N Example-Footnote-1853020 +Node: Gawk I18N853093 +Node: I18N Summary853738 +Node: Debugger855079 +Node: Debugging856101 +Node: Debugging Concepts856542 +Node: Debugging Terms858351 +Node: Awk Debugging860926 +Node: Sample Debugging Session861832 +Node: Debugger Invocation862366 +Node: Finding The Bug863752 +Node: List of Debugger Commands870230 +Node: Breakpoint Control871563 +Node: Debugger Execution Control875257 +Node: Viewing And Changing Data878619 +Node: Execution Stack881993 +Node: Debugger Info883630 +Node: Miscellaneous Debugger Commands887701 +Node: Readline Support892789 +Node: Limitations893685 +Ref: Limitations-Footnote-1897916 +Node: Debugging Summary897967 +Node: Arbitrary Precision Arithmetic899246 +Node: Computer Arithmetic900662 +Ref: table-numeric-ranges904253 +Ref: Computer Arithmetic-Footnote-1904975 +Node: Math Definitions905032 +Ref: table-ieee-formats908346 +Ref: Math Definitions-Footnote-1908949 +Node: MPFR features909054 +Node: FP Math Caution910771 +Ref: FP Math Caution-Footnote-1911843 +Node: Inexactness of computations912212 +Node: Inexact representation913172 +Node: Comparing FP Values914532 +Node: Errors accumulate915614 +Node: Getting Accuracy917047 +Node: Try To Round919757 +Node: Setting precision920656 +Ref: table-predefined-precision-strings921353 +Node: Setting the rounding mode923183 +Ref: table-gawk-rounding-modes923557 +Ref: Setting the rounding mode-Footnote-1926965 +Node: Arbitrary Precision Integers927144 +Ref: Arbitrary Precision Integers-Footnote-1932061 +Node: POSIX Floating Point Problems932210 +Ref: POSIX Floating Point Problems-Footnote-1936092 +Node: Floating point summary936130 +Node: Dynamic Extensions938320 +Node: Extension Intro939873 +Node: Plugin License941139 +Node: Extension Mechanism Outline941936 +Ref: figure-load-extension942375 +Ref: figure-register-new-function943940 +Ref: figure-call-new-function945032 +Node: Extension API Description947094 +Node: Extension API Functions Introduction948626 +Node: General Data Types953485 +Ref: General Data Types-Footnote-1959440 +Node: Memory Allocation Functions959739 +Ref: Memory Allocation Functions-Footnote-1962584 +Node: Constructor Functions962683 +Node: Registration Functions964428 +Node: Extension Functions965113 +Node: Exit Callback Functions967736 +Node: Extension Version String968986 +Node: Input Parsers969649 +Node: Output Wrappers979531 +Node: Two-way processors984043 +Node: Printing Messages986308 +Ref: Printing Messages-Footnote-1987479 +Node: Updating ERRNO987632 +Node: Requesting Values988371 +Ref: table-value-types-returned989108 +Node: Accessing Parameters989991 +Node: Symbol Table Access991226 +Node: Symbol table by name991738 +Node: Symbol table by cookie993759 +Ref: Symbol table by cookie-Footnote-1997911 +Node: Cached values997975 +Ref: Cached values-Footnote-11001482 +Node: Array Manipulation1001573 +Ref: Array Manipulation-Footnote-11002664 +Node: Array Data Types1002701 +Ref: Array Data Types-Footnote-11005359 +Node: Array Functions1005451 +Node: Flattening Arrays1009309 +Node: Creating Arrays1016217 +Node: Redirection API1020986 +Node: Extension API Variables1023817 +Node: Extension Versioning1024450 +Ref: gawk-api-version1024887 +Node: Extension API Informational Variables1026643 +Node: Extension API Boilerplate1027707 +Node: Finding Extensions1031521 +Node: Extension Example1032080 +Node: Internal File Description1032878 +Node: Internal File Ops1036958 +Ref: Internal File Ops-Footnote-11048720 +Node: Using Internal File Ops1048860 +Ref: Using Internal File Ops-Footnote-11051243 +Node: Extension Samples1051517 +Node: Extension Sample File Functions1053046 +Node: Extension Sample Fnmatch1060695 +Node: Extension Sample Fork1062182 +Node: Extension Sample Inplace1063400 +Node: Extension Sample Ord1066610 +Node: Extension Sample Readdir1067446 +Ref: table-readdir-file-types1068335 +Node: Extension Sample Revout1069140 +Node: Extension Sample Rev2way1069729 +Node: Extension Sample Read write array1070469 +Node: Extension Sample Readfile1072411 +Node: Extension Sample Time1073506 +Node: Extension Sample API Tests1074854 +Node: gawkextlib1075346 +Node: Extension summary1077793 +Node: Extension Exercises1081495 +Node: Language History1082993 +Node: V7/SVR3.11084649 +Node: SVR41086801 +Node: POSIX1088235 +Node: BTL1089614 +Node: POSIX/GNU1090343 +Node: Feature History1096205 +Node: Common Extensions1110575 +Node: Ranges and Locales1111858 +Ref: Ranges and Locales-Footnote-11116474 +Ref: Ranges and Locales-Footnote-21116501 +Ref: Ranges and Locales-Footnote-31116736 +Node: Contributors1116957 +Node: History summary1122517 +Node: Installation1123897 +Node: Gawk Distribution1124841 +Node: Getting1125325 +Node: Extracting1126286 +Node: Distribution contents1127924 +Node: Unix Installation1134018 +Node: Quick Installation1134700 +Node: Shell Startup Files1137114 +Node: Additional Configuration Options1138192 +Node: Configuration Philosophy1139997 +Node: Non-Unix Installation1142366 +Node: PC Installation1142824 +Node: PC Binary Installation1144144 +Node: PC Compiling1145996 +Ref: PC Compiling-Footnote-11148790 +Node: PC Testing1148899 +Node: PC Using1150079 +Ref: PC Using-Footnote-11154232 +Node: Cygwin1154305 +Node: MSYS1155075 +Node: VMS Installation1155576 +Node: VMS Compilation1156367 +Ref: VMS Compilation-Footnote-11157596 +Node: VMS Dynamic Extensions1157654 +Node: VMS Installation Details1159339 +Node: VMS Running1161592 +Node: VMS GNV1165871 +Node: VMS Old Gawk1166606 +Node: Bugs1167077 +Node: Other Versions1171392 +Node: Installation summary1177976 +Node: Notes1179027 +Node: Compatibility Mode1179892 +Node: Additions1180674 +Node: Accessing The Source1181599 +Node: Adding Code1183034 +Node: New Ports1189253 +Node: Derived Files1193741 +Ref: Derived Files-Footnote-11199226 +Ref: Derived Files-Footnote-21199261 +Ref: Derived Files-Footnote-31199859 +Node: Future Extensions1199973 +Node: Implementation Limitations1200631 +Node: Extension Design1201814 +Node: Old Extension Problems1202968 +Ref: Old Extension Problems-Footnote-11204486 +Node: Extension New Mechanism Goals1204543 +Ref: Extension New Mechanism Goals-Footnote-11207907 +Node: Extension Other Design Decisions1208096 +Node: Extension Future Growth1210209 +Node: Old Extension Mechanism1211045 +Node: Notes summary1212808 +Node: Basic Concepts1213990 +Node: Basic High Level1214671 +Ref: figure-general-flow1214953 +Ref: figure-process-flow1215638 +Ref: Basic High Level-Footnote-11218939 +Node: Basic Data Typing1219124 +Node: Glossary1222452 +Node: Copying1254399 +Node: GNU Free Documentation License1291938 +Node: Index1317056 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 60dfe961..b24445e3 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19128,8 +19128,8 @@ The week number of the year (with the first Monday as the first day of week one) as a decimal number (01--53). The method for determining the week number is as specified by ISO 8601. (To wit: if the week containing January 1 has four or more days in the -new year, then it is week one; otherwise it is week 53 of the previous year -and the next week is week one.) +new year, then it is week one; otherwise it is the last week +[52 or 53] of the previous year and the next week is week one.) @item %w The weekday as a decimal number (0--6). Sunday is day zero. @@ -23221,7 +23221,7 @@ function _gr_init( oldfs, oldrs, olddol0, grcat, n = split($4, a, "[ \t]*,[ \t]*") for (i = 1; i <= n; i++) if (a[i] in _gr_groupsbyuser) - _gr_groupsbyuser[a[i]] = gr_groupsbyuser[a[i]] " " $1 + _gr_groupsbyuser[a[i]] = _gr_groupsbyuser[a[i]] " " $1 else _gr_groupsbyuser[a[i]] = $1 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 546f7611..647bb0fb 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -18240,8 +18240,8 @@ The week number of the year (with the first Monday as the first day of week one) as a decimal number (01--53). The method for determining the week number is as specified by ISO 8601. (To wit: if the week containing January 1 has four or more days in the -new year, then it is week one; otherwise it is week 53 of the previous year -and the next week is week one.) +new year, then it is week one; otherwise it is the last week +[52 or 53] of the previous year and the next week is week one.) @item %w The weekday as a decimal number (0--6). Sunday is day zero. @@ -22303,7 +22303,7 @@ function _gr_init( oldfs, oldrs, olddol0, grcat, n = split($4, a, "[ \t]*,[ \t]*") for (i = 1; i <= n; i++) if (a[i] in _gr_groupsbyuser) - _gr_groupsbyuser[a[i]] = gr_groupsbyuser[a[i]] " " $1 + _gr_groupsbyuser[a[i]] = _gr_groupsbyuser[a[i]] " " $1 else _gr_groupsbyuser[a[i]] = $1 @@ -49,7 +49,6 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) int c, c2; static bool first = true; static bool no_dfa = false; - bool has_anchor = false; reg_syntax_t dfa_syn; int i; @@ -160,9 +159,6 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) } /* switch */ } else { c = *src; - if (c == '^' || c == '$') - has_anchor = true; - *dest++ = *src++; /* not '\\' */ } if (gawk_mb_cur_max > 1 && is_multibyte) @@ -228,11 +224,10 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) if (dfa && ! no_dfa) { rp->dfareg = dfaalloc(); dfasyntax(rp->dfareg, & localeinfo, dfa_syn, - ignorecase ? DFA_CASE_FOLD : 0); + (ignorecase ? DFA_CASE_FOLD : 0) | DFA_ANCHOR); dfacomp(buf, len, rp->dfareg, true); } else rp->dfareg = NULL; - rp->has_anchor = has_anchor; /* Additional flags that help with RS as regexp. */ for (i = 0; i < len; i++) { @@ -287,7 +282,7 @@ research(Regexp *rp, char *str, int start, ret = dfaexec(superset, str+start, str+start+len, true, NULL, NULL); - if (ret && ((! need_start && ! rp->has_anchor) + if (ret && (! need_start || (! superset && dfaisfast(rp->dfareg)))) ret = dfaexec(rp->dfareg, str+start, str+start+len, true, NULL, &try_backref); @@ -298,7 +293,6 @@ research(Regexp *rp, char *str, int start, || start != 0 || no_bol || need_start - || rp->has_anchor || try_backref) { /* * Passing NULL as last arg speeds up search for cases diff --git a/test/ChangeLog b/test/ChangeLog index eae30fd9..57b0e602 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2016-09-09 Norihiro Tanaka <noritnk@kcn.ne.jp> + + * Makefile.am (anchor): New test. + * anchor.awk, anchor.in, anchor.ok: New files. + 2016-08-25 Arnold D. Robbins <arnold@skeeve.com> * 4.1.4: Release tar ball made. diff --git a/test/Makefile.am b/test/Makefile.am index f0adb5a5..2ca18c24 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -47,6 +47,9 @@ EXTRA_DIST = \ anchgsub.awk \ anchgsub.in \ anchgsub.ok \ + anchor.awk \ + anchor.in \ + anchor.ok \ argarray.awk \ argarray.in \ argarray.ok \ @@ -1147,7 +1150,7 @@ CLEANFILES = core core.* fmtspcl.ok # try to keep these sorted. each letter starts a new line BASIC_TESTS = \ - addcomma anchgsub argarray arrayind1 arrayind2 arrayparm arrayprm2 arrayprm3 \ + addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayparm arrayprm2 arrayprm3 \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 aryprm9 arysubnm asgext awkpath \ diff --git a/test/Makefile.in b/test/Makefile.in index 484aa780..a0520a55 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -304,6 +304,9 @@ EXTRA_DIST = \ anchgsub.awk \ anchgsub.in \ anchgsub.ok \ + anchor.awk \ + anchor.in \ + anchor.ok \ argarray.awk \ argarray.in \ argarray.ok \ @@ -1403,7 +1406,7 @@ CLEANFILES = core core.* fmtspcl.ok # try to keep these sorted. each letter starts a new line BASIC_TESTS = \ - addcomma anchgsub argarray arrayind1 arrayind2 arrayparm arrayprm2 arrayprm3 \ + addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayparm arrayprm2 arrayprm3 \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 aryprm9 arysubnm asgext awkpath \ @@ -2796,6 +2799,11 @@ anchgsub: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +anchor: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + arrayind1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 951590ac..081d96ef 100644 --- a/test/Maketests +++ b/test/Maketests @@ -10,6 +10,11 @@ anchgsub: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +anchor: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + arrayind1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/anchor.awk b/test/anchor.awk new file mode 100644 index 00000000..56f47569 --- /dev/null +++ b/test/anchor.awk @@ -0,0 +1,33 @@ +BEGIN { RS = "" } + +{ + if (/^A/) + print "ok" + else + print "not ok" + + if (/B$/) + print "not ok" + else + print "ok" + + if (/^C/) + print "not ok" + else + print "ok" + + if (/D$/) + print "not ok" + else + print "ok" + + if (/^E/) + print "not ok" + else + print "ok" + + if (/F$/) + print "ok" + else + print "not ok" +} diff --git a/test/anchor.in b/test/anchor.in new file mode 100644 index 00000000..a97e9859 --- /dev/null +++ b/test/anchor.in @@ -0,0 +1,3 @@ +A line1 B +C line2 D +E line3 F diff --git a/test/anchor.ok b/test/anchor.ok new file mode 100644 index 00000000..7780b88b --- /dev/null +++ b/test/anchor.ok @@ -0,0 +1,6 @@ +ok +ok +ok +ok +ok +ok |