glsl/glcpp: Add support for comments between #define and macro identifier
authorCarl Worth <cworth@cworth.org>
Thu, 19 Jun 2014 18:57:06 +0000 (11:57 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 29 Jul 2014 22:11:48 +0000 (15:11 -0700)
commitcc335c0e57a92fd78141894350607eca3622465a
treed205bcd9ea62081d67a3bd74e6054d917eff42bf
parentea2e9300ece89dffdc4a228dc86bea28a7cd58e2
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 <DEFINE>
state as well.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/glcpp/glcpp-lex.l
src/glsl/glcpp/tests/130-define-comment.c [new file with mode: 0644]
src/glsl/glcpp/tests/130-define-comment.c.expected [new file with mode: 0644]