Skip to content

Commit 2a13f24

Browse files
committed
Don't exit when dumping state graph
1 parent 2532d73 commit 2a13f24

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

nimbleparse/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn usage(prog: &str, msg: &str) -> ! {
3232
if !msg.is_empty() {
3333
eprintln!("{}", msg);
3434
}
35-
eprintln!("Usage: {} [-r <cpctplus|none>] [-y <eco|grmtools|original>] [-q] [-d] <lexer.l> <parser.y> <input file>", leaf);
35+
eprintln!("Usage: {} [-r <cpctplus|none>] [-y <eco|grmtools|original>] [-dq] <lexer.l> <parser.y> <input file>", leaf);
3636
process::exit(1);
3737
}
3838

@@ -87,7 +87,7 @@ fn main() {
8787
let matches = match Options::new()
8888
.optflag("h", "help", "")
8989
.optflag("q", "quiet", "Don't print warnings such as conflicts")
90-
.optflag("d", "dump-state-graph", "Print the parser state and exit")
90+
.optflag("d", "dump-state-graph", "Print the parser state graph")
9191
.optopt(
9292
"r",
9393
"recoverer",
@@ -191,7 +191,6 @@ fn main() {
191191

192192
if dump_state_graph {
193193
println!("Stategraph:\n{}\n", sgraph.pp_core_states(&grm));
194-
process::exit(0);
195194
}
196195

197196
if !quiet {
@@ -220,7 +219,7 @@ fn main() {
220219
if pp_sr {
221220
println!("{}", c.pp_sr(&grm));
222221
}
223-
if pp_rr || pp_sr {
222+
if (pp_rr || pp_sr) && !dump_state_graph {
224223
println!("Stategraph:\n{}\n", sgraph.pp_core_states(&grm));
225224
}
226225
formatter.handle_conflicts::<DefaultLexerTypes<u32>>(

0 commit comments

Comments
 (0)