Skip to content

Commit

Permalink
Rename parse.retree.BaseVisitor to pass-through (#500)
Browse files Browse the repository at this point in the history
We rename `parse.retree.BaseVisitor` to `PassThroughVisitor` in
alignment with the naming used for the generated SDKs. The name "base
visitor" is also a bit of a misnomer as it insinuates some kind of an
abstract class, while the pass-through visitor is explicitly a concrete
class.
  • Loading branch information
mristin authored Jun 20, 2024
1 parent b6d0a60 commit e374451
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aas_core_codegen/parse/retree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Visitor = _types.Visitor
Transformer = _types.Transformer

BaseVisitor = _visitor.BaseVisitor
PassThroughVisitor = _visitor.PassThroughVisitor

dump = _stringify.dump

Expand Down
2 changes: 1 addition & 1 deletion aas_core_codegen/parse/retree/_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)


class _FixForUTF16Regex(retree_visitor.BaseVisitor):
class _FixForUTF16Regex(retree_visitor.PassThroughVisitor):
"""
Modify the pattern in-place so that UTF-32 can be dealt by UTF-16-only regex engine.
Expand Down
2 changes: 1 addition & 1 deletion aas_core_codegen/parse/retree/_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from aas_core_codegen.parse.tree import FormattedValue


class BaseVisitor(Visitor):
class PassThroughVisitor(Visitor):
"""Visit all the nodes recursively without any action."""

def visit_regex(self, node: Regex) -> None:
Expand Down
2 changes: 1 addition & 1 deletion aas_core_codegen/xsd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _undo_escaping_backslash_x_u_and_U_in_pattern(pattern: str) -> str:
return "".join(parts)


class _AnchorRemover(parse_retree.BaseVisitor):
class _AnchorRemover(parse_retree.PassThroughVisitor):
"""
Remove anchors from a regex in-place.
Expand Down

0 comments on commit e374451

Please sign in to comment.