Skip to content

Commit 2f7c9a4

Browse files
authored
Merge pull request #1486 from odanoburu/issue408
Mention internal/external transformers in the documentation
2 parents 24f19a3 + aeeef0a commit 2f7c9a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lark/parse_tree_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def f(children):
320320

321321
def apply_visit_wrapper(func, name, wrapper):
322322
if wrapper is _vargs_meta or wrapper is _vargs_meta_inline:
323-
raise NotImplementedError("Meta args not supported for internal transformer")
323+
raise NotImplementedError("Meta args not supported for internal transformer; use YourTransformer().transform(parser.parse()) instead")
324324

325325
@wraps(func)
326326
def f(children):

lark/visitors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def v_args(inline: bool = False, meta: bool = False, tree: bool = False, wrapper
523523
524524
Parameters:
525525
inline (bool, optional): Children are provided as ``*args`` instead of a list argument (not recommended for very long lists).
526-
meta (bool, optional): Provides two arguments: ``meta`` and ``children`` (instead of just the latter)
526+
meta (bool, optional): Provides two arguments: ``meta`` and ``children`` (instead of just the latter); ``meta`` isn't available for transformers supplied to Lark using the ``transformer`` parameter (aka internal transformers).
527527
tree (bool, optional): Provides the entire tree as the argument, instead of the children.
528528
wrapper (function, optional): Provide a function to decorate all methods.
529529

0 commit comments

Comments
 (0)