From 85a0ba4b6dadd4b8797e1fedcdd2f5a5bcd85456 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Wed, 20 Oct 2021 23:06:29 +0200 Subject: [PATCH] Change limit --- lib/libesp32/Berry/src/be_parser.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/libesp32/Berry/src/be_parser.c b/lib/libesp32/Berry/src/be_parser.c index d98988d9f..664f24b92 100644 --- a/lib/libesp32/Berry/src/be_parser.c +++ b/lib/libesp32/Berry/src/be_parser.c @@ -20,6 +20,7 @@ #include "be_decoder.h" #include "be_debug.h" #include "be_exec.h" +#include #define OP_NOT_BINARY TokenNone #define OP_NOT_UNARY TokenNone @@ -30,6 +31,17 @@ #define FUNC_METHOD 1 #define FUNC_ANONYMOUS 2 +#if BE_INTGER_TYPE == 0 /* int */ + #define M_IMAX INT_MAX + #define M_IMIN INT_MIN +#elif BE_INTGER_TYPE == 1 /* long */ + #define M_IMAX LONG_MAX + #define M_IMIN LONG_MIN +#else /* int64_t (long long) */ + #define M_IMAX LLONG_MAX + #define M_IMIN LLONG_MIN +#endif + /* get binary operator priority */ #define binary_op_prio(op) (binary_op_prio_tab[cast_int(op) - OptAdd]) @@ -1075,7 +1087,7 @@ static void sub_expr(bparser *parser, bexpdesc *e, int prio) init_exp(&e2, ETVOID, 0); sub_expr(parser, &e2, binary_op_prio(op)); /* parse right side */ if ((e2.type == ETVOID) && (op == OptConnect)) { - init_exp(&e2, ETINT, -1); + init_exp(&e2, ETINT, M_IMAX); } else { check_var(parser, &e2); /* check if valid */ }