diff options
author | Carl Worth <cworth@cworth.org> | 2010-05-20 14:29:43 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-05-20 14:29:43 -0700 |
commit | 5a6b9a27fdb2ac66aaadd90b15b1889fea8f08d0 (patch) | |
tree | 1a0b226c9abf5be1280eddf66af93b1f7e895c46 /glcpp-lex.l | |
parent | 005b32061f77008530a290ed991980a579095002 (diff) |
Avoid printing a space at the beginning of lines in the output.
This fixes more differences compared to "gcc -E" so removes several
cases of erroneously failing test cases. The implementation isn't very
elegant, but it is functional.
Diffstat (limited to 'glcpp-lex.l')
-rw-r--r-- | glcpp-lex.l | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l index 8e3ab661e6..13e4d6f0ef 100644 --- a/glcpp-lex.l +++ b/glcpp-lex.l @@ -173,7 +173,12 @@ TOKEN [^[:space:](),]+ } \n { + /* XXX: Printing here (rather than in a parser production) + * *and* frobbing a bit of the parser state here are both ugly + * things. But all my attempts to avoid this by returning a + * NEWLINE token here have led to even more ugly things. */ printf ("\n"); + yyextra->just_printed_separator = 1; } {HSPACE}+ |