Example #1
0
def workspace_run(text):
    code = parser.parse_code(text)
    if isinstance(code.expr, terp.Constant) and code.expr.value is None:
        # Special case to add variables to the workspace. I know, yuck.
        for var in code.locals:
            workspace_env.enter(var, None)
    block = terp.Block(text, workspace_env, code) # XXX redundant with hiss.run()
    return terp.trampoline(block.enter((), terp.final_k))
Example #2
0
def parse_block(text, env):
    # XXX why is text the receiver? what was I thinking?
    return terp.Block(text, env, parser.parse_code(text))