summaryrefslogtreecommitdiffstatshomepage
path: root/py/parse.h
Commit message (Collapse)AuthorAge
* py: Check explicitly for memory allocation failure in parser.Damien George2014-04-10
| | | | | | Previously, a failed malloc/realloc would throw an exception, which was not caught. I think it's better to keep the parser free from NLR (exception throwing), hence this patch.
* py: Put number parsing code together in parsenum.c.Damien George2014-02-22
|
* parse: Refactor parse node encoding to support full range of small ints.Paul Sokolovsky2014-02-22
| | | | | Based on suggestion by @dpgeorge at https://github.com/micropython/micropython/pull/313
* parse: Note that fact that parser's small ints are different than VM small int.Paul Sokolovsky2014-02-21
| | | | | | Specifically, VM's small ints are 31 bit, while parser's only 28. There's already MP_OBJ_FITS_SMALL_INT(), so, for clarity, rename MP_FIT_SMALL_INT() to MP_PARSE_FITS_SMALL_INT().
* Implement proper exception type hierarchy.Damien George2014-02-15
| | | | | | | | | | | | | | 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.
* Implement mp_parse_node_free; print properly repr(string).Damien George2014-01-25
|
* Add parse_node_free_struct() and use it to free parse tree after compilation.Paul Sokolovsky2014-01-25
| | | | TODO: Check lexer/parse/compile error path for leaks too.
* py: Add module/function/class name to exceptions.Damien George2014-01-19
| | | | | | | Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
* Add source file name and line number to error messages.Damien George2014-01-18
| | | | | Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
* Convert parse errors to exceptions.Damien George2014-01-15
| | | | | Parser no longer prints an error, but instead returns an exception ID and message.
* Change object representation from 1 big union to individual structs.Damien2013-12-21
| | | | | | | | | | 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).
* Implement REPL.Damien2013-10-18
|
* Tidy up SMALL_INT optimisations and CPython compatibility.Damien2013-10-12
|
* Initial commit.Damien2013-10-04