From 7d414a1b52d193bab2c94cf56932e1eba23ba542 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 8 Feb 2015 01:57:40 +0000 Subject: py: Parse big-int/float/imag constants directly in parser. Previous to this patch, a big-int, float or imag constant was interned (made into a qstr) and then parsed at runtime to create an object each time it was needed. This is wasteful in RAM and not efficient. Now, these constants are parsed straight away in the parser and turned into objects. This allows constants with large numbers of digits (so addresses issue #1103) and takes us a step closer to #722. --- extmod/modujson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extmod') diff --git a/extmod/modujson.c b/extmod/modujson.c index d1d103237..b5384bbc4 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -161,9 +161,9 @@ STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) { vstr_add_byte(&vstr, *s); } if (flt) { - next = mp_parse_num_decimal(vstr.buf, vstr.len, false, false); + next = mp_parse_num_decimal(vstr.buf, vstr.len, false, false, NULL); } else { - next = mp_parse_num_integer(vstr.buf, vstr.len, 10); + next = mp_parse_num_integer(vstr.buf, vstr.len, 10, NULL); } break; } -- cgit v1.2.3