- Feb 16, 2017
-
-
Damien George authored
It's not needed.
-
- Jan 30, 2017
-
-
Damien George authored
-
- Jan 27, 2017
-
-
Damien George authored
This provides mp_vfs_XXX functions (eg mount, open, listdir) which are agnostic to the underlying filesystem type, and just require an object with the relevant filesystem-like methods (eg .mount, .open, .listidr) which can then be mounted. These mp_vfs_XXX functions would typically be used by a port to implement the "uos" module, and mp_vfs_open would be the builtin open function. This feature is controlled by MICROPY_VFS, disabled by default.
-
- Dec 21, 2016
-
-
Damien George authored
The lexer is very mature and this debug function is no longer used. If it's really needed one can uncomment it and recompile.
-
Damien George authored
This check always fails (ie chr0 is never EOF) because the callers of this function never call it past the end of the input stream. And even if they did it would be harmless because 1) reader.readbyte must continue to return an EOF char if the stream is exhausted; 2) next_char would just count the subsequent EOF's as characters worth 1 column.
-
Damien George authored
-
Damien George authored
-
- Nov 16, 2016
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
If a port defines MICROPY_READER_POSIX or MICROPY_READER_FATFS then lexer.c now provides an implementation of mp_lexer_new_from_file using the mp_reader_new_file function.
-
Damien George authored
-
- Oct 12, 2016
-
-
Damien George authored
Setting emit_dent=0 is unnecessary because arriving in that part of the if-logic will guarantee that emit_dent is already zero. The block to check indent_top(lex)>0 is unreachable because a newline is always inserted an the end of the input stream, and hence dedents are always processed before EOF.
-
- Sep 19, 2016
-
-
Damien George authored
The vstr.had_error flag was a relic from the very early days which assumed that the malloc functions (eg m_new, m_renew) returned NULL if they failed to allocate. But that's no longer the case: these functions will raise an exception if they fail. Since it was impossible for had_error to be set, this patch introduces no change in behaviour. An alternative option would be to change the malloc calls to the _maybe variants, which return NULL instead of raising, but then a lot of code will need to explicitly check if the vstr had an error and raise if it did. The code-size savings for this patch are, in bytes: bare-arm:188, minimal:456, unix(NDEBUG,x86-64):368, stmhal:228, esp8266:360.
-
- May 20, 2016
-
-
Damien George authored
Otherwise some compilers (eg without optimisation) will put this read-only data in RAM instead of ROM.
-
- Apr 13, 2016
-
-
pohmelie authored
They are sugar for marking function as generator, "yield from" and pep492 python "semantically equivalents" respectively. @dpgeorge was the original author of this patch, but @pohmelie made changes to implement `async for` and `async with`.
-
- Feb 25, 2016
-
-
Damien George authored
This new compile-time option allows to make the bytecode compiler configurable at runtime by setting the fields in the mp_dynamic_compiler structure. By using this feature, the compiler can generate bytecode that targets any MicroPython runtime/VM, regardless of the host and target compile-time settings. Options so far that fall under this dynamic setting are: - maximum number of bits that a small int can hold; - whether caching of lookups is used in the bytecode; - whether to use unicode strings or not (lexer behaviour differs, and therefore generated string constants differ).
-
- Dec 18, 2015
-
-
Damien George authored
MICROPY_ENABLE_COMPILER can be used to enable/disable the entire compiler, which is useful when only loading of pre-compiled bytecode is supported. It is enabled by default. MICROPY_PY_BUILTINS_EVAL_EXEC controls support of eval and exec builtin functions. By default they are only included if MICROPY_ENABLE_COMPILER is enabled. Disabling both options saves about 40k of code size on 32-bit x86.
-
- Sep 07, 2015
-
-
Damien George authored
Eg 0e0 almost looks like a hex number but in fact is a float.
-
Damien George authored
-
Damien George authored
-
- Jul 23, 2015
-
-
Damien George authored
Addresses issue #1390.
-
- Jun 22, 2015
-
-
Damien George authored
This allows stmhal to be compiled with MICROPY_DEBUG_PRINTERS.
-
- Jun 09, 2015
-
-
Damien George authored
Enabled simply by making the identifier lexing code 8-bit clean.
-
- May 20, 2015
-
-
Dave Hylands authored
This also pulls out hex_digit from py/lexer.c and makes unichar_hex_digit
-
- Mar 19, 2015
-
-
Damien George authored
-
- Feb 08, 2015
-
-
Damien George authored
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.
-
- Jan 30, 2015
-
-
Damien George authored
Only noticeable difference is how newlines are encoded in triple-quoted strings. The behaviour now matches CPython3.
-
- Jan 28, 2015
-
-
Damien George authored
-
- Jan 16, 2015
-
-
Damien George authored
See issue #699.
-
- Jan 07, 2015
-
-
Damien George authored
This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 05, 2014
-
-
Damien George authored
-
Damien George authored
mp_lexer_t type is exposed, mp_token_t type is removed, and simple lexer functions (like checking current token kind) are now inlined. This saves 784 bytes ROM on 32-bit unix, 348 bytes on stmhal, and 460 bytes on bare-arm. It also saves a tiny bit of RAM since mp_lexer_t is a bit smaller. Also will run a bit more efficiently.
-
- Oct 09, 2014
-
-
Damien George authored
-
- Jul 30, 2014
-
-
Damien George authored
Lexer is now 8-bit clean inside strings.
-
- Jul 03, 2014
-
-
Damien George authored
-
- Jun 26, 2014
-
-
Chris Angelico authored
-
- Jun 21, 2014
-
-
Paul Sokolovsky authored
It defines types used by all other headers. Fixes #691.
-
- Jun 19, 2014
-
-
Emmanuel Blot authored
-
- Jun 14, 2014
-
-
Paul Sokolovsky authored
We still have that char vs byte dichotomy, but majority of string operations now use byte.
-