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

Document about lifetime #880

Open
glyh opened this issue Apr 12, 2024 · 1 comment
Open

Document about lifetime #880

glyh opened this issue Apr 12, 2024 · 1 comment

Comments

@glyh
Copy link

glyh commented Apr 12, 2024

I don't find any information on this. And I run into a cryptic lifetime error with codes generated by lalrpop, so I think it would be helpful if LALRPOP document this.

Specifically, I have lifetime annotation on my AST because I used &str type, but I don't know how to annotate lifetime in the grammar file.

@yannham
Copy link
Contributor

yannham commented Apr 12, 2024

Hello! You're right that it should be documented. In the meantime, here is a real world example of an LALRPOP grammar that uses :

  1. The lifetime of the input ('input)
  2. Additional custom grammar parameters and lifetimes ('err, 'wcard, src_id, etc.)

I think those parameters are directly reported on the parse method in the module generated by LALRPOP.

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