@nekketsuuu wrote:
I sometimes insert
#mod_use "foobar.ml"
into.ocamlinit
to debug my library on OCaml toplevel. When I use Dune, however, I noticed some auto-generated files (e.g.parser.ml
generated byparser.mly
by Menhir) are not recognized bydune utop
. How to configuredune utop
to be able to find these files? Should I build a custom toplevel usingtoplevel
stanza?How to reproduce
Files:
. ├── bin │ ├── dune │ └── main.ml ├── dune-project ├── foobar.opam └── lib ├── .ocamlinit ├── dune ├── lexer.mll └── parser.mly
.ocamlinit:
#mod_use "parser.ml";; #mod_use "lexer.ml";;
Commands:
$ cd lib $ dune utop . Entering directory '/path/to/foobar' ─┬─────────────────────────────────────────────────────────────┬─ │ Welcome to utop version 2.4.1 (using OCaml version 4.08.1)! │ └─────────────────────────────────────────────────────────────┘ Cannot find file parser.ml. Cannot find file lexer.ml. Type #utop_help for help about using utop. ─( 16:11:53 )─< command 0 >───────────────────────{ counter: 0 }─ utop # (* BTW Parser can be opened here *) open Parser;; ─( 16:12:39 )─< command 1 >───────────────────────{ counter: 0 }─ utop #
Environment
- Dune 1.11.3
- utop 2.4.1
- OCaml 4.08.1
Posts: 12
Participants: 4