I’ve defined some custom pretty-printers for the OCaml toplevel, and when I use them in a tuareg-mode interactive buffer, it doesn’t seem to detect that the output has ended, and there’s a new prompt. Specifically, this means that when I type in a new phrase and hit RET, it doesn’t do anything; I need to hit SHIFT-RET. Now, this isn’t a big deal, but it’s annoying, so I wondered "how does tuareg-mode figure out when it’s at a new prompt? And looking in the elisp source, I couldn’t figure it out, so I thought I’d ask if anybody knows, or has pointers to where I could start in the elisp.
For concreteness, here’s an example of input&output where tuareg doesn’t seem to understand that it’s at a new prompt:
input:
# let ([], qc') = {|
let q0 = qubit() in
(q0)
|} |> qcircuit_from_string ;;
output:
Line 1, characters 4-13:
1 | let ([], qc') = {|
^^^^^^^^^
Warning 8 [partial-match]: this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
(_::_, _)
val qc' : Qlam_syntax.SYN.qcirc_t = <:circuit<
let q0 = qubit () in
(q0) >>
#
After that last #
, if I type in (for example) 1 ;;
and hit RET, I get a message in the Emacs minbuffer Note: REPL processing requires a terminating ';;' or use S-return.
Any advice appreciated.