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
8 changes: 4 additions & 4 deletions lark/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,12 @@ def _vargs_tree(f, data, children, meta):


def v_args(inline: bool = False, meta: bool = False, tree: bool = False, wrapper: Optional[Callable] = None) -> Callable[[_DECORATED], _DECORATED]:
"""A convenience decorator factory for modifying the behavior of user-supplied visitor methods.
"""A convenience decorator factory for modifying the behavior of user-supplied callback methods of ``Transformer`` classes.

By default, callback methods of transformers/visitors accept one argument - a list of the node's children.
By default, transformer callback methods accept one argument - a list of the node's children.

``v_args`` can modify this behavior. When used on a transformer/visitor class definition,
it applies to all the callback methods inside it.
``v_args`` can modify this behavior. When used on a ``Transformer`` class definition, it applies to
all the callback methods inside it.

``v_args`` can be applied to a single method, or to an entire class. When applied to both,
the options given to the method take precedence.
Expand Down