def compile_with_standard_library(vbs: SourceFile) -> Result: cpl = Compiler() ast = Parser.parse_file(vbs) cpl.add_module(ast, reference.ProceduralModule, "main_module") program = cpl.link_standard_library(cpl.program) return program.to_dict()
def interpreting(vbs: SourceFile) -> Result: ast = Parser.parse_file(vbs) comp = Compiler() comp.add_module(ast, reference.ProceduralModule, "main_module") program = comp.link_standard_library(comp.program) interp = interpreter.Interpreter(program) interp.run("Main") return interp._outside_world.to_dict(reproducible=True)
def execute_program(program: Program, entry_point: str) -> None: linked_program = Compiler.link_standard_library(program) return Interpreter.run_program(linked_program, entry_point)