softdevteam / grmtools

Rust grammar tool libraries and binaries
Other
518 stars 31 forks source link

nimbleparse: add -d flag to dump state graph #474

Closed ratmice closed 4 days ago

ratmice commented 4 days ago

This is a patch I used for testing https://github.com/softdevteam/sparsevec/pull/25 It adds a -d flag for dumping the state graph from nimbleparse, then exiting. It also fixes an issue where the pretty printing function produces non-deterministic output.

I'm not certain it is quite up to par, because of the argument parsing an input file is required even though it is never used. but making the input file 'required unless the -d flag is specified' is also weird. Passing in an unused filename like /dev/null was sufficient for my testing purposes though.

ltratt commented 4 days ago

Please squash.

ratmice commented 4 days ago

Squashed.