Move CallHandlerRegistry to expr/call_registry.py, annotate eval_expr

This commit is contained in:
Pragyansh Chaturvedi
2025-10-13 04:16:22 +05:30
parent 45e6ce5e5c
commit 7a67041ea3
3 changed files with 130 additions and 106 deletions

View File

@ -0,0 +1,20 @@
class CallHandlerRegistry:
"""Registry for handling different types of calls (helpers, etc.)"""
_handler = None
@classmethod
def set_handler(cls, handler):
"""Set the handler for unknown calls"""
cls._handler = handler
@classmethod
def handle_call(
cls, call, module, builder, func, local_sym_tab, map_sym_tab, structs_sym_tab
):
"""Handle a call using the registered handler"""
if cls._handler is None:
return None
return cls._handler(
call, module, builder, func, local_sym_tab, map_sym_tab, structs_sym_tab
)