mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
feat: blackbox call
This commit is contained in:
@ -4,7 +4,8 @@ class Runtime:
|
||||
self.parent = parent
|
||||
self.records = records
|
||||
|
||||
def run(self, ast):
|
||||
def run(self, ast, records={}):
|
||||
self.records.update(records)
|
||||
if ast["type"] == "Program":
|
||||
return self.program(ast)
|
||||
|
||||
@ -44,6 +45,8 @@ class Runtime:
|
||||
for arg in args:
|
||||
unquoted_args.append(self.unquote(arg))
|
||||
fu = self.records.get(id)
|
||||
if fu == None:
|
||||
raise Exception("Function not found: " + id)
|
||||
return fu(*unquoted_args)
|
||||
|
||||
def unquote(self, ast):
|
||||
|
||||
Reference in New Issue
Block a user