aboutsummaryrefslogtreecommitdiff
path: root/py/compile.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-13 13:38:28 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-20 12:30:37 +0000
commitd4dba8823655c2715867f4d64e407de390c9d29e (patch)
treed1161baf36d6af39738fbe58b1343c67803b1dc3 /py/compile.h
parentf5c554dfe3da8564196a7bd65233171f40b7f8d4 (diff)
py/compile: Add mp_compile_to_raw_code() to return raw code object.
This can then be passed to mp_raw_code_save_file to save a .mpy file.
Diffstat (limited to 'py/compile.h')
-rw-r--r--py/compile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/compile.h b/py/compile.h
index d3a64ba8a..3cca4cb30 100644
--- a/py/compile.h
+++ b/py/compile.h
@@ -43,6 +43,11 @@ enum {
// the compiler will clear the parse tree before it returns
mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint emit_opt, bool is_repl);
+#if MICROPY_PERSISTENT_CODE_SAVE
+// this has the same semantics as mp_compile
+mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_file, uint emit_opt, bool is_repl);
+#endif
+
// this is implemented in runtime.c
mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_input_kind, mp_obj_dict_t *globals, mp_obj_dict_t *locals);