summaryrefslogtreecommitdiffstatshomepage
path: root/py/parse.c
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-10-12 16:16:56 +0100
committerDamien <damien.p.george@gmail.com>2013-10-12 16:16:56 +0100
commit0efb3a1b66278f31da3e36223bc1429ab5fa7e2c (patch)
tree4b471947f0b654a78956d5ef92f079e3211eb71e /py/parse.c
parent3a205179ea36cb0380366465d517ca27ecb0e400 (diff)
downloadmicropython-0efb3a1b66278f31da3e36223bc1429ab5fa7e2c.tar.gz
micropython-0efb3a1b66278f31da3e36223bc1429ab5fa7e2c.zip
Tidy up SMALL_INT optimisations and CPython compatibility.
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));