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.
diff --git a/glcpp-lex.l b/glcpp-lex.l
index 8e3ab66..13e4d6f 100644
--- a/glcpp-lex.l
+++ b/glcpp-lex.l
@@ -173,7 +173,12 @@
}
\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}+