Skip to content

Commit

Permalink
test: Sibling modules should be accessible from qualified parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanzab committed Nov 13, 2024
1 parent f7af2d0 commit b00114b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(include_subdirs qualified)

(executable
(name foo))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 3.14)
(using menhir 2.1)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let () =
assert (Lang.Parser.expr (fun _ -> Lang.Parser.EOF) (Lexing.from_string "") = Lang.Ast.Unit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
type expr =
| Unit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(menhir
(modules parser))
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%token EOF

%start <Ast.expr> expr

%%

expr:
| EOF { Ast.Unit }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Menhir parsers in qualified subdirectories should be able to refer to sibling modules:

$ dune build
File "lang/parser.mly", line 3, characters 8-16:
Error: Unbound module Ast
[1]

0 comments on commit b00114b

Please sign in to comment.