1- from error_handler .rtresult import RTResult
2- from utils .token_list import *
3- from number import Number
4- from list import List
1+ from . error_handler .rtresult import RTResult
2+ from . utils .token_list import *
3+ from . number import Number
4+ from . list import List
55
66class Interpreter :
77 def visit (self , node , context ):
@@ -20,7 +20,7 @@ def visit_NumberNode(self, node, context):
2020 )
2121
2222 def visit_StringNode (self , node , context ):
23- from string import String
23+ from . string_value import String
2424 return RTResult ().success (
2525 String (node .tok .value ).set_context (context ).set_pos (node .pos_start , node .pos_end )
2626 )
@@ -43,7 +43,7 @@ def visit_VarAccessNode(self, node, context):
4343 value = context .symbol_table .get (var_name )
4444
4545 if not value :
46- from error_handler .rterror import RTError
46+ from . error_handler .rterror import RTError
4747 return res .failure (RTError (
4848 node .pos_start , node .pos_end ,
4949 f"'{ var_name } ' is not defined" ,
@@ -215,7 +215,7 @@ def visit_FuncDefNode(self, node, context):
215215 body_node = node .body_node
216216 arg_names = [arg_name .value for arg_name in node .arg_name_toks ]
217217
218- from function import Function
218+ from . function import Function
219219 func_value = Function (func_name , body_node , arg_names , node .should_auto_return ).set_context (context ).set_pos (
220220 node .pos_start , node .pos_end )
221221
0 commit comments