b2878fe655
Neue API check_workspace(&Workspace) -> Vec<Diagnostic>; check_module hebt das Modul intern in einen Trivial-Workspace. Term::Var mit genau einem Punkt im Namen ist ein qualifizierter Verweis <prefix>.<def>, aufgelöst über Import-Map (alias-oder-modulname → echter Modulname). Drei neue Diagnostic-Codes: unknown-module, unknown-import, invalid-def-name. ail check lädt jetzt immer via load_workspace; Loader-Fehler werden im JSON-Modus zu strukturierten Diagnostics (module-not-found, module-cycle, …). DESIGN.md und JOURNAL.md dokumentieren die Konvention. Hash-Stabilität: alle ir_snapshot_*- Tests bitidentisch grün, kein neuer AST-Knoten.
36 lines
831 B
JSON
36 lines
831 B
JSON
{
|
|
"schema": "ailang/v0",
|
|
"name": "ws_main",
|
|
"imports": [
|
|
{ "module": "ws_lib" }
|
|
],
|
|
"defs": [
|
|
{
|
|
"kind": "fn",
|
|
"name": "main",
|
|
"type": {
|
|
"k": "fn",
|
|
"params": [],
|
|
"ret": { "k": "con", "name": "Unit" },
|
|
"effects": ["IO"]
|
|
},
|
|
"params": [],
|
|
"doc": "Iter 5b fixture: ruft ws_lib.add auf, druckt das Ergebnis. So ist Cross-Module-Typcheck am Beispiel beobachtbar.",
|
|
"body": {
|
|
"t": "do",
|
|
"op": "io/print_int",
|
|
"args": [
|
|
{
|
|
"t": "app",
|
|
"fn": { "t": "var", "name": "ws_lib.add" },
|
|
"args": [
|
|
{ "t": "lit", "lit": { "kind": "int", "value": 2 } },
|
|
{ "t": "lit", "lit": { "kind": "int", "value": 3 } }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|