From cc335c0e57a92fd78141894350607eca3622465a Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 19 Jun 2014 11:57:06 -0700 Subject: glsl/glcpp: Add support for comments between #define and macro identifier The recent adddition of an error for "#define followed by a non-identifier" was a bit to aggressive since it used a regular expression in the lexer to flag any character that's not legal as the first character of an identifier. But we need to allow comments to appear here, (since we aren't removing comments in a preliminary pass). So we refine the error here to only flag characters that could not be an identifier, nor a comment, nor whitespace. We also augment the existing comment support to be active in the state as well. Reviewed-by: Jordan Justen --- src/glsl/glcpp/tests/130-define-comment.c | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/glsl/glcpp/tests/130-define-comment.c (limited to 'src/glsl/glcpp/tests/130-define-comment.c') diff --git a/src/glsl/glcpp/tests/130-define-comment.c b/src/glsl/glcpp/tests/130-define-comment.c new file mode 100644 index 00000000000..33312362cc7 --- /dev/null +++ b/src/glsl/glcpp/tests/130-define-comment.c @@ -0,0 +1,2 @@ +#define /*...*/ FUNC( /*...*/ x /*...*/ ) /*...*/ FOO( /*...*/ x /*...*/ ) +FUNC(bar) -- cgit v1.2.3