Skip to content

Commit

Permalink
one more fix for dasgate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CICS-Oleg committed Mar 18, 2024
1 parent a567dfc commit 1878e80
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/hyperon/exts/das_gate/dasgate.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ def _handle2atom3(self, h):
elif h['type']=='Expression':
return E(*[self._handle2atom3(ch) for ch in h['targets']])

def _handle2atom4(self, h):
h = self.das.get_atom(h)
if h['type']=='Symbol':
return S(h['name'])
elif h['type']=='Expression':
return E(*[self._handle2atom3(ch) for ch in h['targets']])

def query(self, query_atom):
query = self._atom2dict_new(query_atom)
query_params = {
Expand All @@ -132,7 +139,7 @@ def query(self, query_atom):
mapping = dict(ast.literal_eval(a[0]))
for var, val in mapping.items():
# remove '$', because it is automatically added
bindings.add_var_binding(V(var[1:]), self._handle2atom(val))
bindings.add_var_binding(V(var[1:]), self._handle2atom4(val))
new_bindings_set.push(bindings)

return new_bindings_set
Expand Down

0 comments on commit 1878e80

Please sign in to comment.