From aac78ce8234d96932c38b3f48b1d828077bc0027 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 9 Jun 2012 16:31:06 -0700 Subject: glsl: glcpp: Move handling of #line directives from lexer to parser. The GLSL specification requires that #line directives be interpreted after macro expansion. Our existing implementation of #line macros in the lexer prevents conformance on this point. Moving the handling of #line from the lexer to the parser gives us the macro expansion we need. An additional benefit is that the preprocessor also now supports comments on the same line as #line directives. Finally, the preprocessor now emits the (fully-macro-expanded) #line directives into the output. This allows the full GLSL compiler to also see and interpret these directives so it can also generate correct line numbers in error messages. Signed-off-by: Carl Worth Reviewed-by: Kenneth Graunke --- src/glsl/glcpp/tests/091-hash-line.c.expected | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/glsl/glcpp/tests/091-hash-line.c.expected') diff --git a/src/glsl/glcpp/tests/091-hash-line.c.expected b/src/glsl/glcpp/tests/091-hash-line.c.expected index e663398c160..ea29149bc62 100644 --- a/src/glsl/glcpp/tests/091-hash-line.c.expected +++ b/src/glsl/glcpp/tests/091-hash-line.c.expected @@ -3,11 +3,11 @@ 1:0(1): preprocessor error: #error source 1, line 0 error 2:30(1): preprocessor error: #error source 2, line 30 error +#line 0 +#line 25 +#line 0 1 - - - - +#line 30 2 -- cgit v1.2.3