Skip to content

Commit

Permalink
Add information about emitting terminals to the debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbaturin committed Feb 16, 2021
1 parent bf6c946 commit afad9ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/grammar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ let reduce_symbol ?(debug=false) ?(debug_fun=print_endline) sym_stack grammar =
| [] -> (None, [])
| sym :: syms ->
match sym with
| Terminal t -> (Some t, syms)
| Terminal t ->
let () = if debug then Printf.ksprintf debug_fun "Emitting terminal \"%s\"" t in
(Some t, syms)
| Nonterminal name ->
let () = if debug then Printf.ksprintf debug_fun "Reducing symbol <%s>" name in
let rhs = find_production name grammar in
Expand Down

0 comments on commit afad9ff

Please sign in to comment.