[Mesa-dev] [PATCH 2/3] glsl: glcpp: Move handling of #line directives from lexer to parser.

Carl Worth cworth at cworth.org
Tue Jun 26 15:41:59 PDT 2012


Kenneth Graunke <kenneth at whitecape.org> writes:
> Sorry for the extremely late review.  (Lost this one in the inbox.)

No problem at all.

> Could yylineno and yylloc->source be set directly from the rules, rather
> than using flags and setting them here?  It seems like they could, but I
> imagine you tried that and it doesn't work.

Correct. I did try that first. It was hard to get at the lex-specific
data structure from the grammar rules. And then I was also concerned
about the potentially of the timing of the adjustments being wrong if
performed in grammar rules. It's easier to just know these line numbers
are correctly being adjusted by doing it in the lexer.

> Hm.  I originally thought #line took effect regardless of any #if trees,
...
> So I think this is right.

Thanks. I hadn't even thought through that, but simply copied that block
of code. I appreciate your eye for detail.

> Could you please #include <stdbool.h> and use 'bool' instead of 'int'
> for the has_* variables?

Done.

> For the series:
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

Thanks for the review. All pushed now, (along with a couple of other
patches you reviewed previously).

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120626/406ad5d6/attachment.pgp>


More information about the mesa-dev mailing list