diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2021-11-22 21:57:42 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2021-11-22 21:57:42 +0200 |
commit | f44bcf14b40716abe45306b0ca427a2b8359f28f (patch) | |
tree | e141fbe1264304e0a7b83bd40ec8bd57a18c1a84 | |
parent | 0c02a53775a80fe10dcd2b0ae5e857c1f22f8727 (diff) | |
parent | 4a7a1509991bfa9b79816a04fbee3398e3be6841 (diff) | |
download | egawk-f44bcf14b40716abe45306b0ca427a2b8359f28f.tar.gz egawk-f44bcf14b40716abe45306b0ca427a2b8359f28f.tar.bz2 egawk-f44bcf14b40716abe45306b0ca427a2b8359f28f.zip |
Merge branch 'gawk-5.1-stable'
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | builtin.c | 23 | ||||
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.info | 590 | ||||
-rw-r--r-- | doc/gawk.texi | 2 | ||||
-rw-r--r-- | doc/gawktexi.in | 2 | ||||
-rw-r--r-- | pc/ChangeLog | 4 | ||||
-rw-r--r-- | pc/Makefile.tst | 7 | ||||
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/stupid3.ok | 2 | ||||
-rw-r--r-- | test/stupid4.ok | 2 | ||||
-rw-r--r-- | test/stupid5.awk | 9 | ||||
-rw-r--r-- | test/stupid5.ok | 2 |
16 files changed, 377 insertions, 300 deletions
@@ -1,3 +1,8 @@ +2021-11-21 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (do_typeof): Make Node_array_ref handling smarter. + See test/stupid5.awk. + 2021-11-18 Arnold D. Robbins <arnold@skeeve.com> * gawkapi.c (awk_value_to_node): Fix handling of MPFR values @@ -4189,10 +4189,31 @@ do_typeof(int nargs) } break; case Node_var_new: - case Node_array_ref: res = "untyped"; deref = false; break; + case Node_array_ref: + /* + * function f(x) { + * print typeof(x) + * y = x + * print typeof(x) + * } + * + * BEGIN { + * print typeof(x) + * f(x) + * } + */ + if (arg->orig_array->type == Node_var + && (arg->orig_array->var_value == Nnull_string + || (arg->orig_array->var_value->flags & NULL_FIELD) != 0)) { + res = "unassigned"; + } else { + res = "untyped"; + } + deref = false; + break; case Node_var: /* * Note: this doesn't happen because the function calling code diff --git a/doc/ChangeLog b/doc/ChangeLog index 533c7983..652c6a31 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2021-11-21 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in (Getopt Function): Note that long option support + was contributed by Greg Minshall, and add him to the index. + 2021-11-15 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Fix a small typo. Thanks to J Naman diff --git a/doc/gawk.info b/doc/gawk.info index f93d89fd..f29969b4 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -16898,7 +16898,8 @@ Options::). The abstraction provided by 'getopt()' is very useful and is quite handy in 'awk' programs as well. Following is an 'awk' version of -'getopt()' that accepts both short and long options. +'getopt()' that accepts both short and long options. (Support for long +options was supplied by Greg Minshall. We thank him.) This function highlights one of the greatest weaknesses in 'awk', which is that it is very poor at manipulating single characters. The @@ -37103,8 +37104,8 @@ Index * getlocaltime() user-defined function: Getlocaltime Function. (line 16) * getopt() function (C library): Getopt Function. (line 15) -* getopt() user-defined function: Getopt Function. (line 116) -* getopt() user-defined function <1>: Getopt Function. (line 143) +* getopt() user-defined function: Getopt Function. (line 117) +* getopt() user-defined function <1>: Getopt Function. (line 144) * getpwent() function (C library): Passwd Functions. (line 16) * getpwent() function (C library) <1>: Passwd Functions. (line 195) * getpwent() user-defined function: Passwd Functions. (line 16) @@ -37480,6 +37481,7 @@ Index * metacharacters, escape sequences for: Escape Sequences. (line 139) * metacharacters, in regular expressions: Regexp Operators. (line 6) * minimum precision required by MPFR library: Auto-set. (line 279) +* Minshall, Greg: Getopt Function. (line 105) * mkbool: Boolean Functions. (line 10) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) @@ -38579,8 +38581,8 @@ Index * user-defined, function, beginfile(): Filetrans Function. (line 62) * user-defined, function, endfile(): Filetrans Function. (line 62) * user-defined, function, rewind(): Rewind Function. (line 15) -* user-defined, function, getopt(): Getopt Function. (line 116) -* user-defined, function, getopt() <1>: Getopt Function. (line 143) +* user-defined, function, getopt(): Getopt Function. (line 117) +* user-defined, function, getopt() <1>: Getopt Function. (line 144) * user-defined, function, getpwent(): Passwd Functions. (line 16) * user-defined, function, _pw_init(): Passwd Functions. (line 105) * user-defined, function, getpwnam(): Passwd Functions. (line 179) @@ -39024,295 +39026,295 @@ Ref: File Checking-Footnote-1694658 Node: Empty Files694859 Node: Ignoring Assigns696838 Node: Getopt Function698388 -Ref: Getopt Function-Footnote-1713611 -Node: Passwd Functions713811 -Ref: Passwd Functions-Footnote-1722650 -Node: Group Functions722738 -Ref: Group Functions-Footnote-1730636 -Node: Walking Arrays730843 -Node: Library Functions Summary733851 -Node: Library Exercises735257 -Node: Sample Programs735722 -Node: Running Examples736492 -Node: Clones737220 -Node: Cut Program738444 -Node: Egrep Program748584 -Node: Id Program757585 -Node: Split Program767520 -Ref: Split Program-Footnote-1777413 -Node: Tee Program777586 -Node: Uniq Program780376 -Node: Wc Program787964 -Node: Bytes vs. Characters788351 -Node: Using extensions789899 -Node: wc program790653 -Node: Miscellaneous Programs795518 -Node: Dupword Program796731 -Node: Alarm Program798761 -Node: Translate Program803616 -Ref: Translate Program-Footnote-1808181 -Node: Labels Program808451 -Ref: Labels Program-Footnote-1811802 -Node: Word Sorting811886 -Node: History Sorting815958 -Node: Extract Program818183 -Node: Simple Sed826196 -Node: Igawk Program829270 -Ref: Igawk Program-Footnote-1843601 -Ref: Igawk Program-Footnote-2843803 -Ref: Igawk Program-Footnote-3843925 -Node: Anagram Program844040 -Node: Signature Program847102 -Node: Programs Summary848349 -Node: Programs Exercises849563 -Ref: Programs Exercises-Footnote-1853693 -Node: Advanced Features853779 -Node: Nondecimal Data855910 -Node: Boolean Typed Values857508 -Node: Array Sorting859389 -Node: Controlling Array Traversal860094 -Ref: Controlling Array Traversal-Footnote-1868462 -Node: Array Sorting Functions868580 -Ref: Array Sorting Functions-Footnote-1873954 -Node: Two-way I/O874150 -Ref: Two-way I/O-Footnote-1881876 -Ref: Two-way I/O-Footnote-2882063 -Node: TCP/IP Networking882145 -Node: Profiling885221 -Node: Extension Philosophy894530 -Node: Advanced Features Summary896009 -Node: Internationalization898024 -Node: I18N and L10N899698 -Node: Explaining gettext900385 -Ref: Explaining gettext-Footnote-1906277 -Ref: Explaining gettext-Footnote-2906462 -Node: Programmer i18n906627 -Ref: Programmer i18n-Footnote-1911576 -Node: Translator i18n911625 -Node: String Extraction912419 -Ref: String Extraction-Footnote-1913551 -Node: Printf Ordering913637 -Ref: Printf Ordering-Footnote-1916423 -Node: I18N Portability916487 -Ref: I18N Portability-Footnote-1918943 -Node: I18N Example919006 -Ref: I18N Example-Footnote-1922281 -Ref: I18N Example-Footnote-2922354 -Node: Gawk I18N922463 -Node: I18N Summary923085 -Node: Debugger924426 -Node: Debugging925426 -Node: Debugging Concepts925867 -Node: Debugging Terms927676 -Node: Awk Debugging930251 -Ref: Awk Debugging-Footnote-1931196 -Node: Sample Debugging Session931328 -Node: Debugger Invocation931862 -Node: Finding The Bug933248 -Node: List of Debugger Commands939722 -Node: Breakpoint Control941055 -Node: Debugger Execution Control944749 -Node: Viewing And Changing Data948111 -Node: Execution Stack951652 -Node: Debugger Info953289 -Node: Miscellaneous Debugger Commands957360 -Node: Readline Support962422 -Node: Limitations963318 -Node: Debugging Summary965872 -Node: Namespaces967151 -Node: Global Namespace968262 -Node: Qualified Names969660 -Node: Default Namespace970659 -Node: Changing The Namespace971400 -Node: Naming Rules973014 -Node: Internal Name Management974862 -Node: Namespace Example975904 -Node: Namespace And Features978466 -Node: Namespace Summary979901 -Node: Arbitrary Precision Arithmetic981378 -Node: Computer Arithmetic982865 -Ref: table-numeric-ranges986631 -Ref: table-floating-point-ranges987125 -Ref: Computer Arithmetic-Footnote-1987784 -Node: Math Definitions987841 -Ref: table-ieee-formats990817 -Node: MPFR features991385 -Node: FP Math Caution993103 -Ref: FP Math Caution-Footnote-1994175 -Node: Inexactness of computations994544 -Node: Inexact representation995575 -Node: Comparing FP Values996935 -Node: Errors accumulate998176 -Node: Strange values999632 -Ref: Strange values-Footnote-11002220 -Node: Getting Accuracy1002325 -Node: Try To Round1005035 -Node: Setting precision1005934 -Ref: table-predefined-precision-strings1006631 -Node: Setting the rounding mode1008462 -Ref: table-gawk-rounding-modes1008836 -Ref: Setting the rounding mode-Footnote-11012768 -Node: Arbitrary Precision Integers1012947 -Ref: Arbitrary Precision Integers-Footnote-11016122 -Node: Checking for MPFR1016271 -Node: POSIX Floating Point Problems1017745 -Ref: POSIX Floating Point Problems-Footnote-11022030 -Node: Floating point summary1022068 -Node: Dynamic Extensions1024258 -Node: Extension Intro1025811 -Node: Plugin License1027077 -Node: Extension Mechanism Outline1027874 -Ref: figure-load-extension1028313 -Ref: figure-register-new-function1029879 -Ref: figure-call-new-function1030972 -Node: Extension API Description1033035 -Node: Extension API Functions Introduction1034748 -Ref: table-api-std-headers1036584 -Node: General Data Types1040834 -Ref: General Data Types-Footnote-11049540 -Node: Memory Allocation Functions1049839 -Ref: Memory Allocation Functions-Footnote-11054340 -Node: Constructor Functions1054439 -Node: API Ownership of MPFR and GMP Values1058092 -Node: Registration Functions1059405 -Node: Extension Functions1060105 -Node: Exit Callback Functions1065427 -Node: Extension Version String1066677 -Node: Input Parsers1067340 -Node: Output Wrappers1080061 -Node: Two-way processors1084573 -Node: Printing Messages1086838 -Ref: Printing Messages-Footnote-11088009 -Node: Updating ERRNO1088162 -Node: Requesting Values1088901 -Ref: table-value-types-returned1089638 -Node: Accessing Parameters1090747 -Node: Symbol Table Access1091984 -Node: Symbol table by name1092496 -Ref: Symbol table by name-Footnote-11095521 -Node: Symbol table by cookie1095649 -Ref: Symbol table by cookie-Footnote-11099834 -Node: Cached values1099898 -Ref: Cached values-Footnote-11103434 -Node: Array Manipulation1103587 -Ref: Array Manipulation-Footnote-11104678 -Node: Array Data Types1104715 -Ref: Array Data Types-Footnote-11107373 -Node: Array Functions1107465 -Node: Flattening Arrays1111963 -Node: Creating Arrays1118939 -Node: Redirection API1123706 -Node: Extension API Variables1126539 -Node: Extension Versioning1127250 -Ref: gawk-api-version1127679 -Node: Extension GMP/MPFR Versioning1129411 -Node: Extension API Informational Variables1131039 -Node: Extension API Boilerplate1132112 -Node: Changes from API V11136086 -Node: Finding Extensions1137658 -Node: Extension Example1138217 -Node: Internal File Description1139015 -Node: Internal File Ops1143095 -Ref: Internal File Ops-Footnote-11154445 -Node: Using Internal File Ops1154585 -Ref: Using Internal File Ops-Footnote-11156968 -Node: Extension Samples1157242 -Node: Extension Sample File Functions1158771 -Node: Extension Sample Fnmatch1166420 -Node: Extension Sample Fork1167907 -Node: Extension Sample Inplace1169125 -Node: Extension Sample Ord1172751 -Node: Extension Sample Readdir1173587 -Ref: table-readdir-file-types1174476 -Node: Extension Sample Revout1175544 -Node: Extension Sample Rev2way1176133 -Node: Extension Sample Read write array1176873 -Node: Extension Sample Readfile1178815 -Node: Extension Sample Time1179910 -Node: Extension Sample API Tests1181662 -Node: gawkextlib1182154 -Node: Extension summary1185072 -Node: Extension Exercises1188774 -Node: Language History1190016 -Node: V7/SVR3.11191672 -Node: SVR41193824 -Node: POSIX1195258 -Node: BTL1196639 -Node: POSIX/GNU1197368 -Node: Feature History1203146 -Node: Common Extensions1220321 -Node: Ranges and Locales1221604 -Ref: Ranges and Locales-Footnote-11226220 -Ref: Ranges and Locales-Footnote-21226247 -Ref: Ranges and Locales-Footnote-31226482 -Node: Contributors1226705 -Node: History summary1232702 -Node: Installation1234082 -Node: Gawk Distribution1235026 -Node: Getting1235510 -Node: Extracting1236473 -Node: Distribution contents1238111 -Node: Unix Installation1245172 -Node: Quick Installation1245976 -Node: Compiling with MPFR1248396 -Node: Shell Startup Files1249086 -Node: Additional Configuration Options1250175 -Node: Configuration Philosophy1252490 -Node: Compiling from Git1254886 -Node: Building the Documentation1255441 -Node: Non-Unix Installation1256825 -Node: PC Installation1257285 -Node: PC Binary Installation1258123 -Node: PC Compiling1258558 -Node: PC Using1259675 -Node: Cygwin1263228 -Node: MSYS1264452 -Node: VMS Installation1265054 -Node: VMS Compilation1265773 -Ref: VMS Compilation-Footnote-11267002 -Node: VMS Dynamic Extensions1267060 -Node: VMS Installation Details1268745 -Node: VMS Running1271007 -Node: VMS GNV1275286 -Node: Bugs1276000 -Node: Bug definition1276912 -Node: Bug address1279848 -Node: Usenet1283236 -Node: Performance bugs1284425 -Node: Asking for help1287346 -Node: Maintainers1289313 -Node: Other Versions1290507 -Node: Installation summary1298359 -Node: Notes1299723 -Node: Compatibility Mode1300517 -Node: Additions1301299 -Node: Accessing The Source1302224 -Node: Adding Code1303661 -Node: New Ports1309853 -Node: Derived Files1314228 -Ref: Derived Files-Footnote-11319888 -Ref: Derived Files-Footnote-21319923 -Ref: Derived Files-Footnote-31320521 -Node: Future Extensions1320635 -Node: Implementation Limitations1321293 -Node: Extension Design1322503 -Node: Old Extension Problems1323647 -Ref: Old Extension Problems-Footnote-11325165 -Node: Extension New Mechanism Goals1325222 -Ref: Extension New Mechanism Goals-Footnote-11328586 -Node: Extension Other Design Decisions1328775 -Node: Extension Future Growth1330888 -Node: Notes summary1331494 -Node: Basic Concepts1332652 -Node: Basic High Level1333333 -Ref: figure-general-flow1333615 -Ref: figure-process-flow1334301 -Ref: Basic High Level-Footnote-11337603 -Node: Basic Data Typing1337788 -Node: Glossary1341116 -Node: Copying1373003 -Node: GNU Free Documentation License1410546 -Node: Index1435666 +Ref: Getopt Function-Footnote-1713685 +Node: Passwd Functions713885 +Ref: Passwd Functions-Footnote-1722724 +Node: Group Functions722812 +Ref: Group Functions-Footnote-1730710 +Node: Walking Arrays730917 +Node: Library Functions Summary733925 +Node: Library Exercises735331 +Node: Sample Programs735796 +Node: Running Examples736566 +Node: Clones737294 +Node: Cut Program738518 +Node: Egrep Program748658 +Node: Id Program757659 +Node: Split Program767594 +Ref: Split Program-Footnote-1777487 +Node: Tee Program777660 +Node: Uniq Program780450 +Node: Wc Program788038 +Node: Bytes vs. Characters788425 +Node: Using extensions789973 +Node: wc program790727 +Node: Miscellaneous Programs795592 +Node: Dupword Program796805 +Node: Alarm Program798835 +Node: Translate Program803690 +Ref: Translate Program-Footnote-1808255 +Node: Labels Program808525 +Ref: Labels Program-Footnote-1811876 +Node: Word Sorting811960 +Node: History Sorting816032 +Node: Extract Program818257 +Node: Simple Sed826270 +Node: Igawk Program829344 +Ref: Igawk Program-Footnote-1843675 +Ref: Igawk Program-Footnote-2843877 +Ref: Igawk Program-Footnote-3843999 +Node: Anagram Program844114 +Node: Signature Program847176 +Node: Programs Summary848423 +Node: Programs Exercises849637 +Ref: Programs Exercises-Footnote-1853767 +Node: Advanced Features853853 +Node: Nondecimal Data855984 +Node: Boolean Typed Values857582 +Node: Array Sorting859463 +Node: Controlling Array Traversal860168 +Ref: Controlling Array Traversal-Footnote-1868536 +Node: Array Sorting Functions868654 +Ref: Array Sorting Functions-Footnote-1874028 +Node: Two-way I/O874224 +Ref: Two-way I/O-Footnote-1881950 +Ref: Two-way I/O-Footnote-2882137 +Node: TCP/IP Networking882219 +Node: Profiling885295 +Node: Extension Philosophy894604 +Node: Advanced Features Summary896083 +Node: Internationalization898098 +Node: I18N and L10N899772 +Node: Explaining gettext900459 +Ref: Explaining gettext-Footnote-1906351 +Ref: Explaining gettext-Footnote-2906536 +Node: Programmer i18n906701 +Ref: Programmer i18n-Footnote-1911650 +Node: Translator i18n911699 +Node: String Extraction912493 +Ref: String Extraction-Footnote-1913625 +Node: Printf Ordering913711 +Ref: Printf Ordering-Footnote-1916497 +Node: I18N Portability916561 +Ref: I18N Portability-Footnote-1919017 +Node: I18N Example919080 +Ref: I18N Example-Footnote-1922355 +Ref: I18N Example-Footnote-2922428 +Node: Gawk I18N922537 +Node: I18N Summary923159 +Node: Debugger924500 +Node: Debugging925500 +Node: Debugging Concepts925941 +Node: Debugging Terms927750 +Node: Awk Debugging930325 +Ref: Awk Debugging-Footnote-1931270 +Node: Sample Debugging Session931402 +Node: Debugger Invocation931936 +Node: Finding The Bug933322 +Node: List of Debugger Commands939796 +Node: Breakpoint Control941129 +Node: Debugger Execution Control944823 +Node: Viewing And Changing Data948185 +Node: Execution Stack951726 +Node: Debugger Info953363 +Node: Miscellaneous Debugger Commands957434 +Node: Readline Support962496 +Node: Limitations963392 +Node: Debugging Summary965946 +Node: Namespaces967225 +Node: Global Namespace968336 +Node: Qualified Names969734 +Node: Default Namespace970733 +Node: Changing The Namespace971474 +Node: Naming Rules973088 +Node: Internal Name Management974936 +Node: Namespace Example975978 +Node: Namespace And Features978540 +Node: Namespace Summary979975 +Node: Arbitrary Precision Arithmetic981452 +Node: Computer Arithmetic982939 +Ref: table-numeric-ranges986705 +Ref: table-floating-point-ranges987199 +Ref: Computer Arithmetic-Footnote-1987858 +Node: Math Definitions987915 +Ref: table-ieee-formats990891 +Node: MPFR features991459 +Node: FP Math Caution993177 +Ref: FP Math Caution-Footnote-1994249 +Node: Inexactness of computations994618 +Node: Inexact representation995649 +Node: Comparing FP Values997009 +Node: Errors accumulate998250 +Node: Strange values999706 +Ref: Strange values-Footnote-11002294 +Node: Getting Accuracy1002399 +Node: Try To Round1005109 +Node: Setting precision1006008 +Ref: table-predefined-precision-strings1006705 +Node: Setting the rounding mode1008536 +Ref: table-gawk-rounding-modes1008910 +Ref: Setting the rounding mode-Footnote-11012842 +Node: Arbitrary Precision Integers1013021 +Ref: Arbitrary Precision Integers-Footnote-11016196 +Node: Checking for MPFR1016345 +Node: POSIX Floating Point Problems1017819 +Ref: POSIX Floating Point Problems-Footnote-11022104 +Node: Floating point summary1022142 +Node: Dynamic Extensions1024332 +Node: Extension Intro1025885 +Node: Plugin License1027151 +Node: Extension Mechanism Outline1027948 +Ref: figure-load-extension1028387 +Ref: figure-register-new-function1029953 +Ref: figure-call-new-function1031046 +Node: Extension API Description1033109 +Node: Extension API Functions Introduction1034822 +Ref: table-api-std-headers1036658 +Node: General Data Types1040908 +Ref: General Data Types-Footnote-11049614 +Node: Memory Allocation Functions1049913 +Ref: Memory Allocation Functions-Footnote-11054414 +Node: Constructor Functions1054513 +Node: API Ownership of MPFR and GMP Values1058166 +Node: Registration Functions1059479 +Node: Extension Functions1060179 +Node: Exit Callback Functions1065501 +Node: Extension Version String1066751 +Node: Input Parsers1067414 +Node: Output Wrappers1080135 +Node: Two-way processors1084647 +Node: Printing Messages1086912 +Ref: Printing Messages-Footnote-11088083 +Node: Updating ERRNO1088236 +Node: Requesting Values1088975 +Ref: table-value-types-returned1089712 +Node: Accessing Parameters1090821 +Node: Symbol Table Access1092058 +Node: Symbol table by name1092570 +Ref: Symbol table by name-Footnote-11095595 +Node: Symbol table by cookie1095723 +Ref: Symbol table by cookie-Footnote-11099908 +Node: Cached values1099972 +Ref: Cached values-Footnote-11103508 +Node: Array Manipulation1103661 +Ref: Array Manipulation-Footnote-11104752 +Node: Array Data Types1104789 +Ref: Array Data Types-Footnote-11107447 +Node: Array Functions1107539 +Node: Flattening Arrays1112037 +Node: Creating Arrays1119013 +Node: Redirection API1123780 +Node: Extension API Variables1126613 +Node: Extension Versioning1127324 +Ref: gawk-api-version1127753 +Node: Extension GMP/MPFR Versioning1129485 +Node: Extension API Informational Variables1131113 +Node: Extension API Boilerplate1132186 +Node: Changes from API V11136160 +Node: Finding Extensions1137732 +Node: Extension Example1138291 +Node: Internal File Description1139089 +Node: Internal File Ops1143169 +Ref: Internal File Ops-Footnote-11154519 +Node: Using Internal File Ops1154659 +Ref: Using Internal File Ops-Footnote-11157042 +Node: Extension Samples1157316 +Node: Extension Sample File Functions1158845 +Node: Extension Sample Fnmatch1166494 +Node: Extension Sample Fork1167981 +Node: Extension Sample Inplace1169199 +Node: Extension Sample Ord1172825 +Node: Extension Sample Readdir1173661 +Ref: table-readdir-file-types1174550 +Node: Extension Sample Revout1175618 +Node: Extension Sample Rev2way1176207 +Node: Extension Sample Read write array1176947 +Node: Extension Sample Readfile1178889 +Node: Extension Sample Time1179984 +Node: Extension Sample API Tests1181736 +Node: gawkextlib1182228 +Node: Extension summary1185146 +Node: Extension Exercises1188848 +Node: Language History1190090 +Node: V7/SVR3.11191746 +Node: SVR41193898 +Node: POSIX1195332 +Node: BTL1196713 +Node: POSIX/GNU1197442 +Node: Feature History1203220 +Node: Common Extensions1220395 +Node: Ranges and Locales1221678 +Ref: Ranges and Locales-Footnote-11226294 +Ref: Ranges and Locales-Footnote-21226321 +Ref: Ranges and Locales-Footnote-31226556 +Node: Contributors1226779 +Node: History summary1232776 +Node: Installation1234156 +Node: Gawk Distribution1235100 +Node: Getting1235584 +Node: Extracting1236547 +Node: Distribution contents1238185 +Node: Unix Installation1245246 +Node: Quick Installation1246050 +Node: Compiling with MPFR1248470 +Node: Shell Startup Files1249160 +Node: Additional Configuration Options1250249 +Node: Configuration Philosophy1252564 +Node: Compiling from Git1254960 +Node: Building the Documentation1255515 +Node: Non-Unix Installation1256899 +Node: PC Installation1257359 +Node: PC Binary Installation1258197 +Node: PC Compiling1258632 +Node: PC Using1259749 +Node: Cygwin1263302 +Node: MSYS1264526 +Node: VMS Installation1265128 +Node: VMS Compilation1265847 +Ref: VMS Compilation-Footnote-11267076 +Node: VMS Dynamic Extensions1267134 +Node: VMS Installation Details1268819 +Node: VMS Running1271081 +Node: VMS GNV1275360 +Node: Bugs1276074 +Node: Bug definition1276986 +Node: Bug address1279922 +Node: Usenet1283310 +Node: Performance bugs1284499 +Node: Asking for help1287420 +Node: Maintainers1289387 +Node: Other Versions1290581 +Node: Installation summary1298433 +Node: Notes1299797 +Node: Compatibility Mode1300591 +Node: Additions1301373 +Node: Accessing The Source1302298 +Node: Adding Code1303735 +Node: New Ports1309927 +Node: Derived Files1314302 +Ref: Derived Files-Footnote-11319962 +Ref: Derived Files-Footnote-21319997 +Ref: Derived Files-Footnote-31320595 +Node: Future Extensions1320709 +Node: Implementation Limitations1321367 +Node: Extension Design1322577 +Node: Old Extension Problems1323721 +Ref: Old Extension Problems-Footnote-11325239 +Node: Extension New Mechanism Goals1325296 +Ref: Extension New Mechanism Goals-Footnote-11328660 +Node: Extension Other Design Decisions1328849 +Node: Extension Future Growth1330962 +Node: Notes summary1331568 +Node: Basic Concepts1332726 +Node: Basic High Level1333407 +Ref: figure-general-flow1333689 +Ref: figure-process-flow1334375 +Ref: Basic High Level-Footnote-11337677 +Node: Basic Data Typing1337862 +Node: Glossary1341190 +Node: Copying1373077 +Node: GNU Free Documentation License1410620 +Node: Index1435740 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index d6ef9353..4ef3266c 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -23997,9 +23997,11 @@ As a side point, @command{gawk} actually uses the GNU @code{getopt_long()} function to process both normal and GNU-style long options (@pxref{Options}). +@cindex Minshall, Greg The abstraction provided by @code{getopt()} is very useful and is quite handy in @command{awk} programs as well. Following is an @command{awk} version of @code{getopt()} that accepts both short and long options. +(Support for long options was supplied by Greg Minshall. We thank him.) This function highlights one of the greatest weaknesses in @command{awk}, which is that it is very poor at diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 35a6deb2..0e621e04 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -22879,9 +22879,11 @@ As a side point, @command{gawk} actually uses the GNU @code{getopt_long()} function to process both normal and GNU-style long options (@pxref{Options}). +@cindex Minshall, Greg The abstraction provided by @code{getopt()} is very useful and is quite handy in @command{awk} programs as well. Following is an @command{awk} version of @code{getopt()} that accepts both short and long options. +(Support for long options was supplied by Greg Minshall. We thank him.) This function highlights one of the greatest weaknesses in @command{awk}, which is that it is very poor at diff --git a/pc/ChangeLog b/pc/ChangeLog index 42d32899..c0027c38 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,7 @@ +2021-11-21 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.tst: Regenerated. + 2021-11-08 Arnold D. Robbins <arnold@skeeve.com> * Makefile.tst: Regenerated. diff --git a/pc/Makefile.tst b/pc/Makefile.tst index deaded78..f76a38cf 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -211,7 +211,7 @@ GAWK_EXT_TESTS = \ regnul1 regnul2 regx8bit reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 sandbox1 shadow shadowbuiltin sortfor \ sortfor2 sortu sourcesplit split_after_fpat splitarg4 strftfld \ - strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 \ + strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 stupid5 \ switch2 symtab1 symtab10 symtab11 symtab2 symtab3 symtab4 symtab5 \ symtab6 symtab7 symtab8 symtab9 timeout typedregex1 typedregex2 \ typedregex3 typedregex4 typedregex5 typedregex6 typeof1 typeof2 \ @@ -3290,6 +3290,11 @@ stupid4: @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +stupid5: + @echo $@ + @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + switch2: @echo $@ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/ChangeLog b/test/ChangeLog index 5832fa95..1a7b9175 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2021-11-21 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): stupid5, new test. + * stupid5.awk, stupid5.ok: New files. + * stupid3.ok, stupid4.ok: Updated after code changes. + 2021-11-18 Arnold D. Robbins <arnold@skeeve.com> * rwarray.awk: Improve test, add string and numbers. diff --git a/test/Makefile.am b/test/Makefile.am index ab8f4c73..10c5c812 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1243,6 +1243,8 @@ EXTRA_DIST = \ stupid3.ok \ stupid4.awk \ stupid4.ok \ + stupid5.awk \ + stupid5.ok \ subamp.awk \ subamp.in \ subamp.ok \ @@ -1462,7 +1464,7 @@ GAWK_EXT_TESTS = \ regnul1 regnul2 regx8bit reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 sandbox1 shadow shadowbuiltin sortfor \ sortfor2 sortu sourcesplit split_after_fpat splitarg4 strftfld \ - strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 \ + strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 stupid5 \ switch2 symtab1 symtab10 symtab11 symtab2 symtab3 symtab4 symtab5 \ symtab6 symtab7 symtab8 symtab9 timeout typedregex1 typedregex2 \ typedregex3 typedregex4 typedregex5 typedregex6 typeof1 typeof2 \ diff --git a/test/Makefile.in b/test/Makefile.in index 63671075..6144e749 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1509,6 +1509,8 @@ EXTRA_DIST = \ stupid3.ok \ stupid4.awk \ stupid4.ok \ + stupid5.awk \ + stupid5.ok \ subamp.awk \ subamp.in \ subamp.ok \ @@ -1728,7 +1730,7 @@ GAWK_EXT_TESTS = \ regnul1 regnul2 regx8bit reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 sandbox1 shadow shadowbuiltin sortfor \ sortfor2 sortu sourcesplit split_after_fpat splitarg4 strftfld \ - strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 \ + strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 stupid5 \ switch2 symtab1 symtab10 symtab11 symtab2 symtab3 symtab4 symtab5 \ symtab6 symtab7 symtab8 symtab9 timeout typedregex1 typedregex2 \ typedregex3 typedregex4 typedregex5 typedregex6 typeof1 typeof2 \ @@ -4965,6 +4967,11 @@ stupid4: @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +stupid5: + @echo $@ + @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + switch2: @echo $@ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 36f4dc2b..f080c29f 100644 --- a/test/Maketests +++ b/test/Maketests @@ -2027,6 +2027,11 @@ stupid4: @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +stupid5: + @echo $@ + @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + switch2: @echo $@ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/stupid3.ok b/test/stupid3.ok index 11beb6c9..b647c089 100644 --- a/test/stupid3.ok +++ b/test/stupid3.ok @@ -1,2 +1,2 @@ TYPEOF: untyped -TYPEOF: untyped +TYPEOF: unassigned diff --git a/test/stupid4.ok b/test/stupid4.ok index 1271dad1..42380a42 100644 --- a/test/stupid4.ok +++ b/test/stupid4.ok @@ -1,2 +1,2 @@ untyped -untyped +unassigned diff --git a/test/stupid5.awk b/test/stupid5.awk new file mode 100644 index 00000000..e4c0187a --- /dev/null +++ b/test/stupid5.awk @@ -0,0 +1,9 @@ +BEGIN { + print typeof(x) + f(x) +} + +function f(x) { + y = x + print typeof(x) +} diff --git a/test/stupid5.ok b/test/stupid5.ok new file mode 100644 index 00000000..42380a42 --- /dev/null +++ b/test/stupid5.ok @@ -0,0 +1,2 @@ +untyped +unassigned |