bc_parse_push(p, XC_INST_READ);
- RETURN_STATUS(zbc_lex_next(&p->l));
+ RETURN_STATUS(s);
}
#define zbc_parse_read(...) (zbc_parse_read(__VA_ARGS__) COMMA_SUCCESS)
*prev = (type == BC_LEX_KEY_LENGTH) ? XC_INST_LENGTH : XC_INST_SQRT;
bc_parse_push(p, *prev);
- RETURN_STATUS(zbc_lex_next(&p->l));
+ RETURN_STATUS(s);
}
#define zbc_parse_builtin(...) (zbc_parse_builtin(__VA_ARGS__) COMMA_SUCCESS)
static BC_STATUS zbc_parse_break_or_continue(BcParse *p, BcLexType type)
{
- BcStatus s;
size_t i;
if (type == BC_LEX_KEY_BREAK) {
} else {
i = *(size_t*)bc_vec_top(&p->conds);
}
-
bc_parse_pushJUMP(p, i);
- s = zbc_lex_next(&p->l);
- if (s) RETURN_STATUS(s);
-
- if (p->l.lex != BC_LEX_SCOLON && p->l.lex != XC_LEX_NLINE)
- RETURN_STATUS(bc_error_bad_token());
-
RETURN_STATUS(zbc_lex_next(&p->l));
}
#define zbc_parse_break_or_continue(...) (zbc_parse_break_or_continue(__VA_ARGS__) COMMA_SUCCESS)
if (BC_PARSE_LEAF(prev, rprn))
return bc_error_bad_expression();
s = zbc_parse_builtin(p, t, flags, &prev);
+ get_token = true;
paren_expr = true;
rprn = bin_last = false;
- //get_token = false; - already is
nexprs++;
break;
case BC_LEX_KEY_READ:
return bc_error_bad_expression();
s = zbc_parse_read(p);
prev = XC_INST_READ;
+ get_token = true;
paren_expr = true;
rprn = bin_last = false;
- //get_token = false; - already is
nexprs++;
break;
case BC_LEX_KEY_SCALE:
return bc_error_bad_expression();
s = zbc_parse_scale(p, &prev, flags);
prev = XC_INST_SCALE;
+ //get_token = false; - already is
paren_expr = true;
rprn = bin_last = false;
- //get_token = false; - already is
nexprs++;
break;
default:
"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"
"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" \