Skip to content

How to obtain a generated parser's source code? #588

Answered by glyn
danaugrs asked this question in Q&A
Discussion options

You must be logged in to vote

I used cargo expand. I put this in a scratch file with extension .rs so my editor provides syntax highlighting:

$ cargo expand > scratch/generated.rs

If you only want documentation for the generated code, the pest book suggests cargo doc will do the trick, but I couldn't get that to work (even using the --all switch). I finally discovered that:

$ cargo doc --document-private-items --no-deps

documents the generated parser code.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danaugrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants