pub fn flatten_source(source: &str, source_dir: &Path) -> LingResult<Program>Expand description
Flatten a concatenated source string against source_dir, resolving its
use imports and deduplicating definitions. A host that pastes several files
together (e.g. the game launcher) and whose entry also uses some of them
would otherwise produce duplicate top-level functions; the JIT requires each
symbol once, so the last definition of each name wins (matching the
tree-walker, which registers into a map).