micropython/py
Damien George e6850838cd py/parse: Simplify parse nodes representing a list.
This commit simplifies and optimises the parse tree in-memory
representation of lists of expressions, for tuples and lists, and when
tuples are used on the left-hand-side of assignments and within del
statements.  This reduces memory usage of the parse tree when such code is
compiled, and also reduces the size of the compiler.

For example, (1,) was previously the following parse tree:

    expr_stmt(5) (n=2)
      atom_paren(45) (n=1)
        testlist_comp(146) (n=2)
          int(1)
          testlist_comp_3b(149) (n=1)
            NULL
      NULL

and with this commit is now:

    expr_stmt(5) (n=2)
      atom_paren(45) (n=1)
        testlist_comp(146) (n=1)
          int(1)
      NULL

Similarly, (1, 2, 3) was previously:

    expr_stmt(5) (n=2)
      atom_paren(45) (n=1)
        testlist_comp(146) (n=2)
          int(1)
          testlist_comp_3c(150) (n=2)
            int(2)
            int(3)
      NULL

and is now:

    expr_stmt(5) (n=2)
      atom_paren(45) (n=1)
        testlist_comp(146) (n=3)
          int(1)
          int(2)
          int(3)
      NULL

Signed-off-by: Damien George <damien@micropython.org>
2021-09-10 14:09:44 +10:00
..
argcheck.c py: Add option to compile without any error messages at all. 2021-04-27 23:51:52 +10:00
asmarm.c py/emitglue: Always flush caches when assigning native ARM code. 2021-06-05 11:03:04 +10:00
asmarm.h py/emitglue: Always flush caches when assigning native ARM code. 2021-06-05 11:03:04 +10:00
asmbase.c
asmbase.h
asmthumb.c py/emitglue: Always flush caches when assigning native ARM code. 2021-06-05 11:03:04 +10:00
asmthumb.h py/emitglue: Always flush caches when assigning native ARM code. 2021-06-05 11:03:04 +10:00
asmx64.c py/asmx64: Support use of top 8 regs in src_r64 argument. 2021-05-20 23:43:25 +10:00
asmx64.h
asmx86.c
asmx86.h
asmxtensa.c
asmxtensa.h
bc.c py: Add option to compile without any error messages at all. 2021-04-27 23:51:52 +10:00
bc.h py: Mark unused arguments from bytecode decoding macros. 2021-06-25 10:58:22 +10:00
bc0.h
binary.c all: Fix signed shifts and NULL access errors from -fsanitize=undefined. 2021-06-24 23:01:04 +10:00
binary.h
builtin.h
builtinevex.c
builtinhelp.c
builtinimport.c py/builtinimport: Fix condition for including do_execute_raw_code(). 2021-07-31 16:51:58 +10:00
compile.c py/parse: Simplify parse nodes representing a list. 2021-09-10 14:09:44 +10:00
compile.h
dynruntime.h py: Introduce and use mp_raise_type_arg helper. 2021-07-15 00:12:41 +10:00
dynruntime.mk
emit.h
emitbc.c all: Rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD. 2021-02-04 22:46:42 +11:00
emitcommon.c
emitglue.c py/emitglue: Always flush caches when assigning native ARM code. 2021-06-05 11:03:04 +10:00
emitglue.h
emitinlinethumb.c py/emitinlinethumb: Exclude code using #if when ARMV7M disabled. 2021-01-29 23:57:10 +11:00
emitinlinextensa.c py: Use unsigned comparison of chars. 2020-10-22 11:47:36 +02:00
emitnarm.c
emitnative.c py/emitnative: Ensure stack settling is safe mid-branch. 2021-07-19 23:18:59 +10:00
emitnthumb.c
emitnx64.c
emitnx86.c
emitnxtensa.c
emitnxtensawin.c
formatfloat.c
formatfloat.h
frozenmod.c
frozenmod.h
gc.c py/gc: Only use no_sanitize_address attribute for GCC 4.8 and above. 2021-06-18 14:15:37 +10:00
gc.h py/gc: Change include of stdint.h to stddef.h. 2021-02-05 15:46:56 +11:00
grammar.h
lexer.c py/lexer: Clear fstring_args vstr on lexer free. 2021-08-19 17:31:02 +10:00
lexer.h py: Implement partial PEP-498 (f-string) support. 2021-08-14 16:58:40 +10:00
makecompresseddata.py
makemoduledefs.py
makeqstrdata.py
makeqstrdefs.py py/makeqstrdefs.py: Don't include .h files explicitly in preprocessing. 2021-06-25 10:50:54 +10:00
makeversionhdr.py py/makeversionhdr: Add --tags arg to git describe. 2021-07-05 10:41:31 -05:00
malloc.c
map.c py/objdict: Add mp_const_empty_dict_obj, use it for mp_const_empty_map. 2020-10-10 00:16:26 +11:00
misc.h stm32: Add implementation of machine.bitstream. 2021-08-19 22:50:32 +10:00
mkenv.mk py/mkrules: Automatically build mpy-cross if it doesn't exist. 2021-08-07 20:25:32 +10:00
mkrules.cmake py/mkrules: Automatically build mpy-cross if it doesn't exist. 2021-08-07 20:25:32 +10:00
mkrules.mk py/mkrules.mk: Do submodule sync in "make submodules". 2021-08-19 22:53:44 +10:00
modarray.c
modbuiltins.c py: Support single argument to optimised MP_OBJ_STOP_ITERATION. 2021-07-15 00:12:41 +10:00
modcmath.c
modcollections.c
modgc.c
modio.c py: Rename remaining object types to be of the form mp_type_xxx. 2021-03-26 13:48:34 +11:00
modmath.c py/modmath: Simplify handling of positional args to reduce code size. 2020-12-14 13:30:56 +11:00
modmicropython.c py/gc: Make gc_lock_depth have a count per thread. 2021-05-10 13:07:16 +10:00
modstruct.c
modsys.c py/modsys: Optimise sys.exit for code size by using exception helpers. 2021-07-15 00:12:41 +10:00
modthread.c py/mpstate: Make exceptions thread-local. 2021-06-19 09:43:44 +10:00
moduerrno.c
mpconfig.h extmod/modonewire: Make _onewire module configurable via macro option. 2021-09-02 13:11:23 +10:00
mperrno.h py/mperrno: Add MP_ECANCELED error code. 2021-06-24 23:14:01 +10:00
mphal.h
mpprint.c py/mpprint: Fix length calculation for strings with precision-modifier. 2020-12-07 23:32:06 +11:00
mpprint.h extmod/modujson: Add support for dump/dumps separators keyword-argument. 2021-08-07 13:52:16 +10:00
mpstate.c
mpstate.h py: Support single argument to optimised MP_OBJ_STOP_ITERATION. 2021-07-15 00:12:41 +10:00
mpthread.h
mpz.c all: Fix signed shifts and NULL access errors from -fsanitize=undefined. 2021-06-24 23:01:04 +10:00
mpz.h
nativeglue.c
nativeglue.h
nlr.c
nlr.h py/nlr: Implement NLR for AArch64. 2021-03-11 12:51:10 +11:00
nlraarch64.c py/nlraarch64: Add underscore prefix to function symbols for Darwin ABI. 2021-05-18 11:46:30 +10:00
nlrpowerpc.c
nlrsetjmp.c
nlrthumb.c
nlrx64.c py/nlrx64: Correct the detection of Darwin ABI. 2021-05-18 11:52:00 +10:00
nlrx86.c
nlrxtensa.c
obj.c py: Add option to compile without any error messages at all. 2021-04-27 23:51:52 +10:00
obj.h py/obj: Fix formatting of comment for mp_obj_is_integer. 2021-07-15 00:12:41 +10:00
objarray.c py/objarray: Fix constructing a memoryview from a memoryview. 2021-05-18 10:18:56 +10:00
objarray.h
objattrtuple.c
objbool.c
objboundmeth.c
objcell.c
objclosure.c py: Rename remaining object types to be of the form mp_type_xxx. 2021-03-26 13:48:34 +11:00
objcomplex.c
objdeque.c
objdict.c extmod/modujson: Add support for dump/dumps separators keyword-argument. 2021-08-07 13:52:16 +10:00
objenumerate.c
objexcept.c py/objexcept: Make mp_obj_new_exception_arg1 inline. 2021-07-15 00:12:41 +10:00
objexcept.h
objfilter.c
objfloat.c py: Rename BITS_PER_BYTE to MP_BITS_PER_BYTE. 2021-02-04 22:46:42 +11:00
objfun.c py: Mark unused arguments from bytecode decoding macros. 2021-06-25 10:58:22 +10:00
objfun.h
objgenerator.c py: Support single argument to optimised MP_OBJ_STOP_ITERATION. 2021-07-15 00:12:41 +10:00
objgenerator.h
objgetitemiter.c py: Support single argument to optimised MP_OBJ_STOP_ITERATION. 2021-07-15 00:12:41 +10:00
objint.c all: Fix signed shifts and NULL access errors from -fsanitize=undefined. 2021-06-24 23:01:04 +10:00
objint.h
objint_longlong.c
objint_mpz.c py/mpz: Do sign extension in mpz_as_bytes for negative values. 2020-11-11 22:18:24 +11:00
objlist.c extmod/modujson: Add support for dump/dumps separators keyword-argument. 2021-08-07 13:52:16 +10:00
objlist.h
objmap.c
objmodule.c
objmodule.h
objnamedtuple.c py: Add option to compile without any error messages at all. 2021-04-27 23:51:52 +10:00
objnamedtuple.h
objnone.c
objobject.c
objpolyiter.c
objproperty.c
objrange.c py: Rename remaining object types to be of the form mp_type_xxx. 2021-03-26 13:48:34 +11:00
objreversed.c
objset.c py: Introduce and use mp_raise_type_arg helper. 2021-07-15 00:12:41 +10:00
objsingleton.c
objslice.c
objstr.c py: Introduce and use mp_raise_type_arg helper. 2021-07-15 00:12:41 +10:00
objstr.h
objstringio.c
objstringio.h
objstrunicode.c py/mpprint: Fix length calculation for strings with precision-modifier. 2020-12-07 23:32:06 +11:00
objtuple.c extmod/modujson: Add support for dump/dumps separators keyword-argument. 2021-08-07 13:52:16 +10:00
objtuple.h
objtype.c py: Add option to compile without any error messages at all. 2021-04-27 23:51:52 +10:00
objtype.h
objzip.c
opmethods.c
pairheap.c
pairheap.h
parse.c py/parse: Simplify parse nodes representing a list. 2021-09-10 14:09:44 +10:00
parse.h
parsenum.c py: Add option to compile without any error messages at all. 2021-04-27 23:51:52 +10:00
parsenum.h
parsenumbase.c
parsenumbase.h
persistentcode.c all: Rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD. 2021-02-04 22:46:42 +11:00
persistentcode.h
profile.c py/mpstate: Make exceptions thread-local. 2021-06-19 09:43:44 +10:00
profile.h
py.cmake py/py.cmake: Introduce MICROPY_INC_CORE as a list with core includes. 2021-04-09 13:08:35 +10:00
py.mk extmod/machine_pwm: Factor out machine.PWM bindings to common code. 2021-09-04 16:31:17 +10:00
pystack.c py: Introduce and use mp_raise_type_arg helper. 2021-07-15 00:12:41 +10:00
pystack.h
qstr.c
qstr.h py/qstr.h: Remove QSTR_FROM_STR_STATIC macro. 2021-01-30 13:40:48 +11:00
qstrdefs.h
reader.c
reader.h
repl.c py/repl: Don't read past the end of import_str. 2021-05-30 11:50:51 +10:00
repl.h
ringbuf.c
ringbuf.h
runtime.c py/runtime: Fix bool unary op for subclasses of native types. 2021-07-23 12:40:00 +10:00
runtime.h py: Introduce and use mp_raise_type_arg helper. 2021-07-15 00:12:41 +10:00
runtime0.h
runtime_utils.c
scheduler.c py/mpstate: Schedule KeyboardInterrupt on main thread. 2021-06-19 09:49:00 +10:00
scope.c py/scope: Name and use id_kind_type_t. 2020-10-22 11:40:56 +02:00
scope.h py/scope: Name and use id_kind_type_t. 2020-10-22 11:40:56 +02:00
sequence.c
showbc.c all: Fix signed shifts and NULL access errors from -fsanitize=undefined. 2021-06-24 23:01:04 +10:00
smallint.c
smallint.h all: Fix signed shifts and NULL access errors from -fsanitize=undefined. 2021-06-24 23:01:04 +10:00
stackctrl.c
stackctrl.h py/stackctrl: Prevent unused-var warning when stack checking disabled. 2021-06-05 11:03:09 +10:00
stream.c
stream.h
unicode.c
unicode.h
usermod.cmake rp2: Add support for USER_C_MODULES to CMake build system. 2021-03-31 00:26:01 +11:00
vm.c py/vm: Simplify handling of MP_OBJ_STOP_ITERATION in yield-from opcode. 2021-07-15 00:12:41 +10:00
vmentrytable.h py/vmentrytable: Ignore GCC -Woverride-init. 2020-10-22 11:47:36 +02:00
vstr.c
warning.c