Skip to content
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
4 changes: 2 additions & 2 deletions src/ultk/language/grammar/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def _and(p1: bool, p2: bool) -> bool:
# parameters = {'name': Parameter} ordereddict, so we want the values
# each value is a Paramter, with .annotation being the actual annotation
rhs: tuple[Any, ...] | None = tuple(arg.annotation for arg in args.values())
# if one type annotation, a type of Referent, treat this as a terminal, no children = None RHS
# if one type annotation is class, a type of Referent, treat this as a terminal, no children = None RHS
# TODO: make this more general?
if rhs and len(rhs) == 1 and issubclass(rhs[0], Referent):
if rhs and len(rhs) == 1 and inspect.isclass(rhs[0]) and issubclass(rhs[0], Referent):
rhs = None
return cls(
name=rule_name,
Expand Down
Loading