lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.77k stars 404 forks source link

v_args decorator does not change behavior #346

Closed legalian closed 5 years ago

legalian commented 5 years ago

Hello, I have built a transformer that I am trying to use. The transformer behaves as expected, but I need row and column numbers for each node in the tree. Propogate_positions works, but the information is not available to the transformer because only the children of the node is provided, not the line or column information. Both v_args(meta=True) or v_args(tree=True) appear to be ignored- I can't seem to get either to work. I've tried applying the function decorators to the class, and to each method individually. I've also tried both Transformer (supplied with transformer=MyTransformer()) and Transformer_inline (supplied with result = MyTransformer().transform(l.parse(document)))- neither one seems to supply the tree as an argument. I'm using lalr as my parser.

legalian commented 5 years ago

I found the issue- it had nothing to do with lark. v_args was set to something else that I couldn't see because of an import.