micropython/extmod
Damien George 1831034be1 py: Allow lexer to raise exceptions during construction.
This patch refactors the error handling in the lexer, to simplify it (ie
reduce code size).

A long time ago, when the lexer/parser/compiler were first written, the
lexer and parser were designed so they didn't use exceptions (ie nlr) to
report errors but rather returned an error code.  Over time that has
gradually changed, the parser in particular has more and more ways of
raising exceptions.  Also, the lexer never really handled all errors without
raising, eg there were some memory errors which could raise an exception
(and in these rare cases one would get a fatal nlr-not-handled fault).

This patch accepts the fact that the lexer can raise exceptions in some
cases and allows it to raise exceptions to handle all its errors, which are
for the most part just out-of-memory errors during construction of the
lexer.  This makes the lexer a bit simpler, and also the persistent code
stuff is simplified.

What this means for users of the lexer is that calls to it must be wrapped
in a nlr handler.  But all uses of the lexer already have such an nlr
handler for the parser (and compiler) so that doesn't put any extra burden
on the callers.
2017-03-14 11:52:05 +11:00
..
crypto-algorithms
lwip-include
re1.5
uzlib
machine_i2c.c extmod/machine_i2c: Add hook to constructor to call port-specific code. 2016-11-24 00:12:51 +11:00
machine_i2c.h extmod/machine_i2c: Expose soft I2C obj and readfrom/writeto funcs. 2016-11-24 00:11:45 +11:00
machine_mem.c extmod/machine_mem: Typo fix in comment. 2016-11-21 01:09:17 +03:00
machine_mem.h
machine_pinbase.c
machine_pinbase.h
machine_pulse.c extmod/machine_pulse: Make time_pulse_us() not throw exceptions. 2017-02-05 14:20:17 +03:00
machine_pulse.h
machine_signal.c extmod/machine_signal: Implement Signal .on() and .off() methods. 2017-02-08 11:14:23 +03:00
machine_signal.h extmod/machine_signal: Implement "signal" abstraction for machine module. 2017-01-29 18:57:36 +03:00
machine_spi.c extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func. 2017-02-06 14:38:33 +11:00
machine_spi.h extmod/machine_spi: Provide reusable software SPI class. 2016-12-08 13:47:01 +11:00
misc.h
modbtree.c py: Add iter_buf to getiter type method. 2017-02-16 18:38:06 +11:00
modframebuf.c extmod/modframebuf: Add GS4_HMSB format. 2017-01-25 23:19:28 +11:00
modlwip.c extmod/modlwip: Add my copyright. 2017-02-15 19:20:46 +03:00
modubinascii.c
modubinascii.h
moductypes.c
moduhashlib.c
moduheapq.c extmod/moduheapq: Revert change for adhoc relative-time queue support. 2016-12-22 06:37:49 +03:00
modujson.c
modurandom.c extmod/modurandom: Use mp_raise_ValueError(). 2017-02-24 10:04:23 -05:00
modure.c
moduselect.c extmod/moduselect: Use configurable EVENT_POLL_HOOK instead of WFI. 2016-12-02 16:40:39 +11:00
modussl_axtls.c all: Remove readall() method, which is equivalent to read() w/o args. 2016-11-14 00:24:22 +03:00
modussl_mbedtls.c all: Remove readall() method, which is equivalent to read() w/o args. 2016-11-14 00:24:22 +03:00
modutimeq.c extmod/modutimeq: Make scheduling fair (round-robin). 2017-03-07 09:34:09 +01:00
moduzlib.c all: Remove readall() method, which is equivalent to read() w/o args. 2016-11-14 00:24:22 +03:00
modwebrepl.c
modwebsocket.c
modwebsocket.h
uos_dupterm.c extmod/moduos_dupterm: Renamed to uos_dupterm. 2016-10-26 02:08:37 +03:00
utime_mphal.c extmod/utime_mphal: ticks_diff/ticks_add: Don't hardcode 32-bit types. 2016-11-03 23:54:16 +03:00
utime_mphal.h extmod/utime_mphal: Implement ticks_add(), add to all maintained ports. 2016-10-29 17:30:05 +03:00
vfs.c extmod/vfs: Rewrite path lookup algo to support relative paths from root. 2017-03-13 21:37:21 +11:00
vfs.h extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h. 2017-01-30 12:26:08 +11:00
vfs_fat.c extmod/vfs_fat: Remove obsolete and unused str/len members. 2017-03-10 19:09:42 +11:00
vfs_fat.h extmod/vfs_fat: Remove obsolete and unused str/len members. 2017-03-10 19:09:42 +11:00
vfs_fat_diskio.c extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled. 2017-03-13 21:23:31 +11:00
vfs_fat_file.c extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled. 2017-03-13 21:23:31 +11:00
vfs_fat_misc.c extmod/vfs_fat: Remove unused function fat_vfs_listdir. 2017-01-30 12:26:08 +11:00
vfs_reader.c py: Allow lexer to raise exceptions during construction. 2017-03-14 11:52:05 +11:00
virtpin.c
virtpin.h