diff --git a/lib/libesp32/Berry/src/be_debug.c b/lib/libesp32/Berry/src/be_debug.c index 33db01d36..4c6be85a8 100644 --- a/lib/libesp32/Berry/src/be_debug.c +++ b/lib/libesp32/Berry/src/be_debug.c @@ -111,7 +111,7 @@ void be_print_inst(binstruction ins, int pc) logbuf("%s\tK%d", opc2str(op), IGET_Bx(ins)); break; case OP_CLOSE: case OP_LDNIL: - logbuf("%s\t%d", opc2str(op), IGET_RA(ins)); + logbuf("%s\tR%d", opc2str(op), IGET_RA(ins)); break; case OP_RAISE: logbuf("%s\t%d\t%c%d\t%c%d", opc2str(op), IGET_RA(ins), diff --git a/lib/libesp32/Berry/src/be_parser.c b/lib/libesp32/Berry/src/be_parser.c index b04b24383..805a85021 100644 --- a/lib/libesp32/Berry/src/be_parser.c +++ b/lib/libesp32/Berry/src/be_parser.c @@ -97,7 +97,7 @@ static void match_notoken(bparser *parser, btokentype type) } } -/* check that if the expdesc is a symbol, it is avalid one or raise an exception */ +/* check that if the expdesc is a symbol, it is a valid one or raise an exception */ static void check_symbol(bparser *parser, bexpdesc *e) { if (e->type == ETVOID && e->v.s == NULL) { /* error when token is not a symbol */ @@ -106,7 +106,7 @@ static void check_symbol(bparser *parser, bexpdesc *e) } } -/* check that the value in `e` is valid for a variable, i.e. conatins a value or a valid symbol */ +/* check that the value in `e` is valid for a variable, i.e. contains a value or a valid symbol */ static void check_var(bparser *parser, bexpdesc *e) { check_symbol(parser, e); /* check the token is a symbol */ @@ -989,6 +989,7 @@ static void cond_expr(bparser *parser, bexpdesc *e) if (next_type(parser) == OptQuestion) { int jf, jl = NO_JUMP; /* jump list */ bfuncinfo *finfo = parser->finfo; + check_var(parser, e); /* check if valid */ scan_next_token(parser); /* skip '?' */ be_code_jumpbool(finfo, e, bfalse); /* go if true */ jf = e->f;