-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog.1
8920 lines (6442 loc) · 329 KB
/
ChangeLog.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2019-04-12 Arnold D. Robbins <[email protected]>
* README: Updated in preparation for a release.
2019-04-07 Arnold D. Robbins <[email protected]>
* config.sub: Updated from GNULIB.
2019-04-05 Arnold D. Robbins <[email protected]>
* eval.c (load_casetable): Always use the locale's settings.
(set_IGNORECASE): Don't call load_casetable.
* main.c (main): Call load_casetable if in a single-byte locale.
2019-03-22 Arnold D. Robbins <[email protected]>
* config.guess: Updated from GNULIB.
2019-03-17 Arnold D. Robbins <[email protected]>
* configure.ac: Fix test for ZOS_FAIL.
2019-03-15 Arnold D. Robbins <[email protected]>
* Makefile.am (pc/Makefile.tst): Yet another fix for out-
of-tree builds. Thanks to `make distcheck'.
* configure.ac: Update version for next tar ball.
2019-03-03 Arnold D. Robbins <[email protected]>
* main.c (usage): Fix help message.
2019-03-01 Arnold D. Robbins <[email protected]>
* Makefile.am (pc/Makefile.tst): Make sure pc/ directory exists
first. Needed for `make distcheck'. Not sure what changed such
that this is only showing up now.
* configure.ac: Update version for next test tarball.
2019-02-28 Arnold D. Robbins <[email protected]>
* README.cvs: Removed. Six years is long enough.
2019-02-25 Arnold D. Robbins <[email protected]>
* config.guess: Updated from GNULIB.
2019-02-25 Arnold D. Robbins <[email protected]>
* NEWS: Updated.
2019-02-25 Arnold D. Robbins <[email protected]>
Small profiling improvements. Suggested by mukti
* main.c (parse_args): Add warnings that --profile overrides
--pretty-print.
(main): Move setuid warning to after all the warnings for conflicting
arguments.
* profile.c (pprint): Don't print extra trailing space after return
and exit if no value associated with the statement.
2019-02-25 Arnold D. Robbins <[email protected]>
* configure.ac: Set ZOS_FAIL if on ZOS to improve test suite on that
platform.
* awk.h (is_valid_identifier): Move declaration outside ifdef DYNAMIC.
* command.y: Fix test for EBCDIC to use USE_EBCDIC.
* custom.h: Remove definitions of __builtin_expect.
* eval.c (update_ERRNO_string): Add untested and disabled code for z/OS
to remove leading IBM error codes. This might one day make more of the
tests pass on z/OS.
2019-02-20 Arnold D. Robbins <[email protected]>
* awk.h (is_valid_identifier): Move declaration outside of
`#if DYNAMIC'. Thanks to Daniel Richard G.
* custom.h (builtin_expect): Remove definitions, now
handled by support/cdefs.h.
2019-02-17 Arnold D. Robbins <[email protected]>
Fix debugger eval command so that return from a called
user-defined function works. Thanks to Lothar Langer
<[email protected]> for the report.
* awk.h (Op_K_return_from_eval): New opcode.
(parse_program): Add boolean second parameter, `from_eval'.
* awkgram.y (called_from_eval): New variable
(Grammar): Check it for return statements. If true, change the
opcode to Op_K_return_from_eval.
(parse_program): Set called_from_eval to value of from_eval parameter.
* debug.c (pre_execute_code): Change test for Op_K_return to test
for Op_K_return_from_eval.
(do_eval): Call parse_program with second parameter true.
* eval.c (optypetab): Add entry for Op_K_return_from_eval.
* interpret.h (r_interpret): Ditto: can't-happen error.
* main.c (main): Call parse_program with second parameter false.
* NEWS: Updated.
2019-02-15 Arnold D. Robbins <[email protected]>
* awkgram.y: If profiling, correctly turn `print' into `print $0'.
Thanks to Hermann Peifer for the bug report.
* TODO: Updated.
2019-02-11 Arnold D. Robbins <[email protected]>
* configure.ac: Update version for next test tarball.
2019-02-07 Arnold D. Robbins <[email protected]>
* NEWS: Updated.
* config.guess, config.rpath, config.sub: Updated from GNULIB.
2019-02-05 Arnold D. Robbins <[email protected]>
* Makefile.am (EXTRA_DIST): Add NEWS.1.
2019-02-04 Arnold D. Robbins <[email protected]>
* NEWS.1: Rotated in from NEWS.
* NEWS: Shortened to start over again with 5.0 changes.
* ext.c (is_valid_identifier): Move outside of ifdefs so that
DJGPP (and other code) can find it.
2019-02-03 Arnold D. Robbins <[email protected]>
* awkgram.y (snode): Disallow @/.../ as second param of index, also.
* TODO: Updated.
2019-02-02 Arnold D. Robbins <[email protected]>
* awkgram.c, command.c: Regenerated with Bison 3.3.
* NEWS: Updated.
2019-02-02 Eli Zaretskii <[email protected]>
* debug.c (execvp) [__MINGW32__]: Redirect to w32_execvp.
(restart): No need for MinGW-specific code anymore.
* nonposix.h: If setlocale is already a defined macro, #undef it
before redefining. This avoids compilation warnings if someone
tries to compile Gawk with Gettext's libintl.h, which redirects
setlocale to its own function.
Reported by Budi <[email protected]>.
* debug.c [__MINGW32__]: Prototype for w32_execvp.
(restart) [__MINGW32__]: Call w32_execvp instead of execvp. Don't
type-cast d_argv anymore.
2019-01-27 Arnold D. Robbins <[email protected]>
* awkgram.y (qualify_name): Return duplicated strings.
(yylex): Qualify names before returning either NAME or FUNC_CALL.
(Grammar): Replace qualified_name non-token with NAME, remove
`qualified_name' production.
2019-01-27 Arnold D. Robbins <[email protected]>
* Makefile.am, NEWS, awkgram.y, cint_array.c, custom.h, debug.c,
eval.c, ext.c, gawkapi.c, int_array.c, interpret.h, nonposix.h,
profile.c, re.c, replace.c, str_array.c, symbol.c: Update
copyright year.
2019-01-26 Arnold D. Robbins <[email protected]>
* Makefile.am (pc/Makefile.tst): Fix to work for out of tree builds.
2019-01-25 Arnold D. Robbins <[email protected]>
* main.c (UPDATE_YEAR): Bump to 2019.
(usage): Revise help message a little bit.
* configure.ac: Bump version to start a release spiral.
* NEWS: Updated.
2019-01-24 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): Add new production `qualified_name' which
is NAME + qualification call. Use it everywhere that NAME was
used, except for function parameters.
2019-01-23 Arnold D. Robbins <[email protected]>
* profile.c (adjust_namespace): Check for all upper case
identifiers so we don't get things like awk::NF.
2019-01-23 Arnold D. Robbins <[email protected]>
* symbol.c (lookup): Remove second `do_qualify' parameter.
Remove calls to `fix_up_namespace'. If name starts with
"awk::" just lookup the compnent name.
Adjust all calls to `lookup' in other files.
(install): Don't use `fix_up_namespace'.
(fix_up_namespace): Remove function.
* awk.h (lookup): Adjust declaration.
2019-01-23 Arnold D. Robbins <[email protected]>
* awkgram.y (qualify_name): Don't qualify a name if it's
a parameter.
2019-01-21 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): Use qualify_name for array subscript
expressions. Fixes the last leak in the test suite.
* awk.h (is_all_upper): Declare.
* symbol.c (is_all_upper): Remove static.
* awkgram.y (is_all_upper): Remove.
(Grammar): Clean up `#if 0' code.
2019-01-20 Arnold D. Robbins <[email protected]>
Restore functionality.
* awkgram.y (qualify_name): Remove `is_var' param, always check
for all upper case. Adjust all calls.
(Grammar): Do qualify_name for function calls also.
2019-01-19 Arnold D. Robbins <[email protected]>
Continue fixing memory leaks.
* awk.h (set_current_namespace): Declare function.
* awkgram.y: Change all assignments of current_namespace to calls
to set_current_namespace.
(is_all_upper, qualify_name): New functions.
(in_function): Change type to bool, and fix usages.
(Grammar): Use qualify_name on variables and function names.
* main.c: Change all assignments of current_namespace to calls
to set_current_namespace.
(set_current_namespace): New function.
* profile.c (pp_namespace): Don't free old current_namespace. Add
comment explaining why.
2019-01-18 Arnold D. Robbins <[email protected]>
Start fixing memory leaks related to namespaces.
* awkgram.y (Grammar): At simple_variable -> NAME, qualify names
before lookup/install.
(next_sourcefile): Check if need to free current_namespace before
assigning to it.
(yylex): Fix length of string to be dup'ed before returning
NAME or FUNC_CALL.
(set_namespace): Always free ns->lextok, adjust memory allocations
appropriately.
* main.c (main): Check if need to free current_namespace before
assigning to it.
* profile.c (pp_namespace): Ditto. (This may not be necessary.)
2019-01-18 Arnold D. Robbins <[email protected]>
* debug.c (do_set_var): Add comments before calls to assoc_set.
* interpret.h (r_interpret): For Op_sub_array, deref the subscript
appropriately. Thanks to Andy Schorr for the catch.
2019-01-15 Arnold D. Robbins <[email protected]>
* array.c (asort_actual): Use assoc_set in 2 places.
* awk.h (assoc_set): Improve leading comment.
* debug.c (do_set_var): Use assoc_set in 2 places.
* field.c (set_element, update_PROCINFO_str, update_PROCINFO_num):
Use assoc_set in each.
* gawkapi.c (api_set_array_element): Use assoc_set.
* interpret.h (r_interpret): Use assoc_set.
* main.c (init_args, load_environ, load_procinfo_argv):
Use assoc_set in each.
* mpfr.c (do_mpfr_intdiv): Use assoc_set in 2 places.
* str_array.c (str_lookup): Fix leading comment.
* symbol.c (install): Use assoc_set.
2019-01-15 Andrew J. Schorr <[email protected]>
* builtin.c (do_match, do_intdiv): Remove unused `sub' and `lhs'
variables, since assoc_set is now doing all of the work.
2019-01-15 Andrew J. Schorr <[email protected]>
* awk.h (assoc_set): Move the definition lower down because it
needs to be after unref is declared.
* builtin.c (do_match): Use assoc_set in 3 places.
(do_intdiv): Use assoc_set in 2 places.
(do_typeof): Use assoc_set in 2 places.
2019-01-14 Andrew J. Schorr <[email protected]>
* awk.h (assoc_set): Add new inline function to set an array element
to eliminate code duplication and reduce the chance of memory leaks.
2019-01-14 Andrew J. Schorr <[email protected]>
* builtin.c (do_typeof): Fix memory leak when populating the
optional array, and make sure to call the astore method.
2019-01-14 Arnold D. Robbins <[email protected]>
* builtin.c (do_intdiv): Add unref of subscripts.
* mpfr.c (do_mpfr_intdiv): Ditto.
Thanks to Andy Schorr for noticing.
2019-01-09 Andrew J. Schorr <[email protected]>
* awkgram.y (tokentab): Indicate that typeof may take 2 arguments.
(snode): Add support for typeof's optional 2nd array argument.
* builtin.c (do_typeof): Add support for optional 2nd array arg,
returning flag info for scalars and backend array type for arrays.
2019-01-09 John E. Malmberg <[email protected]>
* awk.h: For non GCC, have __attribute__ definition match
support/regex_internal.h exactly.
2019-01-08 Arnold D. Robbins <[email protected]>
* interpret.h (r_interpret): For a translatable string, only copy
the gettext return value if it's different from the original.
Otherwise, use the original.
2019-01-07 Andrew J. Schorr <[email protected]>
Use a struct instead of an array to contain the array methods
for improved code clarity and flexibility.
* awk.h (array_funcs_t): Define new struct to contain the array
methods.
(NODE): Change type of array_funcs (sub.nodep.l.lp) from `afunc_t *'
to `const array_funcs_t *' (from a pointer to an array of function
methods to a pointer to a struct containing the methods).
(a*_ind): Remove obsolete method array index defines.
(a*): Redefine array methods to use struct members instead of
array elements.
(str_array_func, cint_array_func, int_array_func): Change type
from array of afunc_t to 'const array_funcs_t'.
(register_array_func): Remove global declaration, since this function
is called only inside array.c.
* array.c (null_array_func): Change from array of methods to a struct.
(array_types): Now an array of pointers to array_funcs_t.
(AFUNC): Remove obsolete macro.
(register_array_func): Change scope to static, and change argument
to a pointer to array_funcs_t instead of a pointer to an array of
methods.
(array_init): Modify calls to register_array_func to pass the address
of the new array method structs.
(make_array): Set array_funcs to & null_array_func.
(null_lookup): Modify to use new array method structs.
(assoc_list): Update cint check to use & cint_array_func.
* str_array.c (str_array_func, env_array_func): Change from array of
methods to an array_funcs_t struct.
(env_clear, init_env_array): Set array_funcs to & env_array_func.
* int_array.c (int_array_func): Change from array of methods to an
array_funcs_t struct.
* cint_array.c (cint_array_func): Ditto.
(cint_lookup): When setting xn->array_funcs, must now use &.
(cint_dump): Compare xn->array_funcs to & int_array_func.
2019-01-06 Andrew J. Schorr <[email protected]>
* array.c (do_delete): If the array is now empty, reset it to the
null implementation to avoid being locked into the backend
optimization previously selected.
2019-01-06 Andrew J. Schorr <[email protected]>
Remove pointless alength macro/method that uses a needless
function call indirection to access the table_size value.
* awk.h (alength, alength_ind): Remove these defines, and also renumber
the array_funcs items after that, and use the <blah>_ind define to
define <blah> instead of repeating the hardcoded numeric value.
(NUM_AFUNCS): Remove unused define.
(assoc_length): Redefine to access table_size directly.
(null_length): Remove prototype.
* array.c (null_array_func): Remove null_length entry.
(null_length): Remove obsolete function.
* cint_array.c (cint_array_func): Remove null_length entry.
* int_array.c (int_array_func): Remove null_length entry.
* str_array.c (str_array_func, env_array_func): Remove null_length
entry.
* gawkapi.c (api_flatten_array_typed): Use the assoc_empty macro to
check for an empty array instead of comparing table_size to 0.
* symbol.c (lookup, check_param_names): Ditto.
2018-12-31 Arnold D. Robbins <[email protected]>
Clean up namespace handling for the profiler.
* awkgram.y (make_pp_namespace): Remove function, not needed.
(set_namespace): Use estrdup to save the current namespace.
* main.c (main): Before dumping the program, set current_namespace
to awk_namespace.
* profile.c (pprint): Use "awk" for comparison, not "awk::".
(pp_namespace): Just print the name in the @namespace line.
(adjust_namespace): Adjust for the fact that namespaces no longer
have the trailing "::".
2018-12-30 Arnold D. Robbins <[email protected]>
* awk.h (check_qualified_name): Remove declaration.
* awkgram.y (check_qualified_special): Renamed from
check_qualified_name and made static.
* profile.c (pprint): Improve comment on namespace list.
2018-12-21 Arnold D. Robbins <[email protected]>
* configure.ac: Remove -O only if .developing has 'debug' in it.
2018-12-18 Arnold D. Robbins <[email protected]>
* Makefile.am (distclean-local): Remove .deps directory.
2018-12-14 Arnold D. Robbins <[email protected]>
* config.guess: Updated from GNULIB.
2018-12-12 Arnold D. Robbins <[email protected]>
* TODO: Updated.
2018-12-12 Andrew J. Schorr <[email protected]>
* configure.ac (AC_CHECK_FUNCS): Check for timegm.
* builtin.c (mktime_tz): Remove function; we will use timegm instead.
(do_mktime): Replace 'mktime_tz(& then, "UTC+0")' with 'timegm(& then)'.
* protos.h (timegm): Add timegm proto on systems lacking it.
* replace.c (timegm): Include missing_d/timegm.c if needed.
2018-12-12 Arnold D. Robbins <[email protected]>
* NEWS: Updated some.
2018-12-12 Arnold D. Robbins <[email protected]>
* awk.h: Add new Op_K_namespace opcode for pretty printing.
* awkgram.y (namespace_chain): New variable, list of successive
@namespace directives seen, for the pretty printer.
(namespace_comment): Removed.
(set_namespace): Takes comment as second argument, builds the chain.
(mk_function, append_rule): Adjust to store the chain.
* debug.c (print_ns_list): New function.
(print_instruction): Adjust Op_rule and Op_func to use print_ns_list.
Add case for Op_K_namespace.
* eval.c (optable): Add entry for Op_K_namespace.
(opcode2str, op2str): Edit / add leading comments, respectively.
* profile.c (pp_namespace_list): New function.
(pprint): Adjust code to call pp_namespace_list.
2018-12-06 Arnold D. Robbins <[email protected]>
* configure.ac: Add -ggdb3 to CFLAGS if developing and remove
-O2 from Makefile, extension/Makefile, and support/Makefile.
* config.guess, config.sub: Updated from GNULIB.
2018-12-06 Arnold D. Robbins <[email protected]>
* awkgram.y (namespace_comment): New variable.
(Grammar): Handle comments after @namespace statements.
(mk_function): Add any comment onto the saved namespace.
(append_rule): Ditto.
* profile.c (pp_namespace): Add second argument for a comment.
Adjust all calls.
2018-12-02 Arnold D. Robbins <[email protected]>
* awkgram.y (mk_program): Add in leading and trailing comments
when program block is empty.
2018-11-29 Arnold D. Robbins <[email protected]>
* awkgram.y (first_rule, func_first): Remove unused variables.
(Grammar): Simplify rule for range pattern.
2018-11-28 Arnold D. Robbins <[email protected]>
* awkgram.y (debug_print_comment): New macro and function.
(load_library): Rework to not try to open the file if pretty printing.
(append_rule): Adjust handling of interblock_comment.
2018-11-27 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): In rule for function, set interblock_comment.
(mk_function): Hook interblock_comment onto fi->comment, merge it
with the existing one first, if any. Append trailing_comment.
2018-11-26 Arnold D. Robbins <[email protected]>
* main.c (platform_name): Add os390. Treat Cygwin and Mac OS X
as POSIX, per discussion with the dev team.
Unrelated:
* profile.c (print_comment): Indent for chained comment.
* awkgram.y (load_library): Return early if just pretty printing.
(yylex): Fix handling of ?: and allow_newline etc.
2018-11-25 Arnold D. Robbins <[email protected]>
* main.c (platform_name): New function returning platform name.
(load_procinfo): Use `platform_name()' to add "platform" element.
Thanks to Eli Zaretskii for the suggestion.
* NEWS: Updated with info about PROCINFO["platform"].
2018-11-25 Arnold D. Robbins <[email protected]>
* config.sub: Updated from GNULIB.
2018-11-24 Arnold D. Robbins <[email protected]>
* awkgram.y (interblock_comment, pending_comment): New variables.
(Grammar, mk_program, add_rule): Adjust to use them. Changes
handle comments at the outermost level, between blocks and functions.
2018-11-24 Arnold D. Robbins <[email protected]>
* main.c (arg_assign): Allow assigning strongly typed regexp
constants to variables on the command line and with -v.
Thanks to Peng Yu <[email protected]> for the report.
2018-11-17 Arnold D. Robbins <[email protected]>
* awkgram.c, command.c: Updated to Bison 3.2.1.
* NEWS: Updated.
* Makefile.am (pc/Makefile.tst): Make it work for out-of-tree
builds. Thanks to `make distcheck' for the report.
2018-11-17 Arnold D. Robbins <[email protected]>
* config.guess: Updated from GNULIB.
2018-11-11 Arnold D. Robbins <[email protected]>
* main.c (usage): Improve output for -Z in the help.
2018-11-11 Arnold D. Robbins <[email protected]>
* awkgram.y (outer_comment): New variable.
(Grammar): More changes. We now get the simple case of leading
and trailing comments, but not all the cases.
2018-11-11 Arnold D. Robbins <[email protected]>
* awkgram.y (trailing_comment): New variable.
(Grammar): For `action', append both trailing comments. This may
change. For `statements', append the value of `trailing_comment'
if set. At `statement := l_brace statements rbrace' save
trailing_comment from r_brace.
(make_braced_statements): Don't append the comment from r_brace
to the statement list.
2018-10-30 Arnold D. Robbins <[email protected]>
* awk.h (NODE): New field: sub.nodep.x.cmnt, holds comment for
expressions being pretty-printed.
* awkgram.y (Grammar): For expression lists, save any comment
that came after a comma in the list.
* profile.c (pp_push): Accept a fourth argument which is any
comment associated with the expression. Either it's there or
it's NULL. Save it in the pp_comment field of the node being pushed.
(tabs, tabs_len, check_indent_level): Made into static globals.
(pprint): Adjust all calls to pp_push(). Fix parenthesization
for casts in string lengthes when indenting.
(pp_list): If a popped item has a comment, include it and the
following indentation in the formatted result.
2018-10-28 Arnold D. Robbins <[email protected]>
* awkgram.y (include_source): Add second parameter to return
SRCFILE pointer.
(Grammar): For @include, save the comment for later dumping
along with the list of include files.
(make_include_comment): Removed. No longer used.
* profile.c: Update copyright year.
(print_include_list): New function.
(dump_prog): Call it.
2018-10-24 Arnold D. Robbins <[email protected]>
* main.c (usage): Improve output for -Y and add -Z in the help.
2018-10-23 Arnold D. Robbins <[email protected]>
* config.sub: Updated from GNULIB.
2018-10-20 Arnold D. Robbins <[email protected]>
* awk.h (SRCFILE): Add comment field for comments on @load statements.
* awkgram.y (include_source): Type change to boolean.
(load_library): Type change to boolean, additiona parameter to
bring the SRCFILE struct up to where we can add the comment into it.
(make_include_comment): New function. Not used yet.
(Grammar): Add comment for @load statements. Start on preserving
@include statements and their comments for eventual inclusion
into the pretty-printed code.
* profile.c (print_lib_list): Made a little smarter about printing
the header and indentation. Print the comment if there is one.
2018-10-17 Arnold D. Robbins <[email protected]>
* awk.h (commenttype): Add FOR_COMMENT.
* awkgram.y (Grammar): Handle all the opt_nls cases in
regular for statements.
* debug.c (print_instruction): Print the comments in Op_K_for.
* profile.c (pprint): Handle printing comments.
2018-10-17 Arnold D. Robbins <[email protected]>
* NEWS: Updated.
* awkgram.y (Grammar): Distinguish `print' and `print $0' in
what gets profiled / pretty-printed.
* profile.c (pprint): For case and default, add final newline
if there is no comment to print.
2018-10-16 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): Improve comment handling for many plain
statements. Improve handling for case and default.
Handle comments in `for (iggy in foo)' loops.
(yylex): After a colon, only allow newline if was part of ?:.
(merge_comments): Improve coding so we don't get two newlines
at the end of a merged comment.
* debug.c (print_instruction): Handle comments for case and default.
Simplify printing of comments.
* profile.c (pprint): Handle comments for case and default.
Remove compiler warning in Op_and/Op_or handling.
2018-10-14 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): Add comment handling for do...while.
Regularize comments about `else ...'.
* debug.c (print_instruction): Improve handling of comments for
do-while and switch, and in general.
* profile.c (pprint): Revise for do...while.
2018-10-10 Arnold D. Robbins <[email protected]>
* awkgram.y (make_braced_statements): New function.
(Grammar): Use it in the right places instead of inline code.
* debug.c (print_instruction): For Op_comment, fix type string.
* profile.c (pprint): Move tabs and tabs_len to top of function.
For Op_and and Op_or, handle comments. Use new check_indent_level
for Op_and, Op_or and Op_cond_exp.
2018-10-10 Arnold D. Robbins <[email protected]>
* debug.c (print_instruction): For Op_comment, use print_func
instead of fprintf to print the comment type.
2018-10-10 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): For statement -> { statements }, fix comment
handling. For `if' statement add comment support.
* profile.c (pp_print): Print comments associated with `if' and `else'.
2018-10-09 Arnold D. Robbins <[email protected]>
* awkgram.y (Grammar): Fix handling of empty statement (just a semi-
colon).
(merge_comments): If no chained comment and no second comment,
just return early.
2018-10-09 Arnold D. Robbins <[email protected]>
* awk.h (enum commenttype): New enum.
(NODE): Add it to sub.val.
(EOL_COMMENT, FULL_COMMENT): Replaced with above enum values.
* awkgram.y (Grammar): Finish up handling comments in function headers
and bodies. Get trailing comments at end of program
(get_comment): When doing comments, if we got EOF, push it back so that
multiple comments get merged together.
(merge_comments): Allow second parameter to be NULL.
* profile.c (pp_print): Change to use above enum everywhere. For
Op_K_print_rec produce plain `print' instead of `print $0'. Handle
comments in ?:. Handle printing function comments.
(print_comment): Simplify `after_newline' assignment. Add assertion
that chaining is only two deep.
2018-10-06 Arnold D. Robbins <[email protected]>
* awkgram.y (action): Improve handling of comments attached
to braces. Helps with function bodies.
2018-10-04 Arnold D. Robbins <[email protected]>
* awkgram.y (merge_comments): Change return type to void. Adjust calls.
(Grammar): For action, pull comments out of braces and stick
into the list. For function_prologue, get comments from parameters
and ending newline, merge, and save. Wherever nls and opt_nls
are used, be sure to pass their values up via $$. For various
cases that can be empty, explicitly set $$ = NULL.
* profile.c (pprint): Get switch working. Get ?: working.
(print_comment): Print any chained comment.
(pp_func): Start revising.
2018-10-03 Arnold D. Robbins <[email protected]>
* awkgram.y: Range expressions, enable comment stuff.
Switch statement: start on comment handling.
2018-10-01 Nelson H.F. Beebe <[email protected]>
* custom.h (__builtin_expect): Define for non-GNU compilers.
2018-09-27 Andrew J. Schorr <[email protected]>
* mpfr.c (force_mpnum): Check that base is 10 also before
computing MPG integer. Found based on bug report from
Luu Vinh Phuc <[email protected]>.
2018-09-26 Arnold D. Robbins <[email protected]>
Add more lint checks.
* awk.h (POP_ARRAY): Add boolean parameter to check for untyped
value and include lint warning.
* interpret.h (r_interpret): Adjust all calls to POP_ARRAY.
* field.c (do_split): Improve lint warning text for empty
third argument.
* re.c (make_regexp): Add lint check for '\0' in contents of
regexp to be matched (dynamic or otherwise).
2018-09-23 Steven Packard <[email protected]>
* awk.h: Add `#if !defined(__SUNPRO_C)' around check for non-ANSI
compilers. Needed for some Solaris systems.
2018-09-21 Arnold D. Robbins <[email protected]>
* awk.h (INSTRUCTION): Add comment field to carry
comment around during parsing.
* awkgram.y (merge_comments): New function.
(split_comment, check_comment, comment, prior_comment,
comment_to_save, program_comment, function_comment,
block_comment): Removed.
(grammar): Remove old code and start passing the comment
up via yylval and the newlines in the grammar.
2018-09-21 Arnold D. Robbins <[email protected]>
* awkgram.y: Undo change of 2016-11-28 to make switch
head a separate production, in preparation for revamping
comment handling.
2018-09-21 Arnold D. Robbins <[email protected]>
* re.c (make_regexp): Handle backslash at end of
input string. Thanks to Anatoly Trosinenko
<[email protected]> for the report.
Also, improve the error message when compilation of
the regexp fails.
2018-09-21 Arnold D. Robbins <[email protected]>
* io.c (fork_and_open_slave_pty): Move an errant close brace
inside the #endif so that gawk will compile on AIX. Thanks to
Fredrik Laurin <[email protected]> for the report.
2018-09-18 Arnold D. Robbins <[email protected]>
* NEWS: Fix typo in gettext version.
Unrelated:
* field.c (get_field): Move lint check for field access in an
END rule to top level, make wording more general.
* builtin.c (do_print_rec): Restore check before calling get_field()
and add do_lint to the condition.
Unrelated:
* field.c (set_NF): Add lint warning if decrementing NF, which
doesn't work on older Unix awks.
Unrelated:
* config.rpath: Sync to GNULIB.
2018-09-16 gettextize <[email protected]>
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8.
* ABOUT-NLS, config.rpath: Updated by gettext 0.19.8.1.
2018-09-16 Arnold D. Robbins <[email protected]>
* field.c (get_field): Add lint check if accessing $0 inside
an END rule, print a "may not be portable" warning.
* builtin.c (do_print_rec): Call get_field() unconditionally
in order to do lint check.
Unrelated:
* awkgram.c, command.c: Updated to Bison 3.1.
* NEWS: Updated.
Unrelated:
* Makefile.in, aclocal.m4, configure: Regenerated, using
Automake 1.16.1.
Unrelated:
* gettext.h: Synced with that from Gettext 0.19.8.1.
2018-09-14 Adrian Bunk <[email protected]>
* awk.h (init_debug, debug_prog): Move prototypes to here from ...
* main.c: ... here.
Thanks to Michael Tautschnig for noticing the type mismatch.
2018-09-07 Arnold D. Robbins <[email protected]>
* awkgram.y, debug.c, ext.c, gawkapi.c, gawkapi.h,
io.c: Remove unneeded \n in calls to warning(), fatal(),
and lintwarn().
* config.guess, config.sub: Updated from GNULIB.
2018-08-24 Arnold D. Robbins <[email protected]>
* NEWS: Updated w.r.t. GNULIB regex routines.
* config.sub: Updated from GNULIB.
2018-08-17 Arnold D. Robbins <[email protected]>
* config.sub: Updated from GNULIB.
2018-08-10 Arnold D. Robbins <[email protected]>
* config.guess, config.sub: Updated from GNULIB.
2018-08-05 John E. Malmberg <[email protected]>
* custom.h: Define macros needed for building with gnu regex.
2018-08-02 Arnold D. Robbins <[email protected]>
* awkgram.y (yylex): Add lint warning upon encountering escaped
physical newlines in a string.
* node.c (make_str_node): Ditto.
2018-08-01 John E. Malmberg <[email protected]>
* custom.h: Include fp.h on OpenVMS.
Workaround for bug in math.h missing some declarations.
2018-07-31 Arnold D. Robbins <[email protected]>
* interpret.h (unfield): Add a call to force_string() on
new value. See test/assignnumfield.awk. Thanks to
Ralph Corderoy <[email protected]> for the bug report.
2018-07-31 Arnold D. Robbins <[email protected]>
Handle newlines in -v and fix \-<newline>. Thanks to
Samy Mahmoudi <[email protected]> for the report.
* awk.h [ELIDE_BACK_NL]: New constant.
* awkgram.y (yylex): Disallow any physical newlines in a string
even if escaped, in POSIX mode.
* main.c (arg_assign): In POSIX mode disallow physical newline
in a -v value. Otherwise call make_str_node() with ELIDE_BACK_NL.
* node.c (make_str_node): Handle ELIDE_BACK_NL.
2018-07-31 Arnold D. Robbins <[email protected]>
* array.c (cmp_strings): Preserve value of lmin so it can be passed
to memcmp() if IGNORECASE comparison failed. Thanks to
M. Rashid Zamani <[email protected]> for the report.
2018-07-27 Arnold D. Robbins <[email protected]>
* re.c (make_regexp): Add warnings for unknown escape sequences,
similar to what we already do for strings.
* awkgram.y: Add lint warning about concatenation as target
of `>' redirection. Always use Op_parens so that
print "foo" > ("foo" 1) does not warn.
2018-07-26 Arnold D. Robbins <[email protected]>
* awk.h (_GNU_SOURCE): Don't define it here, it's already
done in config.h.
2018-07-13 Arnold D. Robbins <[email protected]>
* builtin.c (format_nan_inf): New function to generate +nan, -nan,
+inf, -inf, so that gawk output for NaN and INF always has a sign.
Handles regular and MPFR.
(out_of_range): New function to check if a value is out of range,
both regular and MPFR.
(format_tree): Use them in out of range calculation. Check for out
of range in floating point formats also. Allow new *undocumented*
'P' flag to not do out of range formantting. Used mainly for
the test program.
* awk.h (out_of_range, format_nan_inf): Declare functions.
* mpfr.c (mpg_format_val): Check for out of range and format the
the result appropriately if so.
* node.c (r_format_val): Ditto.
2018-06-27 Arnold D. Robbins <[email protected]>
* config.guess, config.sub: Updated from GNULIB.
2018-06-22 Andrew J. Schorr <[email protected]>
* node.c (r_force_number): If strtod returns ERANGE, accept the
value as being numeric instead of forcing it to zero. The impact
is that huge string values that overflow IEEE 754 limits will now
be converted to inf or -inf instead of 0. Thanks to Daniel
Pettet for reporting this issue.
2018-06-17 Arnold D. Robbins <[email protected]>
Fix a corner case with EPIPE to stdout/stderr.
Thanks to Peng Yu for the report.
* io.c (close_io): Add new parameter for indicating EPIPE happened,
update the code to set it if so.
* awk.h (close_io): Revise declaration.
* debug.c (close_all): Change call to close_io().
* interpret.h (interpret): For Op_atexit, if got an EPIPE, call
die_via_sigpipe().
2018-05-24 Arnold D. Robbins <[email protected]>
* awkgram.y (add_lint): For no-effect case, also check for
Op_push_i. Makes statements consisting of a single constant
trigger the warning.
2018-05-23 Arnold D. Robbins <[email protected]>
* config.guess, config.sub: Updated from GNULIB.
2018-05-14 Arnold D. Robbins <[email protected]>
* NEWS: Minor edits.
2018-05-13 Arnold D. Robbins <[email protected]>
* config.sub: Update from GNULIB.
2018-05-03 Arnold D. Robbins <[email protected]>
* Makefile.am (pc/Makefile.tst): New target.
(dist-hook): Now depends upon pc/Makefile.tst.
2018-04-30 Arnold D. Robbins <[email protected]>
* gawkapi.h [dl_load_func]: Minor improvement in version mismatch
message as suggested by Manuel Collado
2018-04-18 Arnold D. Robbins <[email protected]>
* config.sub: Updated from GNULIB.
2018-04-14 Manuel Collado <[email protected]>
* field.c (reset_record): Disable fieldwidth from API
get_record() if $0 is explicitly assigned a new value.
2018-04-02 Arnold D. Robbins <[email protected]>
* config.guess, config.sub, install-sh: Updated from GNULIB.
2018-04-01 Arnold D. Robbins <[email protected]>
Fix a nasty MPFR bug in r_dupnode. If the value being copied
is MPFN / MPFR, copy those bits over too. Thanks to
Noah Dean <[email protected]> for the report.
* node.c (r_dupnode): Check for MPFN / MPFR and copy the bits
over as needed.
Unrelated:
* interpret.h (UNFIELD): Turn into an inline function and
let UNFIELD macro call it, allows stepping in with a debugger.
(unfield): Function holding former body of UNFIELD macro.
2018-03-26 Arnold D. Robbins <[email protected]>
Remove the tail recursion optimization. It's fundamentally
broken, in the case where a local var becomes a parameter.
Thanks to Denis Shirokov <[email protected]> for the report.
See test/tailrecurse.awk.
* awk.h [num_tail_calls, tail_call]: Remove definitions.
* awkgram.y (grammar, mk_function): Remove code related to
the tail recursion optimization.
* eval.c (dump_fcall_stack): Adjust dumping code since no longer
looping through tail call recursion.
(setup_frame): Remove code related to the tail recursion optimization.
(init_interpret): Ditto.
2018-03-22 Arnold D. Robbins <[email protected]>
* configure.ac: Check for %a support in system printf.
* builtin.c (format_tree): Add support for %a and %A, including
a lint warning.
* NEWS: Add a note about %a support.