summaryrefslogtreecommitdiff
path: root/glsl_parser.ypp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-05-10 10:47:14 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-05-10 11:04:02 -0700
commit3521f0bdd52d226031a3b60e2cd89b4629147690 (patch)
tree2215d03df7219358862025081aa018f0295184dd /glsl_parser.ypp
parentbdd9b1f3ffa2a195d983816adfeca20480256119 (diff)
Store AST function call parameters in expressions
Previously the list of function call parameters was stored as a circular list in ast_expression::subexpressions[1]. They are now stored as a regular list in ast_expression::expressions.
Diffstat (limited to 'glsl_parser.ypp')
-rw-r--r--glsl_parser.ypp11
1 files changed, 8 insertions, 3 deletions
diff --git a/glsl_parser.ypp b/glsl_parser.ypp
index 131f23d..fb3b345 100644
--- a/glsl_parser.ypp
+++ b/glsl_parser.ypp
@@ -294,6 +294,12 @@ postfix_expression:
}
| function_call
{
+ /* Function call parameters used to be stored as a circular list in
+ * subexpressions[1]. They are now stored as a regular list in
+ * expressions. This assertion validates that the old code was
+ * correctly converted. It can eventually be removed.
+ */
+ assert($1->subexpressions[1] == NULL);
$$ = $1;
}
| postfix_expression '.' IDENTIFIER
@@ -346,14 +352,13 @@ function_call_header_with_parameters:
{
$$ = $1;
$$->set_location(yylloc);
- $$->subexpressions[1] = $2;
+ insert_at_tail(& $$->expressions, (struct simple_node *) $2);
}
| function_call_header_with_parameters ',' assignment_expression
{
$$ = $1;
$$->set_location(yylloc);
- insert_at_tail((struct simple_node *) $$->subexpressions[1],
- (struct simple_node *) $3);
+ insert_at_tail(& $$->expressions, (struct simple_node *) $3);
}
;