diff options
author | Damien George <damien.p.george@gmail.com> | 2017-08-30 11:51:25 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-08-30 11:51:25 +1000 |
commit | 414537711dd05531c63eb830bfc9c3eecf657b1e (patch) | |
tree | e885b26c0e1ef94b189955546015893d704aaa1e /py/parse2.h | |
parent | 39b465ca831d0ec866c2a137dccbfec7f7badfba (diff) |
py: Add MICROPY_USE_SMALL_HEAP_COMPILER option, disabled by default.
This new option allows the original and new parser/compiler to coexist.
Diffstat (limited to 'py/parse2.h')
-rw-r--r-- | py/parse2.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/py/parse2.h b/py/parse2.h index 82d963945..55b05e062 100644 --- a/py/parse2.h +++ b/py/parse2.h @@ -23,14 +23,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_PY_PARSE_H -#define MICROPY_INCLUDED_PY_PARSE_H +#ifndef MICROPY_INCLUDED_PY_PARSE2_H +#define MICROPY_INCLUDED_PY_PARSE2_H #include <stddef.h> #include <stdint.h> #include "py/obj.h" +#if MICROPY_USE_SMALL_HEAP_COMPILER + struct _mp_lexer_t; #define MP_PT_NULL (0) @@ -42,6 +44,8 @@ struct _mp_lexer_t; #define MP_PT_ID_BASE (10) // +16 #define MP_PT_RULE_BASE (26) // +173-ish +typedef const byte *mp_parse_node_t; + extern const byte pt_const_int0[]; static inline const byte *pt_tok_extract(const byte *p, byte *tok) { @@ -130,4 +134,6 @@ typedef struct _mp_parse_t { mp_parse_tree_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind); void mp_parse_tree_clear(mp_parse_tree_t *tree); -#endif // MICROPY_INCLUDED_PY_PARSE_H +#endif // MICROPY_USE_SMALL_HEAP_COMPILER + +#endif // MICROPY_INCLUDED_PY_PARSE2_H |