From b66b8cb87fecbb30432d204b318aabe5bb8828c0 Mon Sep 17 00:00:00 2001 From: Laurent Huberdeau Date: Fri, 4 Oct 2024 15:03:52 -0400 Subject: [PATCH 1/2] Add space between condition and break in do_while --- sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh.c b/sh.c index ec11f53..c7b6d62 100644 --- a/sh.c +++ b/sh.c @@ -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) { From 02e9385b2b6a8c68945c9eb84236694c00ec8e55 Mon Sep 17 00:00:00 2001 From: Laurent Huberdeau Date: Fri, 4 Oct 2024 20:57:17 -0400 Subject: [PATCH 2/2] Regenerate examples --- examples/compiled/non_zero.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/compiled/non_zero.sh b/examples/compiled/non_zero.sh index e1abe4c..2a042b1 100755 --- a/examples/compiled/non_zero.sh +++ b/examples/compiled/non_zero.sh @@ -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))