bc: allow {break} and {continue} (allow RBRACE to terminate them)
function old new delta zbc_parse_stmt_possibly_auto 1599 1560 -39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -66,7 +66,7 @@ testing "bc if 0 else if 1" \
|
||||
"2\n9\n" \
|
||||
"" "if (0) 1 else if (1) 2; 9"
|
||||
|
||||
testing "bc for(;;)" \
|
||||
testing "bc for (;;)" \
|
||||
"bc" \
|
||||
"2\n3\n2\n9\n" \
|
||||
"" "i=2; for (;;) { 2; if(--i==0) break; 3; }; 9"
|
||||
@@ -86,6 +86,11 @@ testing "bc for (init;cond;upd)" \
|
||||
"1\n2\n3\n9\n" \
|
||||
"" "for(i=1;i<4;i++)i; 9"
|
||||
|
||||
testing "bc for (;;) {break}" \
|
||||
"bc" \
|
||||
"2\n9\n" \
|
||||
"" "for (;;) {2;break}; 9"
|
||||
|
||||
testing "bc define auto" \
|
||||
"bc" \
|
||||
"8\n9\n" \
|
||||
|
Reference in New Issue
Block a user