summaryrefslogtreecommitdiff
path: root/py/lexer.c
AgeCommit message (Collapse)Author
2014-06-27lexer, vstr: Add unicode support.Chris Angelico
2014-06-21py: Include mpconfig.h before all other includes.Paul Sokolovsky
It defines types used by all other headers. Fixes #691.
2014-06-19Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot
2014-06-14unicode: String API is const byte*.Paul Sokolovsky
We still have that char vs byte dichotomy, but majority of string operations now use byte.
2014-06-03py: Instead of having "debug on" var, have "optimization level" var.Paul Sokolovsky
This allows to have multiple "optimization" levels (CPython has two (-OO removes docstrings), we can have more).
2014-06-02lexer: Add another comment for somewhat obscure way __debug__ is handled.Paul Sokolovsky
2014-05-21Tidy up some configuration options.Damien George
MP_ALLOC_* -> MICROPY_ALLOC_* MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX MICROPY_EXTRA_* -> MICROPY_PORT_* See issue #35.
2014-05-12py: Add support for __debug__ constant.Damien George
__debug__ now resolves to True or False. Its value needs to be set by mp_set_debug(). TODO: call mp_set_debug in unix/ port. TODO: optimise away "if False:" statements in compiler.
2014-05-10py, lexer: Add allocation policy config; return NULL if can't allocate.Damien George
2014-05-03Add license header to (almost) all files.Damien George
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
2014-04-10py: Fix lexer so it doesn't allow ! and ..Damien George
2014-04-10py, lexer: Fix parsing of raw strings (allow escaping of quote).Damien George
2014-03-17py: Clean up includes.xbe
Remove unnecessary includes. Add includes that improve portability.
2014-03-15Add vstr_ins and vstr_cut_out; improve stmhal readline.Damien George
2014-02-15Implement proper exception type hierarchy.Damien George
Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
2014-02-12Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky
2014-01-25Implement mp_parse_node_free; print properly repr(string).Damien George
2014-01-23mp_lexer_free(): Free lex->indent_level array.Paul Sokolovsky
2014-01-22Fix 1 warning and 1 bug.Damien George
2014-01-22Implement octal and hex escapes in strings.Paul Sokolovsky
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-18Add source file name and line number to error messages.Damien George
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
2014-01-15Convert parse errors to exceptions.Damien George
Parser no longer prints an error, but instead returns an exception ID and message.
2014-01-13Add "buffer management" and "shrink" API calls to vstr.Paul Sokolovsky
vstr is initially intended to deal with arbitrary-length strings. By providing a bit lower-level API calls, it will be also useful to deal with arbitrary-length I/O buffers (the difference from strings is that buffers are filled from "outside", via I/O). Another issue, especially aggravated by I/O buffer use, is alloc size vs actual size length. If allocated 1Mb for buffer, but actually read 1 byte, we don't want to keep rest of 1Mb be locked by this I/O result, but rather return it to heap ASAP ("shrink" buffer before passing it to qstr_from_str_take()).
2014-01-12py: Improve memory management for parser; add lexer error for bad line cont.Damien George
2014-01-04Add ellipsis object.Damien George
2013-12-30Put unicode functions in unicode.c, and tidy their names.Damien George
2013-12-29Change memory allocation API to require size for free and realloc.Damien
2013-12-21Change object representation from 1 big union to individual structs.Damien
A big change. Micro Python objects are allocated as individual structs with the first element being a pointer to the type information (which is itself an object). This scheme follows CPython. Much more flexible, not necessarily slower, uses same heap memory, and can allocate objects statically. Also change name prefix, from py_ to mp_ (mp for Micro Python).
2013-10-22Improve REPL compount statement detection.Damien
2013-10-22gc: reserve first block; lexer: free vstr.Damien
2013-10-20Integrate new lexer stream with stm framework.Damien
2013-10-20Abstract out back-end stream functionality from lexer.Damien
2013-10-18Fix up insertion of newline at end of lexer stream.Damien
2013-10-09Improve indent/dedent error checking and reporting.Damien
2013-10-04Initial commit.Damien