Fix function call parameter printer to omit extraneous leading comma
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 14 May 2010 23:06:41 +0000 (16:06 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 14 May 2010 23:07:04 +0000 (16:07 -0700)
The output of all test cases was verified to be the same using diff.

glsl_parser_extras.cpp

index 985d3829e6519d2f09a216eb54acc7ae9e777e00..62eeb9c86000fecd134e5825230d43fdb6bb0cbf 100644 (file)
@@ -326,7 +326,8 @@ ast_expression::print(void) const
       printf("( ");
 
       foreach_list_const (n, &this->expressions) {
-        printf(", ");
+        if (n != this->expressions.get_head())
+           printf(", ");
 
         ast_node *ast = exec_node_data(ast_node, n, link);
         ast->print();