diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/builtin.h | 1 | ||||
-rw-r--r-- | py/builtintables.c | 3 | ||||
-rw-r--r-- | py/mpconfig.h | 4 | ||||
-rw-r--r-- | py/py.mk | 7 | ||||
-rw-r--r-- | py/qstrdefs.h | 9 |
5 files changed, 24 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h index 9c8b2b9be2..526157fbcd 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -90,3 +90,4 @@ extern struct _dummy_t mp_sys_stderr_obj; extern const mp_obj_module_t mp_module_uctypes; extern const mp_obj_module_t mp_module_zlibd; extern const mp_obj_module_t mp_module_ujson; +extern const mp_obj_module_t mp_module_ure; diff --git a/py/builtintables.c b/py/builtintables.c index 5712a3ef56..1fd60d8177 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -209,6 +209,9 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = { #if MICROPY_PY_UJSON { MP_OBJ_NEW_QSTR(MP_QSTR_ujson), (mp_obj_t)&mp_module_ujson }, #endif +#if MICROPY_PY_URE + { MP_OBJ_NEW_QSTR(MP_QSTR_ure), (mp_obj_t)&mp_module_ure }, +#endif // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES diff --git a/py/mpconfig.h b/py/mpconfig.h index bf868624d9..92b61d0e12 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -394,6 +394,10 @@ typedef double mp_float_t; #define MICROPY_PY_UJSON (0) #endif +#ifndef MICROPY_PY_URE +#define MICROPY_PY_URE (0) +#endif + /*****************************************************************************/ /* Hooks for a port to add builtins */ @@ -113,6 +113,10 @@ PY_O_BASENAME = \ ../extmod/moductypes.o \ ../extmod/modzlibd.o \ ../extmod/modujson.o \ + ../extmod/modure.o \ + ../extmod/re1.5/compilecode.o \ + ../extmod/re1.5/dumpcode.o \ + ../extmod/re1.5/recursiveloop.o \ # prepend the build destination prefix to the py object files PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) @@ -166,3 +170,6 @@ $(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT) # optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster) $(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) +# Additional options for 3rd-party libs + +$(PY_BUILD)/../extmod/re1.5/recursiveloop.o: CFLAGS += "-Dre1_5_fatal(x)=assert(!x)" diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 6a63f0780b..eb99e1b3d7 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -473,3 +473,12 @@ Q(ujson) Q(dumps) Q(loads) #endif + +#if MICROPY_PY_URE +Q(ure) +Q(compile) +Q(match) +Q(search) +Q(group) +Q(DEBUG) +#endif |