made the dumptree a little more readable
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 26 Feb 2003 15:13:03 +0000 (15:13 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 26 Feb 2003 15:13:03 +0000 (15:13 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2322 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c

index 4db1c15b6000e65ca99f3c446ae52214db7b6915..b313dc793e717975922e5489a3752d15a979cf58 100644 (file)
@@ -4494,9 +4494,7 @@ void ast_print (ast * tree, FILE *outfile, int indent)
                return;
        }
        if (tree->opval.op == NULLOP) {
-               fprintf(outfile,"\n");
                ast_print(tree->left,outfile,indent);
-               fprintf(outfile,"\n");
                ast_print(tree->right,outfile,indent);
                return ;
        }
@@ -5056,15 +5054,23 @@ void ast_print (ast * tree, FILE *outfile, int indent)
                fprintf(outfile,"IF (%p) \n",tree);
                ast_print(tree->left,outfile,indent+2);
                if (tree->trueLabel) {
-                       INDENT(indent,outfile);
+                       INDENT(indent+2,outfile);
                        fprintf(outfile,"NE(!=) 0 goto %s\n",tree->trueLabel->name);
                }
                if (tree->falseLabel) {
-                       INDENT(indent,outfile);
+                       INDENT(indent+2,outfile);
                        fprintf(outfile,"EQ(==) 0 goto %s\n",tree->falseLabel->name);
                }
                ast_print(tree->right,outfile,indent+2);
                return ;
+               /*----------------------------*/
+               /* goto Statement              */
+               /*----------------------------*/
+       case GOTO:
+               fprintf(outfile,"GOTO (%p) \n",tree);
+               ast_print(tree->left,outfile,indent+2);
+               fprintf(outfile,"\n");
+               return ;
                /*------------------------------------------------------------------*/
                /*----------------------------*/
                /* for Statement              */