Skip to content

Commit

Permalink
Merge pull request #104 from udem-dlteam/laurent/uniform-do-while-whi…
Browse files Browse the repository at this point in the history
…tespace

Add space between condition and break in do_while
  • Loading branch information
laurenthuberdeau authored Oct 7, 2024
2 parents 176d87a + 02e9385 commit b373723
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/compiled/non_zero.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _main() {
while _getchar __t1; [ $__NEWLINE__ != $__t1 ]; do
:
done
[ $n = $__0__ ] || [ $((!((n >= __0__) && (n <= __9__)))) != 0 ]|| break
[ $n = $__0__ ] || [ $((!((n >= __0__) && (n <= __9__)))) != 0 ] || break
done
printf "You entered "
printf \\$((n/64))$((n/8%8))$((n%8))
Expand Down
2 changes: 1 addition & 1 deletion sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ bool comp_statement(ast node, STMT_CTX stmt_ctx) {
return comp_loop(wrap_str_lit(":"),
get_child(node, 0),
0, // No loop end statement
string_concat(comp_rvalue(get_child(node, 1), RVALUE_CTX_TEST), wrap_str_lit("|| break")),
string_concat(comp_rvalue(get_child(node, 1), RVALUE_CTX_TEST), wrap_str_lit(" || break")),
stmt_ctx
);
} else if (op == FOR_KW) {
Expand Down

0 comments on commit b373723

Please sign in to comment.