Skip to content

Resolve "Module name resolution can fail in case of overlapping search paths"

Camil Staps requested to merge 48-overlapping-search-paths into main

Closes #48 (closed)

This is based on !20 (merged).

The only solution I currently see is to write a small lexer. It only needs to recognize comments (not even string literals) to get to the module header. Such functionality is already implemented (not exported) in Clean.Parse.Comments.

The other option is to run cocl with each possible module name until you do not get an error about a non-matching module name. Besides being ugly, this approach fails when there is a module in yet another directory with that module name. For example, with search paths /a/b and /a and file /a/b/x.icl (module b.x) and /a/x.icl (module x), and a notification for /a/b/x.icl, if you would first try module name x (based on search path /a/b), cocl would actually read file /a/x.icl instead!

Edited by Camil Staps

Merge request reports