Skip to main content

Module resolve

Module resolve 

Source
Expand description

@require:/@import: name resolution.

Transcribed from v0.0.6’s src/frontend/main.ml (lines ~95-140): a header name is turned into a list of candidate file paths, tried in order; the first candidate that exists on disk wins. We do NOT implement the mode-specific .satyh-<mode> extension SATySFi also tries — out of scope here, matching the task’s transcription instructions.

Functions§

resolve_import
Resolve @import: name relative to dir, the directory of the file that contains the header (NOT the entry document’s directory — see main.ml, where imports are resolved relative to the current file being processed, which matters once library files import each other from different subdirectories).
resolve_require
Resolve @require: name against the package/library root.