Ejemplo n.º 1
0
def repl(source):

    env = prelude()
    
    import parse
    for expr in parse.loop(source):
        with error.reporting():
            value = eval(env, expr)
            if value is not None:
                print( '::', type(value).__name__, '=', value )
Ejemplo n.º 2
0
    # a typestate for closure conversion
    cc = codegen.TypeState()
    cc.ctx.update( ts.ctx )
    cs.info = cc

    
import sys
import io
import os
import tempfile


for expr in parse.loop(source):
    
    with error.reporting():

        node = ast.toplevel( expr )
        poly = hm.toplevel(ts, node )
        
        
        try:
            out = node.name
        except AttributeError:
            out = '-'

        out += ' : ' + str(poly)

        ts.cleanup()
        if not args.codegen:
            print(out)