Simplify lexer significantly (remove all stateful lexing).
We are able to remove all state by simply passing NEWLINE through
as a token unconditionally (as opposed to only passing newline when
on a driective line as we did previously).
diff --git a/glcpp-parse.y b/glcpp-parse.y
index 29614fb..9883a6f 100644
--- a/glcpp-parse.y
+++ b/glcpp-parse.y
@@ -74,11 +74,17 @@
talloc_free ($1);
}
| directive_with_newline
+| NEWLINE {
+ printf ("\n");
+ }
| content token {
_print_resolved_token (parser, $2);
talloc_free ($2);
}
| content directive_with_newline
+| content NEWLINE {
+ printf ("\n");
+ }
;
directive_with_newline: