Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get meta information in transformer method? #35

Open
DaveChintan opened this issue Mar 14, 2023 · 2 comments
Open

How to get meta information in transformer method? #35

DaveChintan opened this issue Mar 14, 2023 · 2 comments

Comments

@DaveChintan
Copy link

DaveChintan commented Mar 14, 2023

I want to parse terraform files. For that I have used hcl2.lark grammer from hcl2 python package and created custom transformer. Parser works fine but if I pass propagate_positions to true then parser breaks. How to get Meta information in transformer methods?

While generating JS file, I am passing propagate_positions to true and also when calling get_parser methods.

e.g.
lark-js file.lark --propagate_positions -o output.js
get_parser({transformer: new ExampleTransformer(), propagate_positions: true}

@erezsh
Copy link
Member

erezsh commented Mar 14, 2023

Does it also break when you don't pass a custom transformer?

@DaveChintan
Copy link
Author

DaveChintan commented Mar 14, 2023

No errors If I don't pass custom transformer.

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

No branches or pull requests

2 participants