summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-14 10:17:38 -0700
committerCarl Worth <cworth@cworth.org>2010-05-14 11:50:27 -0700
commit04af13539a7a4bc72b566c111914b103d9e851a6 (patch)
tree55bf6bcf89aa4d44c74ef97beff9fc4da4f54cec
parentc5e9855f130b928b480c18c913135a411ee921e7 (diff)
Move most printing to the action in the content production.
Previously, printing was occurring all over the place. Here we document that it should all be happening at the top-level content production, and we move the printing of directive newlines. The printing of expanded macros is still happening in lower-level productions, but we plan to fix that soon.
-rw-r--r--glcpp-parse.y7
1 files changed, 3 insertions, 4 deletions
diff --git a/glcpp-parse.y b/glcpp-parse.y
index 4e5de8254d..8dc7897511 100644
--- a/glcpp-parse.y
+++ b/glcpp-parse.y
@@ -103,6 +103,7 @@ input:
| input content
;
+ /* We do all printing at the content level */
content:
IDENTIFIER {
printf ("%s", $1);
@@ -113,7 +114,7 @@ content:
talloc_free ($1);
}
| macro
-| directive_with_newline
+| directive_with_newline { printf ("\n"); }
| NEWLINE { printf ("\n"); }
| '(' { printf ("("); }
| ')' { printf (")"); }
@@ -154,9 +155,7 @@ argument:
;
directive_with_newline:
- directive NEWLINE {
- printf ("\n");
- }
+ directive NEWLINE
;
directive: