diff --git a/lang/compile.py b/lang/compile.py index f48f7eb..f8142c8 100755 --- a/lang/compile.py +++ b/lang/compile.py @@ -831,7 +831,7 @@ ] for i in includes: header += "#include %s\n" % i - header += "static struct object_class module_class;\n\n" + header += "\nstatic struct object_class module_class;\n" return header def generate_module_args(module_args): @@ -872,10 +872,10 @@ bytecode_run(state, obj, (const unsigned char *)priv, *args); }\n\n""" -def generate_footer(verbs): +def generate_footer(functions): footer = """static struct object_call calls[] = {\n""" - for verb in verbs: - footer += "\t" + verb + "\n" + for function in functions: + footer += "\t" + function + "\n" footer += "\t{.name = NULL, /* end */}\n};" footer += """\n static struct object_class module_class = { @@ -917,19 +917,19 @@ output = generate_header(ir, source) output += generate_module_args(module_args) output += generate_callbacks() - verbs = [] + functions = [] for node in ir: next = None if isinstance(node, IRMetadata): next = generate_metadata(node) elif isinstance(node, IRFunction): next = generate_bytecode(node) - verbs.append(generate_call(node)) + functions.append(generate_call(node)) if next is None: print("Can't generate node: %s" % (node)) return None output += next - footer = generate_footer(verbs) + footer = generate_footer(functions) if footer is None: print("Can't generate footer") return None