Kenneth Graunke <[email protected]> writes:
> One bad thing about this patch is that it breaks 091-hash-line.c in glcpp's
> unit test suite.  I'm not sure what to do about that.  I could update the
> output, but the new output doesn't make much sense anymore...it gives you
> lovely messages like:
>
>     0:4(1): preprocessor error: #error line 25 error

In other words, after the patch, the preprocessor error messages
(whether from the lexer or the parser) won't have correct line numbers
in them anymore, (in the face of any #line directives).

That seems unfortunate if it's easy to avoid. And I think it should
be. Instead of dropping the handling of #line from the lexer, we should
just move it to the parser.

Meanwhile, since the preprocessor has been interpreting (and consuming)
#line directives, does that mean that the main GLSL compiler hasn't been
seeing them and has been getting incorrect line numbers?

Your patch fixes that by passing them through.

What I'd like to see is the preprocessor interpreting the #line
directives (for its own notion of the line number) and then also
emitting a fully expanded #line macro for the main compiler to
interpret.

I'll plan to attempt that on Monday if I don't get to it today.

-Carl

Attachment: pgplAETVKaR7A.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to