From 81f01432bd4aad8e8b87ae273eb05297e35eff07 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 14 May 2010 17:08:45 -0700 Subject: Don't return SPACE tokens unless strictly needed. This reverts the unconditional return of SPACE tokens from the lexer from commit 48b94da0994b44e41324a2419117dcd81facce8b . That commit seemed useful because it kept the lexer simpler, but the presence of SPACE tokens is causing lots of extra complication for the parser itself, (redundant productions other than whitespace differences, several productions buggy in the case of extra whitespace, etc.) Of course, we'd prefer to never have any whitespace token, but that's not possible with the need to distinguish between "#define foo()" and "#define foo ()". So we'll accept a little bit of pain in the lexer, (enough state to support this special-case token), in exchange for keeping most of the parser blissffully ignorant of whether tokens are separated by whitespace or not. This change does mean that our output now differs from that of "gcc -E", but only in whitespace. So we test with "diff -w now to ignore those differences. --- tests/glcpp-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/glcpp-test b/tests/glcpp-test index 25685eeabe..bd204de1e2 100755 --- a/tests/glcpp-test +++ b/tests/glcpp-test @@ -5,5 +5,5 @@ for test in *.c; do ../glcpp < $test > $test.out gcc -E $test -o $test.gcc grep -v '^#' < $test.gcc > $test.expected - diff -u $test.expected $test.out + diff -w -u $test.expected $test.out done -- cgit v1.2.3