Ejemplo n.º 1
0
def declaration_test1():
    try:
        text = "int number = 10;"
        my_interpreter = Interpreter(text)
        result = my_interpreter.interpret()
        passed_tests.push("declaration_test1")
    except:
        failed_tests["declaration_test1"] = traceback.format_exc(
        )  #.split("\n")[-2]
Ejemplo n.º 2
0
def declaration_test1():
    try:
        text = "int number = 10;"
        my_interpreter = Interpreter(text)
        result = my_interpreter.interpret()
        passed_tests.push("declaration_test1")
    except:
        failed_tests[
            "declaration_test1"] = traceback.format_exc()#.split("\n")[-2]
Ejemplo n.º 3
0
def main():
    while True:
        try:
            text = input('sam> ')
        except EOFError:
            break
        if not text:
            continue

        my_interpreter = Interpreter(text)
        result = my_interpreter.interpret()
        print(result)