From a61306ca9e647c044786ec80c044c8cfa250eb8d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 2 Nov 2010 14:58:31 -0400 Subject: [PATCH] Fixed spacing for binary operators in print_ast(). --- utils/mojoshader-compiler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/mojoshader-compiler.c b/utils/mojoshader-compiler.c index e4937788..2d1ad025 100644 --- a/utils/mojoshader-compiler.c +++ b/utils/mojoshader-compiler.c @@ -147,9 +147,10 @@ static void print_ast(FILE *io, const int substmt, const void *_ast) 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);