Skip to content

Commit

Permalink
Refactor some loop code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Warren Toomey committed Jan 17, 2020
1 parent 62fbef7 commit f84b17c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 03_Precedence/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct ASTnode *additive_expr(void) {
// And get the next token at our precedence
tokentype = Token.token;
if (tokentype == T_EOF)
return (left);
break;
}

// Return whatever tree we have created
Expand Down Expand Up @@ -203,7 +203,7 @@ struct ASTnode *multiplicative_expr(void) {
// If no tokens left, return just the left node
tokentype = Token.token;
if (tokentype == T_EOF)
return (left);
break;
}
// Return whatever tree we have created
Expand Down
4 changes: 2 additions & 2 deletions 03_Precedence/expr2.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct ASTnode *multiplicative_expr(void) {
// If no tokens left, return just the left node
tokentype = Token.token;
if (tokentype == T_EOF)
return (left);
break;
}

// Return whatever tree we have created
Expand Down Expand Up @@ -107,7 +107,7 @@ struct ASTnode *additive_expr(void) {
// And get the next token at our precedence
tokentype = Token.token;
if (tokentype == T_EOF)
return (left);
break;
}

// Return whatever tree we have created
Expand Down

0 comments on commit f84b17c

Please sign in to comment.