Skip to content

Sibling modules are unbound in qualified Menhir parsers #11119

@brendanzab

Description

@brendanzab

Expected Behavior

When using (include_subdirs qualified), a Menhir parser in a qualified subdirectory should be able to access its sibling modules. This is useful for if a programming language has a number of intermediate languages, each with its own parser and AST module, nested within their own subdirectories:

├── dune
├── dune-project
├── foo.ml
├── lang
│   ├── ast.ml
│   ├── dune
│   ├── lexer.ml
│   └── parser.mly
└── run.t

Actual Behavior

Sibling modules are unbound in qualified Menhir parsers:

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

Reproduction

#11118

Specifications

  • Version of dune (output of dune --version): 3.12.0-1285-gf7af2d0
  • Version of ocaml (output of ocamlc --version): The OCaml toplevel, version 5.1.1
  • Operating system (distribution and version): macOS 15.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions