Skip to content

Commit

Permalink
Add one more level identation on no commands control blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
bfbechlin committed May 17, 2017
1 parent d1ecf45 commit 633d5a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions astree.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void ast_make_source(FILE* stream, struct astree* tree, int level){
ast_make_source(stream, tree->children[0], level);
fprintf(stream, ") then\n");
if(tree->children[1] == NULL)
print_identation(stream, level);
print_identation(stream, level + 1);
else if(tree->children[1]->type == AST_BLOCK)
ast_make_source(stream, tree->children[1], level);
else
Expand All @@ -294,7 +294,7 @@ void ast_make_source(FILE* stream, struct astree* tree, int level){
ast_make_source(stream, tree->children[0], level);
fprintf(stream, ") then\n");
if(tree->children[1] == NULL)
print_identation(stream, level);
print_identation(stream, level + 1);
else if(tree->children[1]->type == AST_BLOCK)
ast_make_source(stream, tree->children[1], level);
else
Expand All @@ -303,7 +303,7 @@ void ast_make_source(FILE* stream, struct astree* tree, int level){
print_identation(stream, level);
fprintf(stream, "else\n");
if(tree->children[2] == NULL)
print_identation(stream, level);
print_identation(stream, level + 1);
else if(tree->children[2]->type == AST_BLOCK)
ast_make_source(stream, tree->children[2], level);
else
Expand All @@ -314,7 +314,7 @@ void ast_make_source(FILE* stream, struct astree* tree, int level){
ast_make_source(stream, tree->children[0], level);
fprintf(stream, ")\n");
if(tree->children[1] == NULL)
print_identation(stream, level);
print_identation(stream, level + 1);
else if(tree->children[1]->type == AST_BLOCK)
ast_make_source(stream, tree->children[1], level);
else
Expand All @@ -329,7 +329,7 @@ void ast_make_source(FILE* stream, struct astree* tree, int level){
ast_make_source(stream, tree->children[2], level);
fprintf(stream, ")\n");
if(tree->children[3] == NULL)
print_identation(stream, level);
print_identation(stream, level + 1);
else if(tree->children[3]->type == AST_BLOCK)
ast_make_source(stream, tree->children[3], level);
else
Expand Down

0 comments on commit 633d5a1

Please sign in to comment.