This commit is contained in:
Andreas Koepf 2025-01-30 22:55:04 +01:00
parent 21c47db6c1
commit ebb88e6c6a
24 changed files with 1215 additions and 814 deletions

View file

@ -1,4 +1,5 @@
from copy import deepcopy
from .Exceptions import BFSemanticError
functions = dict() # Global dictionary of function_name --> FunctionCompiler objects
@ -30,4 +31,7 @@ def check_function_exists(function_token, parameters_amount):
function = functions[function_name]
if len(function.parameters) != parameters_amount:
raise BFSemanticError("Function '%s' has %s parameters (called it with %s parameters)" % (str(function_token), len(function.parameters), parameters_amount))
raise BFSemanticError(
"Function '%s' has %s parameters (called it with %s parameters)"
% (str(function_token), len(function.parameters), parameters_amount)
)