Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix with entry/exit behavior on no node type in jac cloud #1353

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions jac-cloud/jac_cloud/plugin/jaseci.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,15 @@ def spawn_call(op1: Architype, op2: Architype) -> WalkerArchitype:
walker.path = []
walker.next = [node]
walker.returns = []

if walker.next:
current_node = walker.next[-1].architype
for i in warch._jac_entry_funcs_:
if not i.trigger:
if i.func:
walker.returns.append(i.func(warch, current_node))
else:
raise ValueError(f"No function {i.name} to call.")
while len(walker.next):
if current_node := walker.next.pop(0).architype:
for i in current_node._jac_entry_funcs_:
Expand All @@ -730,16 +739,20 @@ def spawn_call(op1: Architype, op2: Architype) -> WalkerArchitype:
return warch
for i in warch._jac_entry_funcs_:
if not i.trigger or isinstance(current_node, i.trigger):
if i.func:
if i.func and i.trigger:
walker.returns.append(i.func(warch, current_node))
elif not i.trigger:
continue
else:
raise ValueError(f"No function {i.name} to call.")
if walker.disengaged:
return warch
for i in warch._jac_exit_funcs_:
if not i.trigger or isinstance(current_node, i.trigger):
if i.func:
if i.func and i.trigger:
walker.returns.append(i.func(warch, current_node))
elif not i.trigger:
continue
else:
raise ValueError(f"No function {i.name} to call.")
if walker.disengaged:
Expand All @@ -752,6 +765,12 @@ def spawn_call(op1: Architype, op2: Architype) -> WalkerArchitype:
raise ValueError(f"No function {i.name} to call.")
if walker.disengaged:
return warch
for i in warch._jac_exit_funcs_:
if not i.trigger:
if i.func:
walker.returns.append(i.func(warch, current_node))
else:
raise ValueError(f"No function {i.name} to call.")
walker.ignores = []
return warch

Expand Down
Loading