Skip to content

Conversation

@richardxia
Copy link
Contributor

When using @v_args(meta=True), visitor methods will receive a meta argument followed by a children argument in that order. The documentation previously described the arguments in the opposite order, which can be misleading to someone reading the docs, especially because there was no example of @v_args(meta=True).

This updates the documentation to describe the arguments in the order they are passed in to the visitor methods, and adds a new example for @v_args(meta=True).

When using `@v_args(meta=True)`, visitor methods will receive a `meta`
argument followed by a `children` argument in that order. The
documentation previously described the arguments in the opposite order,
which can be misleading to someone reading the docs, especially because
there was no example of `@v_args(meta=True)`.

This updates the documentation to describe the arguments in the order
they are passed in to the visitor methods, and adds a new example for
`@v_args(meta=True)`.
@erezsh
Copy link
Member

erezsh commented Jul 18, 2023

Thanks, always glad to improve documentation.

One nitpick - if we already give an example with meta, it should at least use that variable in some way? Even if just to add logger.info(f'mul at line {meta.line}') or something of the sort.

@richardxia
Copy link
Contributor Author

No worries, just pushed up a new commit that adds an actual usage of the meta argument: fc5da22

@erezsh erezsh merged commit 3d9f4a2 into lark-parser:master Jul 19, 2023
@erezsh
Copy link
Member

erezsh commented Jul 19, 2023

Thanks!

@richardxia
Copy link
Contributor Author

No problem, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants