lark icon indicating copy to clipboard operation
lark copied to clipboard

Breaking changes / docs out of date

Open akissinger opened this issue 8 months ago • 7 comments

Describe the bug

After updated from Lark 1.1.5 to 1.1.7, the parser fails with (at least) two problems. These seem to be due to a rename of ParseTree to Tree (contrary to the docs e.g. on parse: https://lark-parser.readthedocs.io/en/stable/classes.html#lark.Lark.parse) and a re-ordering of v_args in the Transformer methods to no longer match what's documented here:

https://lark-parser.readthedocs.io/en/stable/visitors.html#v-args

Also, the docs don't seem to have been building for the past few weeks:

https://readthedocs.org/projects/lark-parser/builds/

To Reproduce

Write a transformer with something like this:

@v_args(meta=True)
def term_ref(self, meta: Meta, items: List[Any]) -> Any:
    s = str(items[0])

and it will fail by saying Meta object not subscriptable. This works fine in 1.1.5, but it looks like 1.1.7 expects this instead:

@v_args(meta=True)
def term_ref(self, items: List[Any], meta: Meta) -> Any:
    s = str(items[0])

akissinger avatar Oct 20 '23 09:10 akissinger