aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog32
-rw-r--r--awkgram.c5
-rw-r--r--awkgram.y5
3 files changed, 31 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index bb4edd31..2e305ddd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,19 @@
+2014-10-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (mk_program): Add a comment that we don't need to
+ clear the comment* variables.
+
2014-10-04 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_string_fp): Fix breaklines case to actually
output the current letter. This broke at gawk 4.0.0. Sigh.
Thanks to Bert Bos (bert@w3.org) for the report.
+2014-10-03 Stephen Davies <sdavies@sdc.com.au>
+
+ * awkgram.y (program_comment): Renamed from comment0.
+ (function_comment): Renamed from commentf.
+
2014-10-02 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y, profile.c: Minor white space cleanups.
@@ -106,13 +116,13 @@
- DO print the header comments
- Do NOT print the program's original comments
- * awkgram.y (comment0, commentf): New varibles that are pointers to program
- and function comments.
- (get_comment): New function that retrieves consecutive comment lines and empty
- lines as a unit).
- (split_comment): New function: iff first block in the program is a function and
- it is predeeded by comments, take the last non-blank line as function comment
- and any preceeding lines as program comment.)
+ * awkgram.y (comment0, commentf): New varibles that are pointers to
+ program and function comments.
+ (get_comment): New function that retrieves consecutive comment lines
+ and empty lines as a unit).
+ (split_comment): New function: iff first block in the program is a
+ function and it is predeeded by comments, take the last non-blank
+ line as function comment and any preceeding lines as program comment.)
Following token rules were changed to handle comments:
@@ -121,12 +131,12 @@
Following functions were changed to handle comments:
- * awkgram.y (mk_program, mk_function, allow_newline and yylex): Update to
- handle comments. (Also fixed typo in case '\\'.)
+ * awkgram.y (mk_program, mk_function, allow_newline and yylex): Update
+ to handle comments. (Also fixed typo in case '\\'.)
* profile.c (print_comment): New function to format comment printing.
- (indent, pprint, dump_prog, pp_func): Changed to handle comments and the
- revised indentation rules.
+ (indent, pprint, dump_prog, pp_func): Changed to handle comments and
+ the revised indentation rules.
2014-09-07 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/awkgram.c b/awkgram.c
index 3efbd137..a79f9a30 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4625,6 +4625,11 @@ mk_program()
cp = end_block;
else
cp = list_merge(begin_block, end_block);
+ /*
+ * We don't need to clear the comment variables
+ * since they're not used anymore after this
+ * function is called.
+ */
if (comment != NULL)
(void) list_append(cp, comment);
(void) list_append(cp, ip_atexit);
diff --git a/awkgram.y b/awkgram.y
index 5cf8e92f..64ed3c56 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -2287,6 +2287,11 @@ mk_program()
cp = end_block;
else
cp = list_merge(begin_block, end_block);
+ /*
+ * We don't need to clear the comment variables
+ * since they're not used anymore after this
+ * function is called.
+ */
if (comment != NULL)
(void) list_append(cp, comment);
(void) list_append(cp, ip_atexit);