summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser.ypp
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2011-01-16 21:44:57 -0800
committerChad Versace <[email protected]>2011-01-17 10:20:47 -0800
commit08a286c9cc8fecb081057e0f551c88a446c47b6f (patch)
tree6b8272d30e0d6a8111af47ccf7129c92a543ef0f /src/glsl/glsl_parser.ypp
parent889e1a5b6c6602198d649ea5881e0010dec575e9 (diff)
glsl: Add support for default precision statements
* Add new field ast_type_specifier::is_precision_statement. * Add semantic checks in ast_type_specifier::hir(). * Alter parser rules accordingly.
Diffstat (limited to 'src/glsl/glsl_parser.ypp')
-rw-r--r--src/glsl/glsl_parser.ypp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/glsl/glsl_parser.ypp b/src/glsl/glsl_parser.ypp
index 903d3f09903..d0941ecef7d 100644
--- a/src/glsl/glsl_parser.ypp
+++ b/src/glsl/glsl_parser.ypp
@@ -276,16 +276,16 @@ extension_statement:
external_declaration_list:
external_declaration
{
- /* FINISHME: The NULL test is only required because 'precision'
- * FINISHME: statements are not yet supported.
+ /* FINISHME: The NULL test is required because pragmas are set to
+ * FINISHME: NULL. (See production rule for external_declaration.)
*/
if ($1 != NULL)
state->translation_unit.push_tail(& $1->link);
}
| external_declaration_list external_declaration
{
- /* FINISHME: The NULL test is only required because 'precision'
- * FINISHME: statements are not yet supported.
+ /* FINISHME: The NULL test is required because pragmas are set to
+ * FINISHME: NULL. (See production rule for external_declaration.)
*/
if ($2 != NULL)
state->translation_unit.push_tail(& $2->link);
@@ -708,8 +708,9 @@ declaration:
"only be applied to `int' or `float'\n");
YYERROR;
}
-
- $$ = NULL; /* FINISHME */
+ $3->precision = $2;
+ $3->is_precision_statement = true;
+ $$ = $3;
}
;