Skip to content

Commit

Permalink
Fix passing subresults in dynamic filter
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Jun 26, 2021
1 parent 8f69caa commit 65a1cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parglare/glr.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ def _reduce(self, head, root_head, production, node_nonterm,

if self.dynamic_filter and \
not self._call_dynamic_filter(parent, head.state, state,
REDUCE, production, node_nonterm):
REDUCE, production,
list(node_nonterm)):
# Action rejected by dynamic filter
return

Expand Down
2 changes: 2 additions & 0 deletions tests/func/parsing/test_dynamic_disambiguation_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def custom_disambiguation_filter(context, from_state, to_state, action,
operations = []
return

assert subresults is None or isinstance(subresults, list)

if action is SHIFT:
operation = context.token.symbol
else:
Expand Down

0 comments on commit 65a1cbf

Please sign in to comment.