mesa/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected
Carl Worth 828686d4eb glsl/glcpp: Drop extra, final newline from most output
The glcpp parser is line-based, so it needs to see a NEWLINE token at the end
of each line. This causes a trick for files that end without a final newline.

Previously, the lexer for glcpp punted in this case by unconditionally
returning a NEWLINE token at end-of-file, (causing most files to have an extra
blank line at the end). Here, we refine this by lexing end-of-file as a
NEWLINE token only if the immediately preceding token was not a NEWLINE token.

The patch is a minor change that only looks huge for two reasons:

	1. Almost all glcpp test result ".expected" files are updated to drop
	   the extra newline.

	2. All return statements from the lexer are adjusted to use a new
	   RETURN_TOKEN macro that tracks the last-token-was-a-newline state.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00

29 lines
350 B
Text

0:2(9): preprocessor error: Redefinition of macro x
0:5(9): preprocessor error: Redefinition of macro abc
0:8(9): preprocessor error: Redefinition of macro foo
0:11(9): preprocessor error: Redefinition of macro bar
0:14(9): preprocessor error: Redefinition of macro biff
0:17(9): preprocessor error: Redefinition of macro oper