py/emit: Move MP_EMIT_OPT_xxx enums from compile.h to emitglue.h.

This commit is contained in:
Damien George 2018-09-15 12:15:19 +10:00
parent abb536da49
commit 3751512e9d
3 changed files with 10 additions and 10 deletions

View File

@ -30,15 +30,6 @@
#include "py/parse.h"
#include "py/emitglue.h"
// These must fit in 8 bits; see scope.h
enum {
MP_EMIT_OPT_NONE,
MP_EMIT_OPT_BYTECODE,
MP_EMIT_OPT_NATIVE_PYTHON,
MP_EMIT_OPT_VIPER,
MP_EMIT_OPT_ASM,
};
// the compiler will raise an exception if an error occurred
// 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);

View File

@ -30,6 +30,15 @@
// These variables and functions glue the code emitters to the runtime.
// These must fit in 8 bits; see scope.h
enum {
MP_EMIT_OPT_NONE,
MP_EMIT_OPT_BYTECODE,
MP_EMIT_OPT_NATIVE_PYTHON,
MP_EMIT_OPT_VIPER,
MP_EMIT_OPT_ASM,
};
typedef enum {
MP_CODE_UNUSED,
MP_CODE_RESERVED,

View File

@ -75,7 +75,7 @@ typedef struct _scope_t {
uint16_t simple_name; // a qstr
mp_raw_code_t *raw_code;
uint8_t scope_flags; // see runtime0.h
uint8_t emit_options; // see compile.h
uint8_t emit_options; // see emitglue.h
uint16_t num_pos_args;
uint16_t num_kwonly_args;
uint16_t num_def_pos_args;