Commit b140bff8 authored by Damien George's avatar Damien George
Browse files

py, compile: Simplify initialisation of compiler structure.

parent 02a4c05c
...@@ -3196,21 +3196,9 @@ void compile_scope_compute_things(compiler_t *comp, scope_t *scope) { ...@@ -3196,21 +3196,9 @@ void compile_scope_compute_things(compiler_t *comp, scope_t *scope) {
} }
mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is_repl) { mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is_repl) {
compiler_t *comp = m_new(compiler_t, 1); compiler_t *comp = m_new0(compiler_t, 1);
comp->source_file = source_file; comp->source_file = source_file;
comp->is_repl = is_repl; comp->is_repl = is_repl;
comp->had_error = false;
comp->break_label = 0;
comp->continue_label = 0;
comp->break_continue_except_level = 0;
comp->cur_except_level = 0;
comp->func_arg_is_super = false;
comp->scope_head = NULL;
comp->scope_cur = NULL;
// optimise constants // optimise constants
pn = fold_constants(pn); pn = fold_constants(pn);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment