Fixed spacing for binary operators in print_ast().
authorRyan C. Gordon <icculus@icculus.org>
Tue, 02 Nov 2010 14:58:31 -0400
changeset 938 fc5240c4f197
parent 937 94e50ba3f956
child 939 64cc93ee5a56
Fixed spacing for binary operators in print_ast().
utils/mojoshader-compiler.c
--- a/utils/mojoshader-compiler.c	Tue Nov 02 14:55:33 2010 -0400
+++ b/utils/mojoshader-compiler.c	Tue Nov 02 14:58:31 2010 -0400
@@ -147,9 +147,10 @@
         case MOJOSHADER_AST_OP_ANDASSIGN:
         case MOJOSHADER_AST_OP_XORASSIGN:
         case MOJOSHADER_AST_OP_ORASSIGN:
-            fprintf(io, " ");  // then fall through! (no space before the comma).
         case MOJOSHADER_AST_OP_COMMA:
             print_ast(io, 0, ast->binary.left);
+            if (ast->ast.type != MOJOSHADER_AST_OP_COMMA)
+                fprintf(io, " ");  // no space before the comma.
             fprintf(io, "%s ", binary[
                 (typeint - MOJOSHADER_AST_OP_START_RANGE_BINARY) - 1]);
             print_ast(io, 0, ast->binary.right);