diff options
author | Ian Romanick <[email protected]> | 2010-08-30 11:58:04 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-08-30 12:52:42 -0700 |
commit | bea3963f59fb8da0687c3e3fbc6f15de8be7fddb (patch) | |
tree | 29398e8baec4a2aa397a01b320545cf4ff49f7bd /src/glsl/glsl_parser.ypp | |
parent | 9b0ba68b4489557c48efa088c3884120dabc68fb (diff) |
glsl2: Parse #pragma lines
All pragmas are currently ignored. Also, the error messages when a
pragma is used incorrectly (i.e., '#pragma debug(on)' inside a
function) are crap, but I think this is sufficient for now.
Fixes piglit test cases pragma-0[1-8].(vert|frag).
Diffstat (limited to 'src/glsl/glsl_parser.ypp')
-rw-r--r-- | src/glsl/glsl_parser.ypp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/glsl/glsl_parser.ypp b/src/glsl/glsl_parser.ypp index 4b6d9fe7eaa..6d99c52503e 100644 --- a/src/glsl/glsl_parser.ypp +++ b/src/glsl/glsl_parser.ypp @@ -103,7 +103,9 @@ %token INVARIANT %token LOWP MEDIUMP HIGHP SUPERP PRECISION -%token VERSION EXTENSION LINE PRAGMA COLON EOL INTERFACE OUTPUT +%token VERSION EXTENSION LINE COLON EOL INTERFACE OUTPUT +%token PRAGMA_DEBUG_ON PRAGMA_DEBUG_OFF +%token PRAGMA_OPTIMIZE_ON PRAGMA_OPTIMIZE_OFF %token LAYOUT_TOK /* Reserved words that are not actually used in the grammar. @@ -236,6 +238,13 @@ version_statement: } ; +pragma_statement: + PRAGMA_DEBUG_ON EOL + | PRAGMA_DEBUG_OFF EOL + | PRAGMA_OPTIMIZE_ON EOL + | PRAGMA_OPTIMIZE_OFF EOL + ; + extension_statement_list: | extension_statement_list extension_statement @@ -1496,6 +1505,7 @@ jump_statement: external_declaration: function_definition { $$ = $1; } | declaration { $$ = $1; } + | pragma_statement { $$ = NULL; } ; function_definition: |