summaryrefslogtreecommitdiffstatshomepage
path: root/py/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/parse.c')
-rw-r--r--py/parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/parse.c b/py/parse.c
index 541c4eb3f5..7c45cd7d75 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -228,7 +228,7 @@ static void push_result_token(parser_t *parser, const py_lexer_t *lex) {
}
if (dec) {
pn = py_parse_node_new_leaf(PY_PARSE_NODE_DECIMAL, qstr_from_strn_copy(str, len));
- } else if (small_int && -0x800000 <= int_val && int_val <= 0x7fffff) { // XXX check this range formula!
+ } else if (small_int && PY_FIT_SMALL_INT(int_val)) {
pn = py_parse_node_new_leaf(PY_PARSE_NODE_SMALL_INT, int_val);
} else {
pn = py_parse_node_new_leaf(PY_PARSE_NODE_INTEGER, qstr_from_strn_copy(str, len));