class Interpreter:
    _errors = []

    def evaluate(self, ast, functions={}):
        result = None
        for entity in ast.children:
            result = self._evaluate_entity(entity, functions)

        return result

    def get_errors(self):
        return self._errors

    def _evaluate_entity(self, entity, functions):
        if entity.name == 'INTEGRAL_NUMBER':
            return int(entity.value)
        elif entity.name == 'REAL_NUMBER':
            return float(entity.value)
        elif entity.name == 'CHARACTER':
            return ord(self._remove_quotes(entity.value))
        elif entity.name == 'STRING':
            return self._remove_quotes(entity.value)
        elif entity.name == 'IDENTIFIER':
            return functions[entity.value]()
        elif entity.name == 'function':
            raise Exception("not yet implement")
        elif entity.name == 'call':
            raise Exception("not yet implement")

    def _remove_quotes(self, string):
        return string[1:-1]

    def _evaluate_call(self, call):
        return 12

if __name__ == '__main__':
    import function_type
    import read_code
    import lexer
    import preparser
    import parser

    FUNCTIONS = {
        'ans': function_type.make_type([], handler=lambda: 42),
        '~': function_type.make_type([1], handler=lambda x: -x),
        '+': function_type.make_type([2], handler=lambda x, y: x + y),
        '-': function_type.make_type([2], handler=lambda x, y: x - y),
        '*': function_type.make_type([2], handler=lambda x, y: x * y),
        '/': function_type.make_type([2], handler=lambda x, y: x / y),
        '%': function_type.make_type([2], handler=lambda x, y: x % y)
    }

    code = read_code.read_code()
    specific_lexer = lexer.Lexer()
    specific_preparser = preparser.Preparser(specific_lexer)
    preast = specific_preparser.preparse(code)
    specific_parser = parser.Parser()
    ast = specific_parser.parse(preast, FUNCTIONS)
    print(ast)
    interpreter = Interpreter()
    result = interpreter.evaluate(ast, FUNCTIONS)
    print(result)

    for some_error in specific_lexer.get_errors() + specific_preparser.get_errors() + specific_parser.get_errors() + interpreter.get_errors():
        some_error.detect_position(code)
        print(some_error)

@@ -731,22 +731,26 @@
         
-return
+function =
  functio
@@ -765,16 +765,133 @@
 y.value%5D
+%0A            if function.arity %3E 0:%0A                return function%0A            else:%0A                return function
 ()%0A     
@@ -1027,42 +1027,51 @@
    r
-aise Exception(%22not yet implement%22
+eturn self._evaluate_call(entity, functions
 )%0A%0A 
@@ -1173,28 +1173,274 @@
 call
-):%0A        return 12
+, functions):%0A        inner_function = self._evaluate_entity(call.children%5B0%5D.children%5B0%5D.children%5B0%5D, functions)%0A        parameters = %5Bself._evaluate_entity(parameter, functions) for parameter in call.children%5B1%5D.children%5D%0A        return inner_function(*parameters)
 %0A%0Aif

Add an evaluation of calls