mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
glsl/glcpp: Swallow empty #pragma directives.
Previously, we were passing these through, just like any other pragma. But the downstream compiler was tripping up on them. It seems easier to swallow these in the preprocessor and not pass them on at all rather than fixing the downstream compiler. This fixes the following Khronos GLES3 CTS tests: preprocessor.pragmas.pragma_vertex preprocessor.pragmas.pragma_fragment Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
bf9bce5bea
commit
a48ff781c1
2 changed files with 7 additions and 1 deletions
|
|
@ -287,6 +287,12 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
|||
RETURN_STRING_TOKEN (VERSION_TOKEN);
|
||||
}
|
||||
|
||||
/* Swallow empty #pragma directives, (to avoid confusing the
|
||||
* downstream compiler). */
|
||||
<HASH>pragma{HSPACE}*/[\r\n] {
|
||||
BEGIN INITIAL;
|
||||
}
|
||||
|
||||
/* glcpp doesn't handle #extension, #version, or #pragma directives.
|
||||
* Simply pass them through to the main compiler's lexer/parser. */
|
||||
<HASH>(extension|pragma)[^\r\n]* {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
|
||||
#pragma
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue