コード例 #1
0
ファイル: repl.py プロジェクト: jesyspa/Sparse
def main():
    """Run the REPL."""
    interp = SInterpreter()
    while True:
        try:
            line = input('>>> ')
            while line.count('(') > line.count(')'):
                line += ' ' + input('... ' + ' ' * 2 * (line.count('(') -
                    line.count(')')))
            if line.count('(') < line.count(')'):
                raise Exception("Too many closing parentheses.")
            sprint(interp.seval(line))
        except EOFError:
            print('Bye')
            return
        except SException as e:
            print('Error:', e)
コード例 #2
0
ファイル: fuzz_test.py プロジェクト: jesyspa/Sparse
def do_fuzz(program, env):
    try:
        sprint(program)
        seval_tree(program, env)
    except SException:
        pass
コード例 #3
0
ファイル: fuzz_test.py プロジェクト: jesyspa/Sparse
def record_issue(program, e):
    print("Issue found with:")
    sprint(program)
    print("Error: ", e)
コード例 #4
0
ファイル: stdenv.py プロジェクト: jesyspa/Sparse
def _print(env, quote):
    sprint(quote)
    return SNode('none', None)