コード例 #1
0
ファイル: importing.py プロジェクト: markrwilliams/typhon
def evaluateWithTraces(code, scope):
    try:
        machine = SmallCaps.withDictScope(code, scope)
        machine.run()
        return machine.pop()
    except UserException as ue:
        debug_print("Caught exception:", ue.formatError())
        return None
コード例 #2
0
ファイル: importing.py プロジェクト: washort/typhon
def evaluateWithTraces(code, scope):
    try:
        machine = SmallCaps.withDictScope(code, scope)
        machine.run()
        return machine.pop()
    except UserException as ue:
        debug_print("Caught exception:", ue.formatError())
        return None
コード例 #3
0
ファイル: importing.py プロジェクト: markrwilliams/typhon
def evaluateRaise(codes, scope):
    """
    Like evaluateTerms, but does not catch exceptions.
    """

    env = None
    result = NullObject
    for code in codes:
        machine = SmallCaps.withDictScope(code, scope)
        machine.run()
        result = machine.pop()
        env = machine.env
    return result, env
コード例 #4
0
ファイル: importing.py プロジェクト: washort/typhon
def evaluateRaise(codes, scope):
    """
    Like evaluateTerms, but does not catch exceptions.
    """

    env = None
    result = NullObject
    for code in codes:
        machine = SmallCaps.withDictScope(code, scope)
        machine.run()
        result = machine.pop()
        env = machine.env
    return result, env