on master help sign in
Track recursive import origins and local molds
8b9c9aciko
docs/compiler.md+4−2
@@ -56,12 +56,14 @@ The core is split into chapters, `+| %name`, in this order:
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
58
58
59−The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, unfaced cells, a two-binder cell pattern, a complete two-arm loobean branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. Acyclic local value definitions can refer forward and generalize variables that are free of their enclosing environment; captured variables and explicit capitals remain shared. Local molds and recursive local groups remain unsupported. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, its imports, faces, general patterns, deferred constraints, recursive or generic molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
59+The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, unfaced cells, a two-binder cell pattern, a complete two-arm loobean branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. Acyclic local value definitions can refer forward and generalize variables that are free of their enclosing environment; captured variables and explicit capitals remain shared. Acyclic simple local mold aliases can also refer forward, and are scoped to the body, not its gate's sample. Recursive local groups, and recursive, generic, union or faced local molds remain unsupported. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, its imports, faces, general patterns, deferred constraints, recursive or generic molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
60
60
61−The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. It also reads ordered map fields in records when the map arguments are syntactically fixed atom molds and other fields are fixed atom molds or standard collections of static atom molds. Collection names must not be shadowed. The reader can also import a nonrecursive mark door sample, removing its outer sample face and validating its build subject; recursive mark samples fail closed until their source modules are tracked. Nested `$^`, other nested ordered maps, general source-level disjointness and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms and unfaced cells from caller-supplied reader results for declared `/-` imports; `+golden-types-with-marks` accepts those same shapes from declared mark imports in a separate list. Other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core. The reader validates direct zuse subjects and Ford subjects consisting of faced imported cores and a validated tail, checking imported cores transitively; it rejects shadowed names, inconsistent core subjects and other subject shapes. Recursive results with Ford imports are rejected until references retain their source module. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and `tools/type-mark-test` compare bridge reports under eval and on the ship. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
61+The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. It also reads ordered map fields in records when the map arguments are syntactically fixed atom molds and other fields are fixed atom molds or standard collections of static atom molds. Collection names must not be shadowed. The reader can also import a mark door sample, removing its outer sample face and validating its build subject. Nested `$^`, other nested ordered maps, general source-level disjointness and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms and unfaced cells from caller-supplied reader results for declared `/-` imports; `+golden-types-with-marks` accepts those same shapes from declared mark imports in a separate list. Other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core. The reader validates direct zuse subjects and Ford subjects consisting of faced imported cores and a validated tail, checking imported cores transitively; it rejects shadowed names, inconsistent core subjects and other subject shapes. For a recursive reference, the reader matches the exact Hoon hold against named arms in validated cores, including transitive Ford imports; it rejects missing, unlabelled or ambiguous origins. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and `tools/type-mark-test` compare bridge reports under eval and on the ship. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
62
62
63Callers that have a `/sur` core and a name can use `+read-named`: it checks for a locally declared arm before asking Hoon to evaluate the mold, and reports evaluation failures with the final Hoon trace line. `+read-mold-in` remains available when the caller already has the selected type. The checker currently treats a failed import as unsupported rather than rendering the importer's error.
63Callers that have a `/sur` core and a name can use `+read-named`: it checks for a locally declared arm before asking Hoon to evaluate the mold, and reports evaluation failures with the final Hoon trace line. `+read-mold-in` remains available when the caller already has the selected type. The checker currently treats a failed import as unsupported rather than rendering the importer's error.
64
64
65+`+golden-types-with-modules` accepts case-local Jibb module sources alongside `/sur` and mark results. It identifies whether each declared `/=` has a supplied source, but does not resolve or typecheck the imported module yet.
66+
65And the design notes:
67And the design notes:
66
68
67| Note | Says |
69| Note | Says |
docs/development.md+1−1
@@ -100,7 +100,7 @@ A case is a folder `tests/golden/<name>/` holding:
100- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
100- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
101- optionally, an `expect-types:` line in `about.txt` opts the case into `+golden-types`; `types.txt` holds its output plus one newline and `--update` creates it. A `types.txt` also opts in when the line is absent. This interface is provisional while the checker is under construction.
101- optionally, an `expect-types:` line in `about.txt` opts the case into `+golden-types`; `types.txt` holds its output plus one newline and `--update` creates it. A `types.txt` also opts in when the line is absent. This interface is provisional while the checker is under construction.
102- optionally, `imports.txt` selects Hoon `/sur` molds, one `module mold` pair per line. Each module's source goes in `sur/<module>.txt` and is compiled against zuse by both runners. `marks.txt` selects marks, one name per line, with source in `mar/<name>.txt`; both kinds may be supplied together. The reader results go to the partial checker, and a type output is required. Both runners reconstruct fixture text from `%txt` lines and identify the fixture if its compilation crashes; a crash fails the case without discarding its successful parse output. These fixtures currently handle only sources without Ford imports.
102- optionally, `imports.txt` selects Hoon `/sur` molds, one `module mold` pair per line. Each module's source goes in `sur/<module>.txt` and is compiled against zuse by both runners. `marks.txt` selects marks, one name per line, with source in `mar/<name>.txt`; both kinds may be supplied together. The reader results go to the partial checker, and a type output is required. Both runners reconstruct fixture text from `%txt` lines and identify the fixture if its compilation crashes; a crash fails the case without discarding its successful parse output. These fixtures currently handle only sources without Ford imports.
103−- optionally, `modules.txt` lists logical `/ui/.../*.jibb` paths, one per line. The corresponding sources live below the case's `modules/ui/` directory. Both runners parse each source at its logical path and compare the combined `module-trees.txt`; `--update` writes that output. This checks fixture syntax only: module imports and their types are not resolved by the partial checker.
103+- optionally, `modules.txt` lists logical `/ui/.../*.jibb` paths, one per line. The corresponding sources live below the case's `modules/ui/` directory. Both runners parse each source at its logical path and compare the combined `module-trees.txt`; `--update` writes that output. A case with type output also supplies these sources to the partial checker, which reports Jibb module imports as unsupported; it does not resolve or typecheck them yet.
104
104
105A zero-byte mark fixture currently fails ship synchronization validation after commit. Use a newline-only fixture to test an empty Hoon source on the ship.
105A zero-byte mark fixture currently fails ship synchronization validation after commit. Use a newline-only fixture to test an empty Hoon source on the ship.
106
106
docs/open-questions.md+2−1
@@ -18,7 +18,7 @@ On 2026-10-30, @iko adopted gate-free `eq` arguments and map and set keys, treat
18
18
19## Questions milestone 2 raises
19## Questions milestone 2 raises
20
20
21−Found while writing [prompts/milestone-2.md](prompts/milestone-2.md) and checking it against the doc's examples. The numbering is retained so existing references stay valid. The prelude inventory in question 3 and the `like` representation in question 18 remain open; the other questions are settled.
21+Found while writing [prompts/milestone-2.md](prompts/milestone-2.md) and checking it against the doc's examples. The numbering is retained so existing references stay valid. The prelude inventory in question 3, the `like` representation in question 18, and the type of `clap` in question 20 remain open; the other questions are settled.
22
22
231. **Settled: how the prelude identifies jetted functions.** On 2026-10-30, @iko said the prelude functions have working Jibb implementations, and the compiler recognizes their shapes and uses the Hoon versions so jets can fire.
231. **Settled: how the prelude identifies jetted functions.** On 2026-10-30, @iko said the prelude functions have working Jibb implementations, and the compiler recognizes their shapes and uses the Hoon versions so jets can fire.
242. **Settled: how the prelude keeps helpers private.** On 2026-10-30, @iko chose a separate internal prelude module imported by the prelude, without exposing the imported helpers.
242. **Settled: how the prelude keeps helpers private.** On 2026-10-30, @iko chose a separate internal prelude module imported by the prelude, without exposing the imported helpers.
@@ -39,6 +39,7 @@ Found while writing [prompts/milestone-2.md](prompts/milestone-2.md) and checkin
3917. **Settled: empty cases in union disjointness.** On 2026-10-30, @iko said `!!` is disjoint from every case. A cell containing an empty position at any depth is itself empty and is also disjoint from every case.
3917. **Settled: empty cases in union disjointness.** On 2026-10-30, @iko said `!!` is disjoint from every case. A cell containing an empty position at any depth is itself empty and is also disjoint from every case.
4018. **The two uses of Hoon `like`.** Hoon `+like` is a wet mold builder, but the gate it returns is callable and applies its supplied gate to the product. In a verified Hoon 135 example, applying `(like f)` to `[[1 2] [7 8 ~]]` produces an edge whose product is `8` when `f` is identity and `42` when `f` returns `42`; the resulting nail is the original input. Jibb molds are types, not callable values. The prelude now declares a generic `(like A)` mold and a `wonk` extractor; both parse, but their full type and backend validation remain outstanding. Should it also expose a value gate under `like`? If so, should the value preserve Hoon's input shape and behavior, or instead map the product of an already constructed edge? @iko is reviewing these alternatives; the exact public signature is not yet decided.
4018. **The two uses of Hoon `like`.** Hoon `+like` is a wet mold builder, but the gate it returns is callable and applies its supplied gate to the product. In a verified Hoon 135 example, applying `(like f)` to `[[1 2] [7 8 ~]]` produces an edge whose product is `8` when `f` is identity and `42` when `f` returns `42`; the resulting nail is the original input. Jibb molds are types, not callable values. The prelude now declares a generic `(like A)` mold and a `wonk` extractor; both parse, but their full type and backend validation remain outstanding. Should it also expose a value gate under `like`? If so, should the value preserve Hoon's input shape and behavior, or instead map the product of an already constructed edge? @iko is reviewing these alternatives; the exact public signature is not yet decided.
4119. **Settled: Hoon aura families and `step.hoon`.** On 2026-10-30, @iko chose `step.hoon` for Hoon 1c `step`, avoiding a clash with the Grammar example's `step`, and chose one-way widening across Hoon aura families: for example, `@ud` and `@ux` fit `@u`, and `@tD` fits `@t`. The reverse needs a check. The `step.hoon` group representation is not implemented yet.
4119. **Settled: Hoon aura families and `step.hoon`.** On 2026-10-30, @iko chose `step.hoon` for Hoon 1c `step`, avoiding a clash with the Grammar example's `step`, and chose one-way widening across Hoon aura families: for example, `@ud` and `@ux` fit `@u`, and `@tD` fits `@t`. The reverse needs a check. The `step.hoon` group representation is not implemented yet.
42+20. **The type of Hoon `clap`.** Hoon allows its two input units and combining gate's result to have different types. If only one unit is present it returns that unit; when both are present it returns the combining gate's result. Jibb branches normally need a common type, while every union written in Jibb has a name. Should the Jibb gate require a shared type, infer an unnamed union of the possible values, or wait for a different typing design? Asked @iko on 2026-10-30. `clap` is not implemented while this is open.
42
43
43## Grammar questions never put to the doc's author
44## Grammar questions never put to the doc's author
44
45
docs/status.md+7−6
@@ -19,7 +19,7 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
19
19
20## Milestone 2: in progress
20## Milestone 2: in progress
21
21
22−The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass selected Hoon atoms and unfaced cells from `/sur` molds and marks into inference. The reader handles nonrecursive mark samples, named recursion without Ford imports, nested collections, direct ordered maps, certain ordered-map fields, and direct `$^` unions whose cases can be proved disjoint. Recursive mark samples and recursive molds in Ford-importing subjects fail closed until their origin is tracked. Nested `$^`, other nested ordered maps, general union disjointness and complete import integration remain unfinished. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, generalized atom constraints arising from explicit capitals or bare sample binders, and acyclic local definitions with captures. Unfixed decimal literals default to `@ud` in gate-free inferred types; recursive local groups, local molds, other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; its golden fixtures include three real Tlon files. The prelude currently has only a few functions, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
22+The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass selected Hoon atoms and unfaced cells from `/sur` molds and marks into inference. The reader handles mark samples, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, certain ordered-map fields, and direct `$^` unions whose cases can be proved disjoint. Ambiguous recursive origins fail closed; nested `$^`, other nested ordered maps, general union disjointness and complete import integration remain unfinished. Jibb module sources can be supplied to the partial checker, which does not yet resolve them. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, generalized atom constraints arising from explicit capitals or bare sample binders, acyclic local value definitions with captures, and simple acyclic local mold aliases. Unfixed decimal literals default to `@ud` in gate-free inferred types; recursive local groups, more complex local molds, other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; its golden fixtures include three real Tlon files. The prelude currently has only a few functions, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
23
23
24## Milestone 1: parser and mark
24## Milestone 1: parser and mark
25
25
@@ -37,8 +37,8 @@ What the plan asks for, and where it is:
37
37
38Besides the plan's list:
38Besides the plan's list:
39
39
40−- 415 golden cases: 199 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
40+- 417 golden cases: 201 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
41−- The 415-case corpus passed under `urbit eval` in 22.0 s. The fake ship passed all 419 tests, including the importer, importer/checker and mark/checker bridges, and unification checks, with 20.8 s for sync and 19.7 s for tests. The importer golden compares 74 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, reads selected molds and marks, and passes Clay-built types through the Clay-built importer and partial checker.
41+- The 417-case corpus passed under `urbit eval` in 22.2 s. The fake ship passed all 421 tests, including the importer, importer/checker and mark/checker bridges, and unification checks, with 19.5 s for sync and 16.6 s for tests. The importer golden compares 81 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, checks a recursive Ford import's origin, and passes Clay-built types through the Clay-built importer and partial checker.
42- `tools/testdata/selftest` (21 checks) and `tools/testdata/ship-selftest` test the tools themselves.
42- `tools/testdata/selftest` (21 checks) and `tools/testdata/ship-selftest` test the tools themselves.
43- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
43- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
44- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
44- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
@@ -62,14 +62,15 @@ Besides the plan's list:
62| 47a1f49 | 2026-10-30 | Read validated Ford imports, widen aura families, and show both sites of selected errors |
62| 47a1f49 | 2026-10-30 | Read validated Ford imports, widen aura families, and show both sites of selected errors |
63| bd37989 | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
63| bd37989 | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
64| 2d5deb2 | 2026-10-30 | Default gate-free decimal types, validate named Hoon mold lookup, and isolate fixture failures |
64| 2d5deb2 | 2026-10-30 | Default gate-free decimal types, validate named Hoon mold lookup, and isolate fixture failures |
65−| This change | 2026-10-30 | Infer acyclic local definitions and parse case-local Jibb module fixtures |
65+| 1b7dbae | 2026-10-30 | Infer acyclic local definitions and parse case-local Jibb module fixtures |
66+| This change | 2026-10-30 | Preserve recursive import origins, infer simple local molds, and supply Jibb module sources to the partial checker |
66
67
67## Checking it
68## Checking it
68
69
69On a machine set up as [development.md](development.md) says:
70On a machine set up as [development.md](development.md) says:
70
71
71```
72```
72−tools/golden # 415 cases under urbit eval
73+tools/golden # 417 cases under urbit eval
73tools/importer-test # the Hoon importer fixture projection
74tools/importer-test # the Hoon importer fixture projection
74tools/type-import-test # the importer/checker bridge fixture
75tools/type-import-test # the importer/checker bridge fixture
75tools/type-mark-test # the mark/checker bridge fixture
76tools/type-mark-test # the mark/checker bridge fixture
@@ -78,7 +79,7 @@ tools/testdata/selftest # the tools themselves
78tools/doc-blocks docs/spec # the doc's examples are golden cases
79tools/doc-blocks docs/spec # the doc's examples are golden cases
79tools/ship start
80tools/ship start
80tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
81tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
81−tools/ship test # the same 415 cases as -test arms on the ship
82+tools/ship test # the same 417 cases as -test arms on the ship
82tools/testdata/ship-selftest
83tools/testdata/ship-selftest
83tools/ship check-commit # |commit stores .jibb files
84tools/ship check-commit # |commit stores .jibb files
84tools/clay-fixtures # example /sur files and marks build through Clay
85tools/clay-fixtures # example /sur files and marks build through Clay
jibb-dev/lib/jibb-import.hoon+67−22
@@ -14,8 +14,9 @@
14:: their imported shapes prove disjoint. Nested $^ and some valid but
14:: their imported shapes prove disjoint. Nested $^ and some valid but
15:: unprovably disjoint cases remain unsupported. Source-level overlap in
15:: unprovably disjoint cases remain unsupported. Source-level overlap in
16:: other unions, general nested ordered maps, broader Ford subject
16:: other unions, general nested ordered maps, broader Ford subject
17−:: shapes, recursive mark types and full error locations still need work. A nested ordered map
17+:: shapes, ambiguous recursive origins and full error locations still
18+:: need work. A nested ordered map is recovered only when its key and
18−:: is recovered only when its key and value are fixed atom molds and
19+:: value are fixed atom molds and
19:: the other fields are fixed atoms or collections of static atoms;
20:: the other fields are fixed atoms or collections of static atoms;
20:: other source shapes fail closed.
21:: other source shapes fail closed.
21::
22::
@@ -81,8 +82,6 @@
81 [%| 'Hoon module provenance does not match the selected mold']
82 [%| 'Hoon module provenance does not match the selected mold']
82 =/ result (read-with module name typ [~ cor])
83 =/ result (read-with module name typ [~ cor])
83 ?. ?=([%& *] result) result
84 ?. ?=([%& *] result) result
84− ?: &(!=(q.q.cor -:!>(..zuse)) (contains-ref p.result))
85− [%| 'a recursive Hoon mold with Ford imports needs source-aware import']
86 result
85 result
87::
86::
88:: +read-named is the source-aware entry point for callers that have
87:: +read-named is the source-aware entry point for callers that have
@@ -123,24 +122,8 @@
123 =/ raw=type ?:(?=([%face *] sample) q.sample sample)
122 =/ raw=type ?:(?=([%face *] sample) q.sample sample)
124 =/ result (read-with name name raw [~ q.p.cor])
123 =/ result (read-with name name raw [~ q.p.cor])
125 ?. ?=([%& *] result) result
124 ?. ?=([%& *] result) result
126− ?: (contains-ref p.result)
127− [%| 'a recursive Hoon mark needs source-aware import']
128 result
125 result
129::
126::
130−:: Until recursive holds retain their originating module, a Ford import
131−:: could otherwise label another module's recursive reference as local.
132−++ contains-ref
133− |= out=imported
134− ^- ?
135− ?- out
136− [%ref *] &
137− [%cell *] |($(out head.out) $(out tail.out))
138− [%face *] $(out body.out)
139− [%fork *] (lien cases.out |=(item=imported (contains-ref item)))
140− [%apply *] (lien args.out |=(item=imported (contains-ref item)))
141− * |
142− ==
143−::
144++ read-with
127++ read-with
145 |= [module=term name=term typ=type context=(unit type)]
128 |= [module=term name=term typ=type context=(unit type)]
146 ^- (each imported @t)
129 ^- (each imported @t)
@@ -594,6 +577,51 @@
594 ?: =(typ typ.i.seen) [~ name.i.seen]
577 ?: =(typ typ.i.seen) [~ name.i.seen]
595 $(seen t.seen)
578 $(seen t.seen)
596::
579::
580+:: Find the source module for an exact recursive hold by evaluating
581+:: locally declared arms of each validated core in the subject. An
582+:: unlabelled core, failed evaluation, or multiple labels is ambiguous.
583+++ origin-candidates
584+ |= [scope=type label=(unit term) name=term typ=type]
585+ ^- (list (unit term))
586+ ?: =(scope -:!>(..zuse)) ~
587+ ?- scope
588+ [%cell *]
589+ ?. ?=([%face *] p.scope) ~[~]
590+ ?^ p.p.scope ~[~]
591+ %+ weld
592+ $(scope q.p.scope, label [~ p.p.scope])
593+ $(scope q.scope, label ~)
594+ [%core *]
595+ =/ chapters=(map term tome) q.r.q.scope
596+ =/ present=? (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
597+ =/ own=(list (unit term))
598+ ?. present ~
599+ =/ trial=(each type tang) (mule |.((~(play ut scope) (ream (cat 3 '*' name)))))
600+ ?- trial
601+ [%| *] ~[~]
602+ [%& *] ?: =(p.trial typ) ~[label]
603+ ~
604+ ==
605+ (weld own $(scope p.scope, label ~))
606+ * ~[~]
607+ ==
608+::
609+++ ref-origin
610+ |= [module=term name=term typ=type context=(unit type)]
611+ ^- (unit term)
612+ ?~ context ~
613+ =/ found (origin-candidates u.context [~ module] name typ)
614+ ?~ found ~
615+ ?~ i.found ~
616+ =/ choice=term u.i.found
617+ =/ same
618+ |= item=(unit term)
619+ ^- ?
620+ ?~ item |
621+ =(u.item choice)
622+ ?. (levy t.found same) ~
623+ [~ choice]
624+::
597++ walk
625++ walk
598 |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
626 |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
599 ^- imported
627 ^- imported
@@ -631,7 +659,9 @@
631 =/ prior=(unit (unit term)) (find-seen typ seen)
659 =/ prior=(unit (unit term)) (find-seen typ seen)
632 ?^ prior
660 ?^ prior
633 ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
661 ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
634− [%ref module u.u.prior]
662+ =/ origin (ref-origin module u.u.prior typ context)
663+ ?~ origin [%bad 'a recursive Hoon mold needs unambiguous source provenance']
664+ [%ref u.origin u.u.prior]
635 =/ nm (hold-name q.typ)
665 =/ nm (hold-name q.typ)
636 ?: =(nm [~ %vase]) [%bad 'vases cannot be imported']
666 ?: =(nm [~ %vase]) [%bad 'vases cannot be imported']
637 ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
667 ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
@@ -883,7 +913,7 @@
883 ==
913 ==
884::
914::
885++ fixture-output
915++ fixture-output
886− |= [small=@t epic=@t presence=@t docs=@t shadow=@t shadow-static=@t ford=@t mark=@t mark-rec=@t mark-gate=@t mark-basic=@t]
916+ |= [small=@t epic=@t presence=@t docs=@t shadow=@t shadow-static=@t ford=@t mark=@t mark-rec=@t mark-gate=@t mark-basic=@t origin-trans=@t origin-first=@t origin-other=@t]
887 ^- wain
917 ^- wain
888 =/ sc=type -:(ride -:!>(..zuse) small)
918 =/ sc=type -:(ride -:!>(..zuse) small)
889 =/ ec=type -:(ride -:!>(..zuse) epic)
919 =/ ec=type -:(ride -:!>(..zuse) epic)
@@ -892,6 +922,7 @@
892 =/ hc=type -:(ride -:!>(..zuse) shadow)
922 =/ hc=type -:(ride -:!>(..zuse) shadow)
893 =/ xc=type -:(ride -:!>(..zuse) shadow-static)
923 =/ xc=type -:(ride -:!>(..zuse) shadow-static)
894 =/ fp=type [%cell [%face %small sc] -:!>(..zuse)]
924 =/ fp=type [%cell [%face %small sc] -:!>(..zuse)]
925+ =/ other=type -:(ride -:!>(..zuse) origin-other)
895 =/ fc=type -:(ride fp ford)
926 =/ fc=type -:(ride fp ford)
896 ?> ?=([%core *] fc)
927 ?> ?=([%core *] fc)
897 =/ only-list=@t '|%\0a+$ lists (list @ud)\0a--\0a'
928 =/ only-list=@t '|%\0a+$ lists (list @ud)\0a--\0a'
@@ -906,6 +937,13 @@
906 =/ mark-shadow-core=type -:(ride sp mark-basic)
937 =/ mark-shadow-core=type -:(ride sp mark-basic)
907 =/ tshp=type [%cell [%face %intermediate shc] -:!>(..zuse)]
938 =/ tshp=type [%cell [%face %intermediate shc] -:!>(..zuse)]
908 =/ tshc=type -:(ride tshp only-list)
939 =/ tshc=type -:(ride tshp only-list)
940+ =/ trans=type -:(ride tp origin-trans)
941+ =/ ambiguous-parent=type [%cell [%face %first sc] [%cell [%face %second sc] -:!>(..zuse)]]
942+ =/ ambiguous=type -:(ride ambiguous-parent origin-first)
943+ =/ distinct-parent=type [%cell [%face %first sc] [%cell [%face %second other] -:!>(..zuse)]]
944+ =/ distinct=type -:(ride distinct-parent origin-first)
945+ =/ trans-amb-parent=type [%cell [%face %intermediate fc] [%cell [%face %second sc] -:!>(..zuse)]]
946+ =/ trans-amb=type -:(ride trans-amb-parent origin-trans)
909 =/ sample
947 =/ sample
910 |= name=term
948 |= name=term
911 (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
949 (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
@@ -953,6 +991,11 @@
953 (crip "ford-imported: {(show-result (read-mold-in %ford %wrapped (~(play ut fc) (ream '*wrapped')) fc))}")
991 (crip "ford-imported: {(show-result (read-mold-in %ford %wrapped (~(play ut fc) (ream '*wrapped')) fc))}")
954 (crip "ford-recursive: {(show-result (read-mold-in %ford %recursive (~(play ut fc) (ream '*recursive')) fc))}")
992 (crip "ford-recursive: {(show-result (read-mold-in %ford %recursive (~(play ut fc) (ream '*recursive')) fc))}")
955 (crip "ford-local-recursive: {(show-result (read-mold-in %ford %local (~(play ut fc) (ream '*local')) fc))}")
993 (crip "ford-local-recursive: {(show-result (read-mold-in %ford %local (~(play ut fc) (ream '*local')) fc))}")
994+ (crip "ford-recursive-transitive: {(show-result (read-named %outer %wrapped trans))}")
995+ (crip "ford-recursive-ambiguous: {(show-result (read-named %outer %pick-one ambiguous))}")
996+ (crip "ford-recursive-transitive-ambiguous: {(show-result (read-named %outer %wrapped trans-amb))}")
997+ (crip "ford-recursive-distinct-first: {(show-result (read-named %outer %pick-one distinct))}")
998+ (crip "ford-recursive-distinct-second: {(show-result (read-named %outer %pick-two distinct))}")
956 (crip "ford-transitive: {(show-result (read-mold-in %ford %lists (~(play ut tc) (ream '*lists')) tc))}")
999 (crip "ford-transitive: {(show-result (read-mold-in %ford %lists (~(play ut tc) (ream '*lists')) tc))}")
957 (crip "ford-shadow: {(show-result (read-mold-in %ford %lists (~(play ut shc) (ream '*lists')) shc))}")
1000 (crip "ford-shadow: {(show-result (read-mold-in %ford %lists (~(play ut shc) (ream '*lists')) shc))}")
958 (crip "ford-transitive-shadow: {(show-result (read-mold-in %ford %lists (~(play ut tshc) (ream '*lists')) tshc))}")
1001 (crip "ford-transitive-shadow: {(show-result (read-mold-in %ford %lists (~(play ut tshc) (ream '*lists')) tshc))}")
@@ -982,6 +1025,8 @@
982 (crip "shadow-mop: {(show-result (shad %mm))}")
1025 (crip "shadow-mop: {(show-result (shad %mm))}")
983 (crip "shadow-jar: {(show-result (shad %aa))}")
1026 (crip "shadow-jar: {(show-result (shad %aa))}")
984 (crip "shadow-jug: {(show-result (shad %bb))}")
1027 (crip "shadow-jug: {(show-result (shad %bb))}")
1028+ (crip "no-provenance-atom: {(show-result (read-mold %small %word (~(play ut sc) (ream '*word'))))}")
1029+ (crip "no-provenance-recursive: {(show-result (read-mold %wrong %alias (~(play ut sc) (ream '*chain'))))}")
985 (crip "no-provenance: {(show-result (read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))))}")
1030 (crip "no-provenance: {(show-result (read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))))}")
986 (crip "named-not-mold: {(show-result (read-named %small %not-mold sc))}")
1031 (crip "named-not-mold: {(show-result (read-named %small %not-mold sc))}")
987 (crip "named-present: {(show-result (read-named %small %items sc))}")
1032 (crip "named-present: {(show-result (read-named %small %items sc))}")
jibb-dev/lib/jibb.hoon+74−5
@@ -5212,12 +5212,46 @@
5212 =/ names=(list term) (global-value-names ds)
5212 =/ names=(list term) (global-value-names ds)
5213 |-
5213 |-
5214 ?~ ds &
5214 ?~ ds &
5215− ?. ?=(%value -.i.ds) |
5215+ ?: ?=(%mold -.i.ds) $(ds t.ds)
5216 ?. (unique-value-name name.i.ds names) |
5216 ?. (unique-value-name name.i.ds names) |
5217 ?: ?=(^ (ienv-lookup name.i.ds env)) |
5217 ?: ?=(^ (ienv-lookup name.i.ds env)) |
5218 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
5218 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
5219 $(ds t.ds)
5219 $(ds t.ds)
5220::
5220::
5221+:: The supported local molds are nonrecursive simple aliases. Validate
5222+:: all of them, including unused ones, before checking any local values.
5223+:: The enclosing gate sample was checked before this scope was entered.
5224+::
5225+++ local-value-defs
5226+ |= ds=(list def)
5227+ ^- (list def)
5228+ ?~ ds ~
5229+ ?: ?=(%mold -.i.ds) $(ds t.ds)
5230+ [i.ds $(ds t.ds)]
5231+::
5232+++ local-mold-names-valid
5233+ |= [locals=imolds state=istate]
5234+ ^- ?
5235+ =/ names=(list term) (turn locals |=(m=[name=term body=shape] name.m))
5236+ |-
5237+ ?~ locals &
5238+ =/ n=term name.i.locals
5239+ ?. (unique-value-name n names) |
5240+ ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
5241+ ?: (lien marks.state |=(m=term =(n m))) |
5242+ ?: (lien surs.state |=(m=term =(n m))) |
5243+ $(locals t.locals)
5244+::
5245+++ local-molds-supported
5246+ |= [locals=imolds state=istate]
5247+ ^- ?
5248+ ?~ locals &
5249+ =/ m=[name=term body=shape] i.locals
5250+ =/ inferred=(unit [typ=itype state=istate])
5251+ (infer-simple-shape body.m state(active [name.m active.state], in-mold &))
5252+ ?~ inferred |
5253+ $(locals t.locals)
5254+::
5221++ infer-local-defs
5255++ infer-local-defs
5222 |= [ds=(list def) env=ienv state=istate]
5256 |= [ds=(list def) env=ienv state=istate]
5223 ^- ilocal-result
5257 ^- ilocal-result
@@ -5278,13 +5312,20 @@
5278 ?~ defs.e $(e final.e)
5312 ?~ defs.e $(e final.e)
5279 =/ local-names=(list term) (global-value-names defs.e)
5313 =/ local-names=(list term) (global-value-names defs.e)
5280 ?. (local-names-valid defs.e env state)
5314 ?. (local-names-valid defs.e env state)
5281− [%| ["local definitions shadow a name or use an unsupported mold" ~]]
5315+ [%| ["local definitions shadow a name" ~]]
5316+ =/ local-molds=imolds (collect-simple-molds defs.e)
5317+ ?. (local-mold-names-valid local-molds state)
5318+ [%| ["local molds shadow a name" ~]]
5319+ =/ local-state=istate
5282− =/ local-state=istate state(globals (weld local-names globals.state))
5320+ state(globals (weld local-names globals.state), molds (weld local-molds molds.state))
5321+ ?. (local-molds-supported local-molds local-state)
5322+ [%| ["local molds need unsupported inference" ~]]
5323+ =/ values=(list def) (local-value-defs defs.e)
5283− =/ locals=ilocal-result (infer-local-defs defs.e env local-state)
5324+ =/ locals=ilocal-result (infer-local-defs values env local-state)
5284 ?: ?=(%| -.locals) locals
5325 ?: ?=(%| -.locals) locals
5285 =/ result=iresult $(e final.e, env env.p.locals, state state.p.locals)
5326 =/ result=iresult $(e final.e, env env.p.locals, state state.p.locals)
5286 ?: ?=(%| -.result) result
5327 ?: ?=(%| -.result) result
5287− [%& typ.p.result state.p.result(globals globals.state)]
5328+ [%& typ.p.result state.p.result(globals globals.state, molds molds.state)]
5288 %branch
5329 %branch
5289 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
5330 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
5290 ?~ t.arms.e (infer-cell-branch e env state)
5331 ?~ t.arms.e (infer-cell-branch e env state)
@@ -5766,6 +5807,34 @@
5766 ^- @t
5807 ^- @t
5767 (golden-types-with-marks file src externals ~)
5808 (golden-types-with-marks file src externals ~)
5768::
5809::
5810+:: +golden-types-with-modules: record supplied Jibb sources separately.
5811+:: Module imports are not resolved yet; neither supplied nor missing
5812+:: source makes the partial report a checked module.
5813+::
5814+++ golden-types-with-modules
5815+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=(list [at=path source=@t])]
5816+ ^- @t
5817+ =/ parsed (parse file src)
5818+ ?: ?=(%| -.parsed) (show-error src p.parsed)
5819+ =/ report=@t (golden-types-with-marks file src externals mark-externals)
5820+ =/ imports=(list import) imports.p.parsed
5821+ =/ lines=(list @t) ~
5822+ |-
5823+ ?~ imports
5824+ ?~ lines report
5825+ (of-wain:format [report (flop lines)])
5826+ ?. ?=(%jibb -.i.imports) $(imports t.imports)
5827+ =/ at=path (weld path.i.imports `path`~[%jibb])
5828+ =/ found=(list [at=path source=@t])
5829+ (skim modules |=(m=[at=path source=@t] =(at at.m)))
5830+ =/ status=tape
5831+ ?~ found "source missing"
5832+ ?^ t.found "duplicate sources"
5833+ "source supplied"
5834+ =/ line=@t
5835+ (crip "/= {(trip face.i.imports)} {(spud path.i.imports)}: {status}; module import is not supported by partial inference")
5836+ $(imports t.imports, lines [line lines])
5837+::
5769:: +golden-types-with-marks: supply declared mark types separately from /sur
5838:: +golden-types-with-marks: supply declared mark types separately from /sur
5770:: entries, as [mark result] with the result from +read-mark:jibb-import.
5839:: entries, as [mark result] with the result from +read-mark:jibb-import.
5771:: Unknown, duplicated, failed and undeclared entries never resolve a mold.
5840:: Unknown, duplicated, failed and undeclared entries never resolve a mold.
my-app/sur/blog.hoon+1
@@ -2,4 +2,5 @@
2|%
2|%
3+$ title @t
3+$ title @t
4+$ post [title=title slug=@ta]
4+$ post [title=title slug=@ta]
5++$ chain $@(~ [value=@ud next=chain])
5--
6--
my-app/sur/import-fixture.hoon+1
@@ -2,4 +2,5 @@
2:: Fixture for the Hoon importer; not supplied by the design doc.
2:: Fixture for the Hoon importer; not supplied by the design doc.
3|%
3|%
4+$ sample [title=title:blog values=(list @ud)]
4+$ sample [title=title:blog values=(list @ud)]
5++$ recursive chain:blog
5--
6--
tests/clay-fixtures/ford-recursive-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [value=@ud next=chain.blog] @n:0)"
tests/clay-fixtures/ford-recursive.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-named'))
7+=/ got=vase (slym read-gate [%import-fixture %recursive -.src])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/golden/types-module-fixtures/about.txt+1−1
@@ -1,4 +1,4 @@
1source: Overview, worked example 2: the published page imports its API and card component with `/=`.
1source: Overview, worked example 2: the published page imports its API and card component with `/=`.
2−tests: The case carries two Jibb module sources at their logical paths; both runners parse and compare their trees. This only checks the fixture sources, not module import resolution or typing.
2+tests: The case carries two Jibb module sources at their logical paths; both runners parse and compare their trees and supply them to partial inference. Module import resolution and typing remain unsupported.
3expect: parses
3expect: parses
4expect-types: a partial report that does not claim module checking
4expect-types: a partial report that does not claim module checking
tests/golden/types-module-fixtures/types.txt+2
@@ -2,3 +2,5 @@ partial inference; module not checked
2++ main: multiple arguments are not supported by partial inference
2++ main: multiple arguments are not supported by partial inference
3++ load: sample mold is not supported by partial inference
3++ load: sample mold is not supported by partial inference
4++ view: sample mold is not supported by partial inference
4++ view: sample mold is not supported by partial inference
5+/= api /ui/api/blog: source supplied; module import is not supported by partial inference
6+/= card /ui/components/card: source supplied; module import is not supported by partial inference
tests/golden/types-module-mixed/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/-` imports Hoon molds, `/%` imports a mark type and `/=` imports a Jibb module.
2+tests: The partial checker receives a Hoon mold, a mark and one Jibb module source together; it can infer the two supported Hoon types but reports Jibb module resolution unsupported for both the supplied source and the missing source.
3+expect: parses
4+expect-types: a partial report; Jibb module import resolution is unsupported
tests/golden/types-module-mixed/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture title
tests/golden/types-module-mixed/mar/label.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=@t
2+++ grab |% ++ noun @t --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/golden/types-module-mixed/marks.txtnew file+1
@@ -0,0 +1 @@
1+label
tests/golden/types-module-mixed/module-trees.txtnew file+6
@@ -0,0 +1,6 @@
1+/ui/helper.jibb
2+(module
3+ (value 1:1 identity
4+ (gate 1:13
5+ (face 1:16 x (tvar 1:18 A))
6+ (wing 1:20 x))))
tests/golden/types-module-mixed/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/helper.jibb
tests/golden/types-module-mixed/modules/ui/helper.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |= x=A x
tests/golden/types-module-mixed/source.jibbnew file+6
@@ -0,0 +1,6 @@
1+/- fixture
2+/% %label
3+/= extra /ui/helper
4+/= missing /ui/missing
5+++ label-id |= x=label x
6+++ title-id |= x=title.fixture x
tests/golden/types-module-mixed/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/types-module-mixed/tokens.txtnew file+36
@@ -0,0 +1,36 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph /%
5+2:5 lit %label
6+3:1 NEWLINE
7+3:1 glyph /=
8+3:5 name extra
9+3:11 glyph /
10+3:12 tight knot ui
11+3:14 tight glyph /
12+3:15 tight knot helper
13+4:1 NEWLINE
14+4:1 glyph /=
15+4:5 name missing
16+4:13 glyph /
17+4:14 tight knot ui
18+4:16 tight glyph /
19+4:17 tight knot missing
20+5:1 NEWLINE
21+5:1 glyph ++
22+5:4 name label-id
23+5:13 glyph |=
24+5:16 name x
25+5:17 tight glyph =
26+5:18 tight name label
27+5:24 name x
28+6:1 NEWLINE
29+6:1 glyph ++
30+6:4 name title-id
31+6:13 glyph |=
32+6:16 name x
33+6:17 tight glyph =
34+6:18 tight wing title.fixture
35+6:32 name x
36+6:33 NEWLINE
tests/golden/types-module-mixed/tree.txtnew file+13
@@ -0,0 +1,13 @@
1+(module
2+ (sur 1:1 fixture)
3+ (mark 2:1 %label)
4+ (jibb 3:1 extra /ui/helper)
5+ (jibb 4:1 missing /ui/missing)
6+ (value 5:1 label-id
7+ (gate 5:13
8+ (face 5:16 x (ref 5:18 label))
9+ (wing 5:24 x)))
10+ (value 6:1 title-id
11+ (gate 6:13
12+ (face 6:16 x (ref 6:18 title.fixture))
13+ (wing 6:32 x))))
tests/golden/types-module-mixed/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2+++ label-id: $-(@t @t)
3+++ title-id: $-(@t @t)
4+/= extra /ui/helper: source supplied; module import is not supported by partial inference
5+/= missing /ui/missing: source missing; module import is not supported by partial inference
tests/golden/types-partial-local-molds/about.txtnew file+9
@@ -0,0 +1,9 @@
1+Grammar, Modules: "Local definitions may start any body, visible to each
2+other and the final expression"; a gate's sample cannot see a mold in that
3+gate's body. Partial inference supports acyclic local aliases of simple
4+molds and resolves them in any order. It rejects duplicate or shadowed molds
5+and leaves recursive or union molds unsupported, even if unused. Mold and
6+value namespaces remain separate. The report does not claim the module is
7+checked.
8+expect: parses
9+expect-types: a partial inference report, not a checked module
tests/golden/types-partial-local-molds/source.jibbnew file+39
@@ -0,0 +1,39 @@
1++$ shared @t
2+++ local |= x
3+ +$ alias other
4+ +$ other @t
5+ ++ identify |= y=alias y
6+ (identify x)
7+++ sample |= x=hidden
8+ +$ hidden @t
9+ x
10+++ duplicate |= x
11+ +$ a @t
12+ +$ a @p
13+ x
14+++ shadow |= x
15+ +$ shared @p
16+ x
17+++ recursive |= x
18+ +$ loop loop
19+ x
20+++ unused-union |= x
21+ +$ option
22+ %yes
23+ %no
24+ x
25+++ same-names |= x
26+ +$ alias @t
27+ ++ alias |= y=alias y
28+ (alias x)
29+++ no-leak |= x
30+ ++ inside |= y
31+ +$ hidden @t
32+ y
33+ ^- hidden x
34+++ nested-shadow |= x
35+ +$ outer @t
36+ ++ inside |= y
37+ +$ outer @p
38+ y
39+ x
tests/golden/types-partial-local-molds/tokens.txtnew file+170
@@ -0,0 +1,170 @@
1+1:1 glyph +$
2+1:4 name shared
3+1:11 aura @t
4+2:1 NEWLINE
5+2:1 glyph ++
6+2:4 name local
7+2:10 glyph |=
8+2:13 name x
9+3:3 INDENT
10+3:3 glyph +$
11+3:6 name alias
12+3:12 name other
13+4:3 NEWLINE
14+4:3 glyph +$
15+4:6 name other
16+4:12 aura @t
17+5:3 NEWLINE
18+5:3 glyph ++
19+5:6 name identify
20+5:15 glyph |=
21+5:18 name y
22+5:19 tight glyph =
23+5:20 tight name alias
24+5:26 name y
25+6:3 NEWLINE
26+6:3 glyph (
27+6:4 tight name identify
28+6:13 name x
29+6:14 tight glyph )
30+7:1 DEDENT
31+7:1 NEWLINE
32+7:1 glyph ++
33+7:4 name sample
34+7:11 glyph |=
35+7:14 name x
36+7:15 tight glyph =
37+7:16 tight name hidden
38+8:3 INDENT
39+8:3 glyph +$
40+8:6 name hidden
41+8:13 aura @t
42+9:3 NEWLINE
43+9:3 name x
44+10:1 DEDENT
45+10:1 NEWLINE
46+10:1 glyph ++
47+10:4 name duplicate
48+10:14 glyph |=
49+10:17 name x
50+11:3 INDENT
51+11:3 glyph +$
52+11:6 name a
53+11:8 aura @t
54+12:3 NEWLINE
55+12:3 glyph +$
56+12:6 name a
57+12:8 aura @p
58+13:3 NEWLINE
59+13:3 name x
60+14:1 DEDENT
61+14:1 NEWLINE
62+14:1 glyph ++
63+14:4 name shadow
64+14:11 glyph |=
65+14:14 name x
66+15:3 INDENT
67+15:3 glyph +$
68+15:6 name shared
69+15:13 aura @p
70+16:3 NEWLINE
71+16:3 name x
72+17:1 DEDENT
73+17:1 NEWLINE
74+17:1 glyph ++
75+17:4 name recursive
76+17:14 glyph |=
77+17:17 name x
78+18:3 INDENT
79+18:3 glyph +$
80+18:6 name loop
81+18:11 name loop
82+19:3 NEWLINE
83+19:3 name x
84+20:1 DEDENT
85+20:1 NEWLINE
86+20:1 glyph ++
87+20:4 name unused-union
88+20:17 glyph |=
89+20:20 name x
90+21:3 INDENT
91+21:3 glyph +$
92+21:6 name option
93+22:5 INDENT
94+22:5 lit %yes
95+23:5 NEWLINE
96+23:5 lit %no
97+24:3 DEDENT
98+24:3 NEWLINE
99+24:3 name x
100+25:1 DEDENT
101+25:1 NEWLINE
102+25:1 glyph ++
103+25:4 name same-names
104+25:15 glyph |=
105+25:18 name x
106+26:3 INDENT
107+26:3 glyph +$
108+26:6 name alias
109+26:12 aura @t
110+27:3 NEWLINE
111+27:3 glyph ++
112+27:6 name alias
113+27:12 glyph |=
114+27:15 name y
115+27:16 tight glyph =
116+27:17 tight name alias
117+27:23 name y
118+28:3 NEWLINE
119+28:3 glyph (
120+28:4 tight name alias
121+28:10 name x
122+28:11 tight glyph )
123+29:1 DEDENT
124+29:1 NEWLINE
125+29:1 glyph ++
126+29:4 name no-leak
127+29:12 glyph |=
128+29:15 name x
129+30:3 INDENT
130+30:3 glyph ++
131+30:6 name inside
132+30:13 glyph |=
133+30:16 name y
134+31:5 INDENT
135+31:5 glyph +$
136+31:8 name hidden
137+31:15 aura @t
138+32:5 NEWLINE
139+32:5 name y
140+33:3 DEDENT
141+33:3 NEWLINE
142+33:3 glyph ^-
143+33:6 name hidden
144+33:13 name x
145+34:1 DEDENT
146+34:1 NEWLINE
147+34:1 glyph ++
148+34:4 name nested-shadow
149+34:18 glyph |=
150+34:21 name x
151+35:3 INDENT
152+35:3 glyph +$
153+35:6 name outer
154+35:12 aura @t
155+36:3 NEWLINE
156+36:3 glyph ++
157+36:6 name inside
158+36:13 glyph |=
159+36:16 name y
160+37:5 INDENT
161+37:5 glyph +$
162+37:8 name outer
163+37:14 aura @p
164+38:5 NEWLINE
165+38:5 name y
166+39:3 DEDENT
167+39:3 NEWLINE
168+39:3 name x
169+39:4 DEDENT
170+39:4 NEWLINE
tests/golden/types-partial-local-molds/tree.txtnew file+80
@@ -0,0 +1,80 @@
1+(module
2+ (mold 1:1 shared (aura 1:11 @t))
3+ (value 2:1 local
4+ (gate 2:10
5+ (bind 2:13 x)
6+ (body 3:3
7+ (mold 3:3 alias (ref 3:12 other))
8+ (mold 4:3 other (aura 4:12 @t))
9+ (value 5:3 identify
10+ (gate 5:15
11+ (face 5:18 y (ref 5:20 alias))
12+ (wing 5:26 y)))
13+ (group 6:3
14+ (call 6:4 (wing 6:4 identify) (wing 6:13 x))))))
15+ (value 7:1 sample
16+ (gate 7:11
17+ (face 7:14 x (ref 7:16 hidden))
18+ (body 8:3
19+ (mold 8:3 hidden (aura 8:13 @t))
20+ (wing 9:3 x))))
21+ (value 10:1 duplicate
22+ (gate 10:14
23+ (bind 10:17 x)
24+ (body 11:3
25+ (mold 11:3 a (aura 11:8 @t))
26+ (mold 12:3 a (aura 12:8 @p))
27+ (wing 13:3 x))))
28+ (value 14:1 shadow
29+ (gate 14:11
30+ (bind 14:14 x)
31+ (body 15:3
32+ (mold 15:3 shared (aura 15:13 @p))
33+ (wing 16:3 x))))
34+ (value 17:1 recursive
35+ (gate 17:14
36+ (bind 17:17 x)
37+ (body 18:3
38+ (mold 18:3 loop (ref 18:11 loop))
39+ (wing 19:3 x))))
40+ (value 20:1 unused-union
41+ (gate 20:17
42+ (bind 20:20 x)
43+ (body 21:3
44+ (mold 21:3 option
45+ (union 22:5 (const 22:5 %yes) (const 23:5 %no)))
46+ (wing 24:3 x))))
47+ (value 25:1 same-names
48+ (gate 25:15
49+ (bind 25:18 x)
50+ (body 26:3
51+ (mold 26:3 alias (aura 26:12 @t))
52+ (value 27:3 alias
53+ (gate 27:12
54+ (face 27:15 y (ref 27:17 alias))
55+ (wing 27:23 y)))
56+ (group 28:3
57+ (call 28:4 (wing 28:4 alias) (wing 28:10 x))))))
58+ (value 29:1 no-leak
59+ (gate 29:12
60+ (bind 29:15 x)
61+ (body 30:3
62+ (value 30:3 inside
63+ (gate 30:13
64+ (bind 30:16 y)
65+ (body 31:5
66+ (mold 31:5 hidden (aura 31:15 @t))
67+ (wing 32:5 y))))
68+ (cast 33:3 (ref 33:6 hidden) (wing 33:13 x)))))
69+ (value 34:1 nested-shadow
70+ (gate 34:18
71+ (bind 34:21 x)
72+ (body 35:3
73+ (mold 35:3 outer (aura 35:12 @t))
74+ (value 36:3 inside
75+ (gate 36:13
76+ (bind 36:16 y)
77+ (body 37:5
78+ (mold 37:5 outer (aura 37:14 @p))
79+ (wing 38:5 y))))
80+ (wing 39:3 x)))))
tests/golden/types-partial-local-molds/types.txtnew file+11
@@ -0,0 +1,11 @@
1+partial inference; module not checked
2++$ shared: not checked
3+++ local: $-(@t @t)
4+++ sample: sample mold is not supported by partial inference
5+++ duplicate: local molds shadow a name
6+++ shadow: local molds shadow a name
7+++ recursive: local molds need unsupported inference
8+++ unused-union: local molds need unsupported inference
9+++ same-names: $-(@t @t)
10+++ no-leak: cast mold is not supported by partial inference
11+++ nested-shadow: local definitions need unsupported inference
tests/golden/types-partial-locals/about.txt+1−1
@@ -3,6 +3,6 @@ may shadow one already in scope". Definitions at the start of a body are
3visible to one another and its final expression. Partial inference resolves
3visible to one another and its final expression. Partial inference resolves
4acyclic local values, generalizing their free variables except those captured
4acyclic local values, generalizing their free variables except those captured
5from enclosing bindings or explicit capitals. It declines recursive groups,
5from enclosing bindings or explicit capitals. It declines recursive groups,
6−local molds, duplicate names and shadowing. A module remains unchecked.
6+duplicate names and shadowing; simple local molds are now supported. A module remains unchecked.
7expect: parses
7expect: parses
8expect-types: a partial inference report, not a checked module
8expect-types: a partial inference report, not a checked module
tests/golden/types-partial-locals/types.txt+4−4
@@ -8,9 +8,9 @@ partial inference; module not checked
8/tests/golden/types-partial-locals/source.jibb:10:11: expression has type @t
8/tests/golden/types-partial-locals/source.jibb:10:11: expression has type @t
9 ^- @p (capture "hi")
9 ^- @p (capture "hi")
10 ^
10 ^
11−++ duplicate: local definitions shadow a name or use an unsupported mold
11+++ duplicate: local definitions shadow a name
12−++ shadow: local definitions shadow a name or use an unsupported mold
12+++ shadow: local definitions shadow a name
13−++ global-shadow: local definitions shadow a name or use an unsupported mold
13+++ global-shadow: local definitions shadow a name
14++ missing: local definitions need unsupported inference
14++ missing: local definitions need unsupported inference
15++ caps: call's sample and argument types do not unify
15++ caps: call's sample and argument types do not unify
16/tests/golden/types-partial-locals/source.jibb:28:6: called gate has type $-(@t @t)
16/tests/golden/types-partial-locals/source.jibb:28:6: called gate has type $-(@t @t)
@@ -20,7 +20,7 @@ partial inference; module not checked
20 (same ~zod)
20 (same ~zod)
21 ^
21 ^
22++ unused-bad: local definitions need unsupported inference
22++ unused-bad: local definitions need unsupported inference
23−++ local-mold: local definitions shadow a name or use an unsupported mold
23+++ local-mold: $-(A A)
24++ wrap: $-(A $-(B A))
24++ wrap: $-(A $-(B A))
25++ through-global: cast mold and expression type do not unify
25++ through-global: cast mold and expression type do not unify
26/tests/golden/types-partial-locals/source.jibb:39:8: cast mold has type @p
26/tests/golden/types-partial-locals/source.jibb:39:8: cast mold has type @p
tests/importer/about.txt+5−4
@@ -5,10 +5,11 @@ list shadow alongside a nested ordered map is rejected. Static sibling
5collections and dependent sibling molds are tested separately. Nested `$^`
5collections and dependent sibling molds are tested separately. Nested `$^`
6cases fail closed, while nested `$@` cases remain supported. `ford.txt`
6cases fail closed, while nested `$@` cases remain supported. `ford.txt`
7checks a synthetic imported subject and selected mold; other cases check
7checks a synthetic imported subject and selected mold; other cases check
8−transitive imports, named mold lookup, missing names, shadowing, malformed
8+transitive imports, named mold lookup, missing names, shadowing, unprovenanced
9−subjects and recursion whose
9+recursive holds, malformed
10+subjects and recursive references through local, imported and transitive
10−origin cannot yet be established. The mark fixtures check door samples,
11+cores, including ambiguous and independently defined origins. The mark fixtures check door samples,
11−collection provenance, unsupported gates and recursive sample rejection.
12+collection provenance, unsupported gates and recursive sample provenance.
12The synthetic hold in +bad-branch-fixture checks that a failed Hoon branch expansion returns
13The synthetic hold in +bad-branch-fixture checks that a failed Hoon branch expansion returns
13an error. `tlon-epic.txt`, `tlon-presence.txt` and `tlon-docs.txt` are the
14an error. `tlon-epic.txt`, `tlon-presence.txt` and `tlon-docs.txt` are the
14unmodified `desk/sur/epic.hoon`, `desk/sur/presence.hoon` and
15unmodified `desk/sur/epic.hoon`, `desk/sur/presence.hoon` and
tests/importer/origin-first.txtnew file+4
@@ -0,0 +1,4 @@
1+|%
2++$ pick-one chain:first
3++$ pick-two chain:second
4+--
tests/importer/origin-other.txtnew file+4
@@ -0,0 +1,4 @@
1+|%
2++$ chain $@(~ [value=@ud next=chain])
3++$ extra @t
4+--
tests/importer/origin-transitive.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ wrapped recursive:intermediate
3+--
tests/importer/tree.txt+11−4
@@ -18,15 +18,20 @@ nested-static-mop: [a=(mop @ud @t) b=(map @ud (jar @t @ud))]
18collection-siblings: [a=(mop @ud @t) [b=(set @ud) [c=(qeu @t) [d=(unit @ud) e=(jug @ud @t)]]]]
18collection-siblings: [a=(mop @ud @t) [b=(set @ud) [c=(qeu @t) [d=(unit @ud) e=(jug @ud @t)]]]]
19dynamic-sibling-mop: error: a nested Hoon mop needs source-aware import
19dynamic-sibling-mop: error: a nested Hoon mop needs source-aware import
20mark-record: [id=@ud text=@t]
20mark-record: [id=@ud text=@t]
21−mark-recursive: error: a recursive Hoon mark needs source-aware import
21+mark-recursive: (union [value=@ud next=chain.small] @n:0)
22mark-gate: error: cores and gates cannot be imported
22mark-gate: error: cores and gates cannot be imported
23mark-list: (list @ud)
23mark-list: (list @ud)
24mark-shadow: error: Hoon collection provenance is unavailable or shadowed
24mark-shadow: error: Hoon collection provenance is unavailable or shadowed
25mark-not-core: error: Hoon mark provenance is unavailable
25mark-not-core: error: Hoon mark provenance is unavailable
26ford-list: (list @ud)
26ford-list: (list @ud)
27ford-imported: [id=@ud text=@t]
27ford-imported: [id=@ud text=@t]
28+ford-recursive: (union [value=@ud next=chain.small] @n:0)
29+ford-local-recursive: (union [v=@ud next=local.ford] @n:0)
30+ford-recursive-transitive: (union [value=@ud next=chain.small] @n:0)
28−ford-recursive: error: a recursive Hoon mold with Ford imports needs source-aware import
31+ford-recursive-ambiguous: error: a recursive Hoon mold needs unambiguous source provenance
29−ford-local-recursive: error: a recursive Hoon mold with Ford imports needs source-aware import
32+ford-recursive-transitive-ambiguous: error: a recursive Hoon mold needs unambiguous source provenance
33+ford-recursive-distinct-first: (union [value=@ud next=chain.first] @n:0)
34+ford-recursive-distinct-second: (union [value=@ud next=chain.second] @n:0)
30ford-transitive: (list @ud)
35ford-transitive: (list @ud)
31ford-shadow: error: Hoon collection provenance is unavailable or shadowed
36ford-shadow: error: Hoon collection provenance is unavailable or shadowed
32ford-transitive-shadow: error: Hoon collection provenance is unavailable or shadowed
37ford-transitive-shadow: error: Hoon collection provenance is unavailable or shadowed
@@ -56,12 +61,14 @@ shadow-nested-mop: error: Hoon collection provenance is unavailable or shadowed
56shadow-mop: error: Hoon collection provenance is unavailable or shadowed
61shadow-mop: error: Hoon collection provenance is unavailable or shadowed
57shadow-jar: error: Hoon collection provenance is unavailable or shadowed
62shadow-jar: error: Hoon collection provenance is unavailable or shadowed
58shadow-jug: error: Hoon collection provenance is unavailable or shadowed
63shadow-jug: error: Hoon collection provenance is unavailable or shadowed
64+no-provenance-atom: @t
65+no-provenance-recursive: error: a recursive Hoon mold needs unambiguous source provenance
59no-provenance: error: Hoon collection provenance is unavailable or shadowed
66no-provenance: error: Hoon collection provenance is unavailable or shadowed
60named-not-mold: error: Hoon mold `not-mold` could not be evaluated: -find.$
67named-not-mold: error: Hoon mold `not-mold` could not be evaluated: -find.$
61named-present: (map @ud [id=@ud text=@t])
68named-present: (map @ud [id=@ud text=@t])
62named-missing: error: Hoon mold `missing` is not declared
69named-missing: error: Hoon mold `missing` is not declared
63named-invalid-core: error: Hoon module provenance is unavailable
70named-invalid-core: error: Hoon module provenance is unavailable
64−named-ford-recursive: error: a recursive Hoon mold with Ford imports needs source-aware import
71+named-ford-recursive: (union [value=@ud next=chain.small] @n:0)
65missing-arm: error: Hoon mold `missing` is not declared
72missing-arm: error: Hoon mold `missing` is not declared
66wrong-provenance: error: Hoon module provenance does not match the selected mold
73wrong-provenance: error: Hoon module provenance does not match the selected mold
67unverified-subject: error: Hoon module provenance is unavailable
74unverified-subject: error: Hoon module provenance is unavailable
tests/lib/jibb-import.hoon+7−1
@@ -12,6 +12,9 @@
12/* mark-rec %txt /tests/importer/mark-recursive/txt
12/* mark-rec %txt /tests/importer/mark-recursive/txt
13/* mark-gate %txt /tests/importer/mark-gate/txt
13/* mark-gate %txt /tests/importer/mark-gate/txt
14/* mark-basic %txt /tests/importer/mark-list/txt
14/* mark-basic %txt /tests/importer/mark-list/txt
15+/* origin-trans %txt /tests/importer/origin-transitive/txt
16+/* origin-first %txt /tests/importer/origin-first/txt
17+/* origin-other %txt /tests/importer/origin-other/txt
15/* expected %txt /tests/importer/tree/txt
18/* expected %txt /tests/importer/tree/txt
16|%
19|%
17++ lines-to-cord
20++ lines-to-cord
@@ -32,8 +35,11 @@
32 ?~ mark-rec ~[leaf+"recursive mark fixture is missing"]
35 ?~ mark-rec ~[leaf+"recursive mark fixture is missing"]
33 ?~ mark-gate ~[leaf+"gate mark fixture is missing"]
36 ?~ mark-gate ~[leaf+"gate mark fixture is missing"]
34 ?~ mark-basic ~[leaf+"list mark fixture is missing"]
37 ?~ mark-basic ~[leaf+"list mark fixture is missing"]
38+ ?~ origin-trans ~[leaf+"transitive origin fixture is missing"]
39+ ?~ origin-first ~[leaf+"origin alias fixture is missing"]
40+ ?~ origin-other ~[leaf+"distinct origin fixture is missing"]
35 ?~ expected ~[leaf+"importer golden output is missing"]
41 ?~ expected ~[leaf+"importer golden output is missing"]
36− =/ actual (fixture-output:jibb-import (lines-to-cord small) (lines-to-cord epic) (lines-to-cord presence) (lines-to-cord docs) (lines-to-cord shadow) (lines-to-cord shadow-static) (lines-to-cord ford) (lines-to-cord mark) (lines-to-cord mark-rec) (lines-to-cord mark-gate) (lines-to-cord mark-basic))
42+ =/ actual (fixture-output:jibb-import (lines-to-cord small) (lines-to-cord epic) (lines-to-cord presence) (lines-to-cord docs) (lines-to-cord shadow) (lines-to-cord shadow-static) (lines-to-cord ford) (lines-to-cord mark) (lines-to-cord mark-rec) (lines-to-cord mark-gate) (lines-to-cord mark-basic) (lines-to-cord origin-trans) (lines-to-cord origin-first) (lines-to-cord origin-other))
37 ?. =(actual expected)
43 ?. =(actual expected)
38 ~[leaf+"importer projection differs from tests/importer/tree.txt"]
44 ~[leaf+"importer projection differs from tests/importer/tree.txt"]
39 ~
45 ~
tests/lib/jibb.hoon+201−154
@@ -1139,8 +1139,8 @@
1139/* src-373 %jibb /tests/golden/module-fixture-eof/source/jibb
1139/* src-373 %jibb /tests/golden/module-fixture-eof/source/jibb
1140/* tok-373 %txt /tests/golden/module-fixture-eof/tokens/txt
1140/* tok-373 %txt /tests/golden/module-fixture-eof/tokens/txt
1141/* tre-373 %txt /tests/golden/module-fixture-eof/tree/txt
1141/* tre-373 %txt /tests/golden/module-fixture-eof/tree/txt
1142−/* mtre-373 %txt /tests/golden/module-fixture-eof/module-trees/txt
1143/* mod-373-1 %jibb /tests/golden/module-fixture-eof/modules/ui/incomplete/jibb
1142/* mod-373-1 %jibb /tests/golden/module-fixture-eof/modules/ui/incomplete/jibb
1143+/* mtre-373 %txt /tests/golden/module-fixture-eof/module-trees/txt
1144/* src-374 %jibb /tests/golden/prelude-1c-structural/source/jibb
1144/* src-374 %jibb /tests/golden/prelude-1c-structural/source/jibb
1145/* tok-374 %txt /tests/golden/prelude-1c-structural/tokens/txt
1145/* tok-374 %txt /tests/golden/prelude-1c-structural/tokens/txt
1146/* tre-374 %txt /tests/golden/prelude-1c-structural/tree/txt
1146/* tre-374 %txt /tests/golden/prelude-1c-structural/tree/txt
@@ -1193,130 +1193,142 @@
1193/* src-385 %jibb /tests/golden/types-module-fixtures/source/jibb
1193/* src-385 %jibb /tests/golden/types-module-fixtures/source/jibb
1194/* tok-385 %txt /tests/golden/types-module-fixtures/tokens/txt
1194/* tok-385 %txt /tests/golden/types-module-fixtures/tokens/txt
1195/* tre-385 %txt /tests/golden/types-module-fixtures/tree/txt
1195/* tre-385 %txt /tests/golden/types-module-fixtures/tree/txt
1196−/* typ-385 %txt /tests/golden/types-module-fixtures/types/txt
1197−/* mtre-385 %txt /tests/golden/types-module-fixtures/module-trees/txt
1198/* mod-385-1 %jibb /tests/golden/types-module-fixtures/modules/ui/api/blog/jibb
1196/* mod-385-1 %jibb /tests/golden/types-module-fixtures/modules/ui/api/blog/jibb
1199/* mod-385-2 %jibb /tests/golden/types-module-fixtures/modules/ui/components/card/jibb
1197/* mod-385-2 %jibb /tests/golden/types-module-fixtures/modules/ui/components/card/jibb
1198+/* typ-385 %txt /tests/golden/types-module-fixtures/types/txt
1199+/* mtre-385 %txt /tests/golden/types-module-fixtures/module-trees/txt
1200−/* src-386 %jibb /tests/golden/types-partial-apply/source/jibb
1200+/* src-386 %jibb /tests/golden/types-module-mixed/source/jibb
1201+/* tok-386 %txt /tests/golden/types-module-mixed/tokens/txt
1202+/* tre-386 %txt /tests/golden/types-module-mixed/tree/txt
1203+/* mod-386-1 %jibb /tests/golden/types-module-mixed/modules/ui/helper/jibb
1204+/* typ-386 %txt /tests/golden/types-module-mixed/types/txt
1205+/* imp-386-1 %txt /tests/golden/types-module-mixed/sur/fixture/txt
1206+/* mark-386-1 %txt /tests/golden/types-module-mixed/mar/label/txt
1207+/* mtre-386 %txt /tests/golden/types-module-mixed/module-trees/txt
1208+/* src-387 %jibb /tests/golden/types-partial-apply/source/jibb
1201−/* tok-386 %txt /tests/golden/types-partial-apply/tokens/txt
1209+/* tok-387 %txt /tests/golden/types-partial-apply/tokens/txt
1202−/* tre-386 %txt /tests/golden/types-partial-apply/tree/txt
1210+/* tre-387 %txt /tests/golden/types-partial-apply/tree/txt
1203−/* typ-386 %txt /tests/golden/types-partial-apply/types/txt
1211+/* typ-387 %txt /tests/golden/types-partial-apply/types/txt
1204−/* src-387 %jibb /tests/golden/types-partial-atom-alias/source/jibb
1212+/* src-388 %jibb /tests/golden/types-partial-atom-alias/source/jibb
1205−/* tok-387 %txt /tests/golden/types-partial-atom-alias/tokens/txt
1213+/* tok-388 %txt /tests/golden/types-partial-atom-alias/tokens/txt
1206−/* tre-387 %txt /tests/golden/types-partial-atom-alias/tree/txt
1214+/* tre-388 %txt /tests/golden/types-partial-atom-alias/tree/txt
1207−/* typ-387 %txt /tests/golden/types-partial-atom-alias/types/txt
1215+/* typ-388 %txt /tests/golden/types-partial-atom-alias/types/txt
1208−/* src-388 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1216+/* src-389 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1209−/* tok-388 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1217+/* tok-389 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1210−/* tre-388 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1218+/* tre-389 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1211−/* typ-388 %txt /tests/golden/types-partial-atom-constraint/types/txt
1219+/* typ-389 %txt /tests/golden/types-partial-atom-constraint/types/txt
1212−/* src-389 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1220+/* src-390 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1213−/* tok-389 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1221+/* tok-390 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1214−/* tre-389 %txt /tests/golden/types-partial-atom-widening/tree/txt
1222+/* tre-390 %txt /tests/golden/types-partial-atom-widening/tree/txt
1215−/* typ-389 %txt /tests/golden/types-partial-atom-widening/types/txt
1223+/* typ-390 %txt /tests/golden/types-partial-atom-widening/types/txt
1216−/* src-390 %jibb /tests/golden/types-partial-aura/source/jibb
1224+/* src-391 %jibb /tests/golden/types-partial-aura/source/jibb
1217−/* tok-390 %txt /tests/golden/types-partial-aura/tokens/txt
1225+/* tok-391 %txt /tests/golden/types-partial-aura/tokens/txt
1218−/* tre-390 %txt /tests/golden/types-partial-aura/tree/txt
1226+/* tre-391 %txt /tests/golden/types-partial-aura/tree/txt
1219−/* typ-390 %txt /tests/golden/types-partial-aura/types/txt
1227+/* typ-391 %txt /tests/golden/types-partial-aura/types/txt
1220−/* src-391 %jibb /tests/golden/types-partial-aura-family/source/jibb
1228+/* src-392 %jibb /tests/golden/types-partial-aura-family/source/jibb
1221−/* tok-391 %txt /tests/golden/types-partial-aura-family/tokens/txt
1229+/* tok-392 %txt /tests/golden/types-partial-aura-family/tokens/txt
1222−/* tre-391 %txt /tests/golden/types-partial-aura-family/tree/txt
1230+/* tre-392 %txt /tests/golden/types-partial-aura-family/tree/txt
1223−/* typ-391 %txt /tests/golden/types-partial-aura-family/types/txt
1231+/* typ-392 %txt /tests/golden/types-partial-aura-family/types/txt
1224−/* src-392 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1232+/* src-393 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1225−/* tok-392 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1233+/* tok-393 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1226−/* tre-392 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1234+/* tre-393 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1227−/* typ-392 %txt /tests/golden/types-partial-aura-generalization/types/txt
1235+/* typ-393 %txt /tests/golden/types-partial-aura-generalization/types/txt
1228−/* src-393 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1236+/* src-394 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1229−/* tok-393 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1237+/* tok-394 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1230−/* tre-393 %txt /tests/golden/types-partial-bare-atom/tree/txt
1238+/* tre-394 %txt /tests/golden/types-partial-bare-atom/tree/txt
1231−/* typ-393 %txt /tests/golden/types-partial-bare-atom/types/txt
1239+/* typ-394 %txt /tests/golden/types-partial-bare-atom/types/txt
1232−/* src-394 %jibb /tests/golden/types-partial-branch-widening/source/jibb
1240+/* src-395 %jibb /tests/golden/types-partial-branch-widening/source/jibb
1233−/* tok-394 %txt /tests/golden/types-partial-branch-widening/tokens/txt
1241+/* tok-395 %txt /tests/golden/types-partial-branch-widening/tokens/txt
1234−/* tre-394 %txt /tests/golden/types-partial-branch-widening/tree/txt
1242+/* tre-395 %txt /tests/golden/types-partial-branch-widening/tree/txt
1235−/* typ-394 %txt /tests/golden/types-partial-branch-widening/types/txt
1243+/* typ-395 %txt /tests/golden/types-partial-branch-widening/types/txt
1236−/* src-395 %jibb /tests/golden/types-partial-conflicting-sites/source/jibb
1244+/* src-396 %jibb /tests/golden/types-partial-conflicting-sites/source/jibb
1237−/* tok-395 %txt /tests/golden/types-partial-conflicting-sites/tokens/txt
1245+/* tok-396 %txt /tests/golden/types-partial-conflicting-sites/tokens/txt
1238−/* tre-395 %txt /tests/golden/types-partial-conflicting-sites/tree/txt
1246+/* tre-396 %txt /tests/golden/types-partial-conflicting-sites/tree/txt
1239−/* typ-395 %txt /tests/golden/types-partial-conflicting-sites/types/txt
1247+/* typ-396 %txt /tests/golden/types-partial-conflicting-sites/types/txt
1240−/* src-396 %jibb /tests/golden/types-partial-decimal-default/source/jibb
1248+/* src-397 %jibb /tests/golden/types-partial-decimal-default/source/jibb
1241−/* tok-396 %txt /tests/golden/types-partial-decimal-default/tokens/txt
1249+/* tok-397 %txt /tests/golden/types-partial-decimal-default/tokens/txt
1242−/* tre-396 %txt /tests/golden/types-partial-decimal-default/tree/txt
1250+/* tre-397 %txt /tests/golden/types-partial-decimal-default/tree/txt
1243−/* typ-396 %txt /tests/golden/types-partial-decimal-default/types/txt
1251+/* typ-397 %txt /tests/golden/types-partial-decimal-default/types/txt
1244−/* src-397 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1252+/* src-398 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1245−/* tok-397 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1253+/* tok-398 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1246−/* tre-397 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1254+/* tre-398 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1247−/* typ-397 %txt /tests/golden/types-partial-dependency-chain/types/txt
1255+/* typ-398 %txt /tests/golden/types-partial-dependency-chain/types/txt
1248−/* src-398 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1256+/* src-399 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1249−/* tok-398 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1257+/* tok-399 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1250−/* tre-398 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1258+/* tre-399 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1251−/* typ-398 %txt /tests/golden/types-partial-explicit-capital/types/txt
1259+/* typ-399 %txt /tests/golden/types-partial-explicit-capital/types/txt
1252−/* src-399 %jibb /tests/golden/types-partial-forward/source/jibb
1260+/* src-400 %jibb /tests/golden/types-partial-forward/source/jibb
1253−/* tok-399 %txt /tests/golden/types-partial-forward/tokens/txt
1261+/* tok-400 %txt /tests/golden/types-partial-forward/tokens/txt
1254−/* tre-399 %txt /tests/golden/types-partial-forward/tree/txt
1262+/* tre-400 %txt /tests/golden/types-partial-forward/tree/txt
1255−/* typ-399 %txt /tests/golden/types-partial-forward/types/txt
1263+/* typ-400 %txt /tests/golden/types-partial-forward/types/txt
1256−/* src-400 %jibb /tests/golden/types-partial-generalization/source/jibb
1264+/* src-401 %jibb /tests/golden/types-partial-generalization/source/jibb
1257−/* tok-400 %txt /tests/golden/types-partial-generalization/tokens/txt
1265+/* tok-401 %txt /tests/golden/types-partial-generalization/tokens/txt
1258−/* tre-400 %txt /tests/golden/types-partial-generalization/tree/txt
1266+/* tre-401 %txt /tests/golden/types-partial-generalization/tree/txt
1259−/* typ-400 %txt /tests/golden/types-partial-generalization/types/txt
1267+/* typ-401 %txt /tests/golden/types-partial-generalization/types/txt
1260−/* src-401 %jibb /tests/golden/types-partial-identity/source/jibb
1268+/* src-402 %jibb /tests/golden/types-partial-identity/source/jibb
1261−/* tok-401 %txt /tests/golden/types-partial-identity/tokens/txt
1269+/* tok-402 %txt /tests/golden/types-partial-identity/tokens/txt
1262−/* tre-401 %txt /tests/golden/types-partial-identity/tree/txt
1270+/* tre-402 %txt /tests/golden/types-partial-identity/tree/txt
1263−/* typ-401 %txt /tests/golden/types-partial-identity/types/txt
1271+/* typ-402 %txt /tests/golden/types-partial-identity/types/txt
1264−/* src-402 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1272+/* src-403 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1265−/* tok-402 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1273+/* tok-403 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1266−/* tre-402 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1274+/* tre-403 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1267−/* typ-402 %txt /tests/golden/types-partial-independent-atoms/types/txt
1275+/* typ-403 %txt /tests/golden/types-partial-independent-atoms/types/txt
1276+/* src-404 %jibb /tests/golden/types-partial-local-molds/source/jibb
1277+/* tok-404 %txt /tests/golden/types-partial-local-molds/tokens/txt
1278+/* tre-404 %txt /tests/golden/types-partial-local-molds/tree/txt
1279+/* typ-404 %txt /tests/golden/types-partial-local-molds/types/txt
1268−/* src-403 %jibb /tests/golden/types-partial-locals/source/jibb
1280+/* src-405 %jibb /tests/golden/types-partial-locals/source/jibb
1269−/* tok-403 %txt /tests/golden/types-partial-locals/tokens/txt
1281+/* tok-405 %txt /tests/golden/types-partial-locals/tokens/txt
1270−/* tre-403 %txt /tests/golden/types-partial-locals/tree/txt
1282+/* tre-405 %txt /tests/golden/types-partial-locals/tree/txt
1271−/* typ-403 %txt /tests/golden/types-partial-locals/types/txt
1283+/* typ-405 %txt /tests/golden/types-partial-locals/types/txt
1272−/* src-404 %jibb /tests/golden/types-partial-many-atom-constraints/source/jibb
1284+/* src-406 %jibb /tests/golden/types-partial-many-atom-constraints/source/jibb
1273−/* tok-404 %txt /tests/golden/types-partial-many-atom-constraints/tokens/txt
1285+/* tok-406 %txt /tests/golden/types-partial-many-atom-constraints/tokens/txt
1274−/* tre-404 %txt /tests/golden/types-partial-many-atom-constraints/tree/txt
1286+/* tre-406 %txt /tests/golden/types-partial-many-atom-constraints/tree/txt
1275−/* typ-404 %txt /tests/golden/types-partial-many-atom-constraints/types/txt
1287+/* typ-406 %txt /tests/golden/types-partial-many-atom-constraints/types/txt
1276−/* src-405 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1288+/* src-407 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1277−/* tok-405 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1289+/* tok-407 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1278−/* tre-405 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1290+/* tre-407 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1279−/* typ-405 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1291+/* typ-407 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1280−/* src-406 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1292+/* src-408 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1281−/* tok-406 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1293+/* tok-408 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1282−/* tre-406 %txt /tests/golden/types-partial-mold-composite/tree/txt
1294+/* tre-408 %txt /tests/golden/types-partial-mold-composite/tree/txt
1283−/* typ-406 %txt /tests/golden/types-partial-mold-composite/types/txt
1295+/* typ-408 %txt /tests/golden/types-partial-mold-composite/types/txt
1284−/* src-407 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1296+/* src-409 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1285−/* tok-407 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1297+/* tok-409 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1286−/* tre-407 %txt /tests/golden/types-partial-mold-forward/tree/txt
1298+/* tre-409 %txt /tests/golden/types-partial-mold-forward/tree/txt
1287−/* typ-407 %txt /tests/golden/types-partial-mold-forward/types/txt
1299+/* typ-409 %txt /tests/golden/types-partial-mold-forward/types/txt
1288−/* src-408 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1300+/* src-410 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1289−/* tok-408 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1301+/* tok-410 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1290−/* tre-408 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1302+/* tre-410 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1291−/* typ-408 %txt /tests/golden/types-partial-mold-recursive/types/txt
1303+/* typ-410 %txt /tests/golden/types-partial-mold-recursive/types/txt
1292−/* src-409 %jibb /tests/golden/types-partial-occurs/source/jibb
1304+/* src-411 %jibb /tests/golden/types-partial-occurs/source/jibb
1293−/* tok-409 %txt /tests/golden/types-partial-occurs/tokens/txt
1305+/* tok-411 %txt /tests/golden/types-partial-occurs/tokens/txt
1294−/* tre-409 %txt /tests/golden/types-partial-occurs/tree/txt
1306+/* tre-411 %txt /tests/golden/types-partial-occurs/tree/txt
1295−/* typ-409 %txt /tests/golden/types-partial-occurs/types/txt
1307+/* typ-411 %txt /tests/golden/types-partial-occurs/types/txt
1296−/* src-410 %jibb /tests/golden/types-partial-projection/source/jibb
1308+/* src-412 %jibb /tests/golden/types-partial-projection/source/jibb
1297−/* tok-410 %txt /tests/golden/types-partial-projection/tokens/txt
1309+/* tok-412 %txt /tests/golden/types-partial-projection/tokens/txt
1298−/* tre-410 %txt /tests/golden/types-partial-projection/tree/txt
1310+/* tre-412 %txt /tests/golden/types-partial-projection/tree/txt
1299−/* typ-410 %txt /tests/golden/types-partial-projection/types/txt
1311+/* typ-412 %txt /tests/golden/types-partial-projection/types/txt
1300−/* src-411 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1312+/* src-413 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1301−/* tok-411 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1313+/* tok-413 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1302−/* tre-411 %txt /tests/golden/types-partial-shadow-global/tree/txt
1314+/* tre-413 %txt /tests/golden/types-partial-shadow-global/tree/txt
1303−/* typ-411 %txt /tests/golden/types-partial-shadow-global/types/txt
1315+/* typ-413 %txt /tests/golden/types-partial-shadow-global/types/txt
1304−/* src-412 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1316+/* src-414 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1305−/* tok-412 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1317+/* tok-414 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1306−/* tre-412 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1318+/* tre-414 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1307−/* typ-412 %txt /tests/golden/types-partial-shared-tvar/types/txt
1319+/* typ-414 %txt /tests/golden/types-partial-shared-tvar/types/txt
1308−/* src-413 %jibb /tests/golden/types-partial-union-cases/source/jibb
1320+/* src-415 %jibb /tests/golden/types-partial-union-cases/source/jibb
1309−/* tok-413 %txt /tests/golden/types-partial-union-cases/tokens/txt
1321+/* tok-415 %txt /tests/golden/types-partial-union-cases/tokens/txt
1310−/* tre-413 %txt /tests/golden/types-partial-union-cases/tree/txt
1322+/* tre-415 %txt /tests/golden/types-partial-union-cases/tree/txt
1311−/* typ-413 %txt /tests/golden/types-partial-union-cases/types/txt
1323+/* typ-415 %txt /tests/golden/types-partial-union-cases/types/txt
1312−/* src-414 %jibb /tests/golden/types-partial-union-edges/source/jibb
1324+/* src-416 %jibb /tests/golden/types-partial-union-edges/source/jibb
1313−/* tok-414 %txt /tests/golden/types-partial-union-edges/tokens/txt
1325+/* tok-416 %txt /tests/golden/types-partial-union-edges/tokens/txt
1314−/* tre-414 %txt /tests/golden/types-partial-union-edges/tree/txt
1326+/* tre-416 %txt /tests/golden/types-partial-union-edges/tree/txt
1315−/* typ-414 %txt /tests/golden/types-partial-union-edges/types/txt
1327+/* typ-416 %txt /tests/golden/types-partial-union-edges/types/txt
1316−/* src-415 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1328+/* src-417 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1317−/* tok-415 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1329+/* tok-417 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1318−/* tre-415 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1330+/* tre-417 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1319−/* typ-415 %txt /tests/golden/types-partial-unresolved-tag/types/txt
1331+/* typ-417 %txt /tests/golden/types-partial-unresolved-tag/types/txt
1320|%
1332|%
1321:: one arm per case
1333:: one arm per case
1322::
1334::
@@ -2089,67 +2101,71 @@
2089++ test-types-import-sur
2101++ test-types-import-sur
2090 (weld (check ~.types-import-sur src-384 `tok-384 `tre-384) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-384 `typ-384 ~[[%fixture %title imp-384-1] [%fixture %pair imp-384-2]]))
2102 (weld (check ~.types-import-sur src-384 `tok-384 `tre-384) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-384 `typ-384 ~[[%fixture %title imp-384-1] [%fixture %pair imp-384-2]]))
2091++ test-types-module-fixtures
2103++ test-types-module-fixtures
2092− (weld (weld (check-at ~.types-module-fixtures ~[~.ui ~.blog ~.index ~.jibb] src-385 `tok-385 `tre-385) (check-types ~.types-module-fixtures ~[~.ui ~.blog ~.index ~.jibb] src-385 `typ-385)) (check-module-trees ~.types-module-fixtures `mtre-385 ~[['/ui/api/blog.jibb' ~[~.ui ~.api ~.blog ~.jibb] mod-385-1] ['/ui/components/card.jibb' ~[~.ui ~.components ~.card ~.jibb] mod-385-2]]))
2104+ (weld (weld (check-at ~.types-module-fixtures ~[~.ui ~.blog ~.index ~.jibb] src-385 `tok-385 `tre-385) (check-module-types ~.types-module-fixtures ~[~.ui ~.blog ~.index ~.jibb] src-385 `typ-385 ~ ~ ~[['/ui/api/blog.jibb' ~[~.ui ~.api ~.blog ~.jibb] mod-385-1] ['/ui/components/card.jibb' ~[~.ui ~.components ~.card ~.jibb] mod-385-2]])) (check-module-trees ~.types-module-fixtures `mtre-385 ~[['/ui/api/blog.jibb' ~[~.ui ~.api ~.blog ~.jibb] mod-385-1] ['/ui/components/card.jibb' ~[~.ui ~.components ~.card ~.jibb] mod-385-2]]))
2105+++ test-types-module-mixed
2106+ (weld (weld (check ~.types-module-mixed src-386 `tok-386 `tre-386) (check-module-types ~.types-module-mixed ~[%tests %golden ~.types-module-mixed %source %jibb] src-386 `typ-386 ~[[%fixture %title imp-386-1]] ~[[%label mark-386-1]] ~[['/ui/helper.jibb' ~[~.ui ~.helper ~.jibb] mod-386-1]])) (check-module-trees ~.types-module-mixed `mtre-386 ~[['/ui/helper.jibb' ~[~.ui ~.helper ~.jibb] mod-386-1]]))
2093++ test-types-partial-apply
2107++ test-types-partial-apply
2094− (weld (check ~.types-partial-apply src-386 `tok-386 `tre-386) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-386 `typ-386))
2108+ (weld (check ~.types-partial-apply src-387 `tok-387 `tre-387) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-387 `typ-387))
2095++ test-types-partial-atom-alias
2109++ test-types-partial-atom-alias
2096− (weld (check ~.types-partial-atom-alias src-387 `tok-387 `tre-387) (check-types ~.types-partial-atom-alias ~[%tests %golden ~.types-partial-atom-alias %source %jibb] src-387 `typ-387))
2110+ (weld (check ~.types-partial-atom-alias src-388 `tok-388 `tre-388) (check-types ~.types-partial-atom-alias ~[%tests %golden ~.types-partial-atom-alias %source %jibb] src-388 `typ-388))
2097++ test-types-partial-atom-constraint
2111++ test-types-partial-atom-constraint
2098− (weld (check ~.types-partial-atom-constraint src-388 `tok-388 `tre-388) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-388 `typ-388))
2112+ (weld (check ~.types-partial-atom-constraint src-389 `tok-389 `tre-389) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-389 `typ-389))
2099++ test-types-partial-atom-widening
2113++ test-types-partial-atom-widening
2100− (weld (check ~.types-partial-atom-widening src-389 `tok-389 `tre-389) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-389 `typ-389))
2114+ (weld (check ~.types-partial-atom-widening src-390 `tok-390 `tre-390) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-390 `typ-390))
2101++ test-types-partial-aura
2115++ test-types-partial-aura
2102− (weld (check ~.types-partial-aura src-390 `tok-390 `tre-390) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-390 `typ-390))
2116+ (weld (check ~.types-partial-aura src-391 `tok-391 `tre-391) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-391 `typ-391))
2103++ test-types-partial-aura-family
2117++ test-types-partial-aura-family
2104− (weld (check ~.types-partial-aura-family src-391 `tok-391 `tre-391) (check-types ~.types-partial-aura-family ~[%tests %golden ~.types-partial-aura-family %source %jibb] src-391 `typ-391))
2118+ (weld (check ~.types-partial-aura-family src-392 `tok-392 `tre-392) (check-types ~.types-partial-aura-family ~[%tests %golden ~.types-partial-aura-family %source %jibb] src-392 `typ-392))
2105++ test-types-partial-aura-generalization
2119++ test-types-partial-aura-generalization
2106− (weld (check ~.types-partial-aura-generalization src-392 `tok-392 `tre-392) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-392 `typ-392))
2120+ (weld (check ~.types-partial-aura-generalization src-393 `tok-393 `tre-393) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-393 `typ-393))
2107++ test-types-partial-bare-atom
2121++ test-types-partial-bare-atom
2108− (weld (check ~.types-partial-bare-atom src-393 `tok-393 `tre-393) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-393 `typ-393))
2122+ (weld (check ~.types-partial-bare-atom src-394 `tok-394 `tre-394) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-394 `typ-394))
2109++ test-types-partial-branch-widening
2123++ test-types-partial-branch-widening
2110− (weld (check ~.types-partial-branch-widening src-394 `tok-394 `tre-394) (check-types ~.types-partial-branch-widening ~[%tests %golden ~.types-partial-branch-widening %source %jibb] src-394 `typ-394))
2124+ (weld (check ~.types-partial-branch-widening src-395 `tok-395 `tre-395) (check-types ~.types-partial-branch-widening ~[%tests %golden ~.types-partial-branch-widening %source %jibb] src-395 `typ-395))
2111++ test-types-partial-conflicting-sites
2125++ test-types-partial-conflicting-sites
2112− (weld (check ~.types-partial-conflicting-sites src-395 `tok-395 `tre-395) (check-types ~.types-partial-conflicting-sites ~[%tests %golden ~.types-partial-conflicting-sites %source %jibb] src-395 `typ-395))
2126+ (weld (check ~.types-partial-conflicting-sites src-396 `tok-396 `tre-396) (check-types ~.types-partial-conflicting-sites ~[%tests %golden ~.types-partial-conflicting-sites %source %jibb] src-396 `typ-396))
2113++ test-types-partial-decimal-default
2127++ test-types-partial-decimal-default
2114− (weld (check ~.types-partial-decimal-default src-396 `tok-396 `tre-396) (check-types ~.types-partial-decimal-default ~[%tests %golden ~.types-partial-decimal-default %source %jibb] src-396 `typ-396))
2128+ (weld (check ~.types-partial-decimal-default src-397 `tok-397 `tre-397) (check-types ~.types-partial-decimal-default ~[%tests %golden ~.types-partial-decimal-default %source %jibb] src-397 `typ-397))
2115++ test-types-partial-dependency-chain
2129++ test-types-partial-dependency-chain
2116− (weld (check ~.types-partial-dependency-chain src-397 `tok-397 `tre-397) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-397 `typ-397))
2130+ (weld (check ~.types-partial-dependency-chain src-398 `tok-398 `tre-398) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-398 `typ-398))
2117++ test-types-partial-explicit-capital
2131++ test-types-partial-explicit-capital
2118− (weld (check ~.types-partial-explicit-capital src-398 `tok-398 `tre-398) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-398 `typ-398))
2132+ (weld (check ~.types-partial-explicit-capital src-399 `tok-399 `tre-399) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-399 `typ-399))
2119++ test-types-partial-forward
2133++ test-types-partial-forward
2120− (weld (check ~.types-partial-forward src-399 `tok-399 `tre-399) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-399 `typ-399))
2134+ (weld (check ~.types-partial-forward src-400 `tok-400 `tre-400) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-400 `typ-400))
2121++ test-types-partial-generalization
2135++ test-types-partial-generalization
2122− (weld (check ~.types-partial-generalization src-400 `tok-400 `tre-400) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-400 `typ-400))
2136+ (weld (check ~.types-partial-generalization src-401 `tok-401 `tre-401) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-401 `typ-401))
2123++ test-types-partial-identity
2137++ test-types-partial-identity
2124− (weld (check ~.types-partial-identity src-401 `tok-401 `tre-401) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-401 `typ-401))
2138+ (weld (check ~.types-partial-identity src-402 `tok-402 `tre-402) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-402 `typ-402))
2125++ test-types-partial-independent-atoms
2139++ test-types-partial-independent-atoms
2126− (weld (check ~.types-partial-independent-atoms src-402 `tok-402 `tre-402) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-402 `typ-402))
2140+ (weld (check ~.types-partial-independent-atoms src-403 `tok-403 `tre-403) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-403 `typ-403))
2141+++ test-types-partial-local-molds
2142+ (weld (check ~.types-partial-local-molds src-404 `tok-404 `tre-404) (check-types ~.types-partial-local-molds ~[%tests %golden ~.types-partial-local-molds %source %jibb] src-404 `typ-404))
2127++ test-types-partial-locals
2143++ test-types-partial-locals
2128− (weld (check ~.types-partial-locals src-403 `tok-403 `tre-403) (check-types ~.types-partial-locals ~[%tests %golden ~.types-partial-locals %source %jibb] src-403 `typ-403))
2144+ (weld (check ~.types-partial-locals src-405 `tok-405 `tre-405) (check-types ~.types-partial-locals ~[%tests %golden ~.types-partial-locals %source %jibb] src-405 `typ-405))
2129++ test-types-partial-many-atom-constraints
2145++ test-types-partial-many-atom-constraints
2130− (weld (check ~.types-partial-many-atom-constraints src-404 `tok-404 `tre-404) (check-types ~.types-partial-many-atom-constraints ~[%tests %golden ~.types-partial-many-atom-constraints %source %jibb] src-404 `typ-404))
2146+ (weld (check ~.types-partial-many-atom-constraints src-406 `tok-406 `tre-406) (check-types ~.types-partial-many-atom-constraints ~[%tests %golden ~.types-partial-many-atom-constraints %source %jibb] src-406 `typ-406))
2131++ test-types-partial-mold-bare-aura
2147++ test-types-partial-mold-bare-aura
2132− (weld (check ~.types-partial-mold-bare-aura src-405 `tok-405 `tre-405) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-405 `typ-405))
2148+ (weld (check ~.types-partial-mold-bare-aura src-407 `tok-407 `tre-407) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-407 `typ-407))
2133++ test-types-partial-mold-composite
2149++ test-types-partial-mold-composite
2134− (weld (check ~.types-partial-mold-composite src-406 `tok-406 `tre-406) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-406 `typ-406))
2150+ (weld (check ~.types-partial-mold-composite src-408 `tok-408 `tre-408) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-408 `typ-408))
2135++ test-types-partial-mold-forward
2151++ test-types-partial-mold-forward
2136− (weld (check ~.types-partial-mold-forward src-407 `tok-407 `tre-407) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-407 `typ-407))
2152+ (weld (check ~.types-partial-mold-forward src-409 `tok-409 `tre-409) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-409 `typ-409))
2137++ test-types-partial-mold-recursive
2153++ test-types-partial-mold-recursive
2138− (weld (check ~.types-partial-mold-recursive src-408 `tok-408 `tre-408) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-408 `typ-408))
2154+ (weld (check ~.types-partial-mold-recursive src-410 `tok-410 `tre-410) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-410 `typ-410))
2139++ test-types-partial-occurs
2155++ test-types-partial-occurs
2140− (weld (check ~.types-partial-occurs src-409 `tok-409 `tre-409) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-409 `typ-409))
2156+ (weld (check ~.types-partial-occurs src-411 `tok-411 `tre-411) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-411 `typ-411))
2141++ test-types-partial-projection
2157++ test-types-partial-projection
2142− (weld (check ~.types-partial-projection src-410 `tok-410 `tre-410) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-410 `typ-410))
2158+ (weld (check ~.types-partial-projection src-412 `tok-412 `tre-412) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-412 `typ-412))
2143++ test-types-partial-shadow-global
2159++ test-types-partial-shadow-global
2144− (weld (check ~.types-partial-shadow-global src-411 `tok-411 `tre-411) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-411 `typ-411))
2160+ (weld (check ~.types-partial-shadow-global src-413 `tok-413 `tre-413) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-413 `typ-413))
2145++ test-types-partial-shared-tvar
2161++ test-types-partial-shared-tvar
2146− (weld (check ~.types-partial-shared-tvar src-412 `tok-412 `tre-412) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-412 `typ-412))
2162+ (weld (check ~.types-partial-shared-tvar src-414 `tok-414 `tre-414) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-414 `typ-414))
2147++ test-types-partial-union-cases
2163++ test-types-partial-union-cases
2148− (weld (check ~.types-partial-union-cases src-413 `tok-413 `tre-413) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-413 `typ-413))
2164+ (weld (check ~.types-partial-union-cases src-415 `tok-415 `tre-415) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-415 `typ-415))
2149++ test-types-partial-union-edges
2165++ test-types-partial-union-edges
2150− (weld (check ~.types-partial-union-edges src-414 `tok-414 `tre-414) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-414 `typ-414))
2166+ (weld (check ~.types-partial-union-edges src-416 `tok-416 `tre-416) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-416 `typ-416))
2151++ test-types-partial-unresolved-tag
2167++ test-types-partial-unresolved-tag
2152− (weld (check ~.types-partial-unresolved-tag src-415 `tok-415 `tre-415) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-415 `typ-415))
2168+ (weld (check ~.types-partial-unresolved-tag src-417 `tok-417 `tre-417) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-417 `typ-417))
2153::
2169::
2154:: +check: run golden:jibb on a case and compare both outputs
2170:: +check: run golden:jibb on a case and compare both outputs
2155::
2171::
@@ -2281,4 +2297,35 @@
2281 =/ out (golden:jibb at.fixture source.fixture)
2297 =/ out (golden:jibb at.fixture source.fixture)
2282 (rap 3 ~[label.fixture '\0a' tree.out])
2298 (rap 3 ~[label.fixture '\0a' tree.out])
2283 actual
2299 actual
2300+::
2301+++ check-module-types
2302+ |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain]) modules=(list [label=@t at=path source=@t])]
2303+ ^- tang
2304+ =/ result (mule |.((module-types-result at src fixtures marks modules)))
2305+ ?: ?=(%| -.result)
2306+ [leaf+"fixture compilation or type checking crashed" p.result]
2307+ (compare (file case "types.txt") want p.result)
2308+::
2309+++ module-types-result
2310+ |= [at=path src=@t fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain]) modules=(list [label=@t at=path source=@t])]
2311+ ^- @t
2312+ =/ external=(list [module=term name=term result=*])
2313+ %+ turn fixtures
2314+ |= fixture=[module=term mold=term source=wain]
2315+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
2316+ ?~ source.fixture !!
2317+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2318+ =/ cor=type -:(ride -:!>(..zuse) text)
2319+ [module.fixture mold.fixture (read-named:jibb-import module.fixture mold.fixture cor)]
2320+ =/ mark-external=(list [name=term result=*])
2321+ %+ turn marks
2322+ |= fixture=[name=term source=wain]
2323+ ~_ leaf+"/mar/{(trip name.fixture)}.txt fixture"
2324+ ?~ source.fixture !!
2325+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2326+ =/ cor=type -:(ride -:!>(..zuse) text)
2327+ [name.fixture (read-mark:jibb-import name.fixture cor)]
2328+ =/ sources=(list [path=path source=@t])
2329+ (turn modules |=(item=[label=@t at=path source=@t] [at.item source.item]))
2330+ (golden-types-with-modules:jibb at src external mark-external sources)
2284--
2331--
tools/clay-fixtures+13
@@ -90,6 +90,19 @@ if result.stdout != expected:
90 sys.exit(1)
90 sys.exit(1)
91print('Clay Ford importer golden passed')
91print('Clay Ford importer golden passed')
92
92
93+try:
94+ result = subprocess.run([str(ship), 'run', str(fixtures / 'ford-recursive.txt')],
95+ stdout=subprocess.PIPE, check=True)
96+except subprocess.CalledProcessError as error:
97+ sys.exit(error.returncode)
98+expected = (fixtures / 'ford-recursive-expected.txt').read_bytes()
99+if result.stdout != expected:
100+ print('Clay recursive Ford import differs from tests/clay-fixtures/ford-recursive-expected.txt', file=sys.stderr)
101+ print('expected:', expected.decode().rstrip(), file=sys.stderr)
102+ print('actual: ', result.stdout.decode().rstrip(), file=sys.stderr)
103+ sys.exit(1)
104+print('Clay recursive Ford importer golden passed')
105+
93try:
106try:
94 result = subprocess.run([str(ship), 'run', str(fixtures / 'mark-shape.txt')],
107 result = subprocess.run([str(ship), 'run', str(fixtures / 'mark-shape.txt')],
95 stdout=subprocess.PIPE, check=True)
108 stdout=subprocess.PIPE, check=True)
tools/golden+13−5
@@ -235,18 +235,26 @@ def golden_program(lib_path, cases):
235 imported = any(c.imports or c.marks for c in cases)
235 imported = any(c.imports or c.marks for c in cases)
236 has_marks = any(c.marks for c in cases)
236 has_marks = any(c.marks for c in cases)
237 has_modules = any(c.modules for c in cases)
237 has_modules = any(c.modules for c in cases)
238+ has_module_types = any(c.modules and c.want_types for c in cases)
238 harness = HARNESS
239 harness = HARNESS
239 if imported:
240 if imported:
240 reader = ue.read_text(os.path.join(ue.ROOT, 'jibb-dev', 'lib', 'jibb-import.hoon'))
241 reader = ue.read_text(os.path.join(ue.ROOT, 'jibb-dev', 'lib', 'jibb-import.hoon'))
241 harness = harness.replace('=> [lib=. ..zuse]',
242 harness = harness.replace('=> [lib=. ..zuse]',
242 '=/ jibb-lib .\n=/ reader\n' + reader +
243 '=/ jibb-lib .\n=/ reader\n' + reader +
243 '\n=> [lib=jibb-lib reader=reader ..zuse]')
244 '\n=> [lib=jibb-lib reader=reader ..zuse]')
244− types_expr = ("?:(check.metadata (golden-types-with-marks:lib at src "
245+ types_value = ("(golden-types-with-marks:lib at src "
245− "(import-types imports.metadata) (import-marks marks.metadata)) '')"
246+ "(import-types imports.metadata) (import-marks marks.metadata))"
246 if has_marks else
247 if has_marks else
247− "?:(check.metadata ?~(imports.metadata (golden-types:lib at src) "
248+ "?~(imports.metadata (golden-types:lib at src) "
248− "(golden-types-imports:lib at src (import-types imports.metadata))) '')"
249+ "(golden-types-imports:lib at src (import-types imports.metadata)))"
249− if imported else "?:(check.metadata (golden-types:lib at src) '')")
250+ if imported else "(golden-types:lib at src)")
251+ if has_module_types:
252+ surs = '(import-types imports.metadata)' if imported else '~'
253+ marks = '(import-marks marks.metadata)' if imported else '~'
254+ modules = '(turn modules.metadata |=(item=[label=@t at=path source=@t] [at.item source.item]))'
255+ types_value = ('?~(modules.metadata %s (golden-types-with-modules:lib '
256+ 'at src %s %s %s))' % (types_value, surs, marks, modules))
257+ types_expr = '?:(check.metadata %s \'\')' % types_value
250 prog.add(harness.replace('{count}', str(len(cases)))
258 prog.add(harness.replace('{count}', str(len(cases)))
251 .replace('{runs}', runs)
259 .replace('{runs}', runs)
252 .replace('{types-expr}', types_expr if any(c.want_types for c in cases) else "''")
260 .replace('{types-expr}', types_expr if any(c.want_types for c in cases) else "''")
tools/importer-test+5−2
@@ -19,7 +19,10 @@ command = [str(root / 'tools' / 'hoon'), '--lib', str(root / 'jibb-dev' / 'lib'
19 '--cord', 'mark-rec=' + str(fixture / 'mark-recursive.txt'),
19 '--cord', 'mark-rec=' + str(fixture / 'mark-recursive.txt'),
20 '--cord', 'mark-gate=' + str(fixture / 'mark-gate.txt'),
20 '--cord', 'mark-gate=' + str(fixture / 'mark-gate.txt'),
21 '--cord', 'mark-basic=' + str(fixture / 'mark-list.txt'),
21 '--cord', 'mark-basic=' + str(fixture / 'mark-list.txt'),
22+ '--cord', 'origin-trans=' + str(fixture / 'origin-transitive.txt'),
23+ '--cord', 'origin-first=' + str(fixture / 'origin-first.txt'),
24+ '--cord', 'origin-other=' + str(fixture / 'origin-other.txt'),
22− '(fixture-output small epic presence docs shadow shadow-static ford mark mark-rec mark-gate mark-basic)']
25+ '(fixture-output small epic presence docs shadow shadow-static ford mark mark-rec mark-gate mark-basic origin-trans origin-first origin-other)']
23result = subprocess.run(command, stdout=subprocess.PIPE)
26result = subprocess.run(command, stdout=subprocess.PIPE)
24if result.returncode:
27if result.returncode:
25 sys.exit(result.returncode)
28 sys.exit(result.returncode)
@@ -31,4 +34,4 @@ if result.stdout != expected:
31 result.stdout.decode().splitlines(keepends=True),
34 result.stdout.decode().splitlines(keepends=True),
32 fromfile='expected tree.txt', tofile='actual types'))
35 fromfile='expected tree.txt', tofile='actual types'))
33 sys.exit(1)
36 sys.exit(1)
34−print('importer golden: 74 projections passed')
37+print('importer golden: 81 projections passed')
tools/ship+66−12
@@ -1050,11 +1050,17 @@ def arm_names(names):
1050 return out
1050 return out
1051
1051
1052
1052
1053+def hoon_list(items):
1054+ """Render a Hoon list, including the empty list, which is just ~."""
1055+ return '~[' + ' '.join(items) + ']' if items else '~'
1056+
1057+
1053def generate_tests(golden):
1058def generate_tests(golden):
1054 cases = golden_cases(golden)
1059 cases = golden_cases(golden)
1055 has_imports = False
1060 has_imports = False
1056 has_marks = False
1061 has_marks = False
1057 has_modules = False
1062 has_modules = False
1063+ has_module_types = False
1058 for _, folder in cases:
1064 for _, folder in cases:
1059 try:
1065 try:
1060 sur = golden_case.sur_imports(folder)
1066 sur = golden_case.sur_imports(folder)
@@ -1063,10 +1069,11 @@ def generate_tests(golden):
1063 has_imports |= bool(sur or marks)
1069 has_imports |= bool(sur or marks)
1064 has_marks |= bool(marks)
1070 has_marks |= bool(marks)
1065 has_modules |= bool(modules)
1071 has_modules |= bool(modules)
1072+ has_module_types |= bool(modules and golden_case.wants_types(folder))
1066 except ValueError as e:
1073 except ValueError as e:
1067 raise Unable(str(e))
1074 raise Unable(str(e))
1068 lines = [fill(TESTS_HEADER, SOURCE=show(golden)).rstrip('\n'),
1075 lines = [fill(TESTS_HEADER, SOURCE=show(golden)).rstrip('\n'),
1069− '/+ jibb, jibb-import' if has_imports else '/+ jibb']
1076+ '/+ jibb, jibb-import' if has_imports or has_module_types else '/+ jibb']
1070 arms = []
1077 arms = []
1071 for i, ((name, folder), arm) in enumerate(
1078 for i, ((name, folder), arm) in enumerate(
1072 zip(cases, arm_names([c[0] for c in cases])), 1):
1079 zip(cases, arm_names([c[0] for c in cases])), 1):
@@ -1093,6 +1100,12 @@ def generate_tests(golden):
1093 else:
1100 else:
1094 args.append('~')
1101 args.append('~')
1095 call = '(%s %s)' % ('check-at' if logical else 'check', ' '.join(args))
1102 call = '(%s %s)' % ('check-at' if logical else 'check', ' '.join(args))
1103+ module_fixtures = []
1104+ for j, (module, at, _) in enumerate(modules, 1):
1105+ face = 'mod-%d-%d' % (i, j)
1106+ lines.append('/* %s %%jibb %s/modules%s/jibb' %
1107+ (face, base, module[:-5]))
1108+ module_fixtures.append('[%s %s %s]' % (hoon_cord(module.encode()), at, face))
1096 if golden_case.wants_types(folder):
1109 if golden_case.wants_types(folder):
1097 if os.path.isfile(os.path.join(folder, 'types.txt')):
1110 if os.path.isfile(os.path.join(folder, 'types.txt')):
1098 lines.append('/* typ-%d %%txt %s/types/txt' % (i, base))
1111 lines.append('/* typ-%d %%txt %s/types/txt' % (i, base))
@@ -1100,7 +1113,21 @@ def generate_tests(golden):
1100 else:
1113 else:
1101 expected_types = '~'
1114 expected_types = '~'
1102 path = logical or '~[%%tests %%golden ~.%s %%source %%jibb]' % name
1115 path = logical or '~[%%tests %%golden ~.%s %%source %%jibb]' % name
1116+ if modules:
1117+ fixtures = []
1118+ for j, (module, mold, _) in enumerate(imports, 1):
1119+ face = 'imp-%d-%d' % (i, j)
1120+ lines.append('/* %s %%txt %s/sur/%s/txt' % (face, base, module))
1121+ fixtures.append('[%%%s %%%s %s]' % (module, mold, face))
1122+ mark_fixtures = []
1123+ for j, (mark, _) in enumerate(marks, 1):
1124+ face = 'mark-%d-%d' % (i, j)
1125+ lines.append('/* %s %%txt %s/mar/%s/txt' % (face, base, mark))
1126+ mark_fixtures.append('[%%%s %s]' % (mark, face))
1127+ call = '(weld %s (check-module-types ~.%s %s src-%d %s %s %s %s))' % (
1128+ call, name, path, i, expected_types, hoon_list(fixtures),
1129+ hoon_list(mark_fixtures), hoon_list(module_fixtures))
1103− if marks:
1130+ elif marks:
1104 fixtures = []
1131 fixtures = []
1105 for j, (module, mold, _) in enumerate(imports, 1):
1132 for j, (module, mold, _) in enumerate(imports, 1):
1106 face = 'imp-%d-%d' % (i, j)
1133 face = 'imp-%d-%d' % (i, j)
@@ -1111,9 +1138,9 @@ def generate_tests(golden):
1111 face = 'mark-%d-%d' % (i, j)
1138 face = 'mark-%d-%d' % (i, j)
1112 lines.append('/* %s %%txt %s/mar/%s/txt' % (face, base, mark))
1139 lines.append('/* %s %%txt %s/mar/%s/txt' % (face, base, mark))
1113 mark_fixtures.append('[%%%s %s]' % (mark, face))
1140 mark_fixtures.append('[%%%s %s]' % (mark, face))
1114− call = '(weld %s (check-mark-types ~.%s %s src-%d %s ~[%s] ~[%s]))' % (
1141+ call = '(weld %s (check-mark-types ~.%s %s src-%d %s %s %s))' % (
1115− call, name, path, i, expected_types, ' '.join(fixtures),
1142+ call, name, path, i, expected_types, hoon_list(fixtures),
1116− ' '.join(mark_fixtures))
1143+ hoon_list(mark_fixtures))
1117 elif imports:
1144 elif imports:
1118 fixtures = []
1145 fixtures = []
1119 for j, (module, mold, _) in enumerate(imports, 1):
1146 for j, (module, mold, _) in enumerate(imports, 1):
@@ -1131,14 +1158,8 @@ def generate_tests(golden):
1131 expected_modules = '`mtre-%d' % i
1158 expected_modules = '`mtre-%d' % i
1132 else:
1159 else:
1133 expected_modules = '~'
1160 expected_modules = '~'
1134− fixtures = []
1135− for j, (module, at, _) in enumerate(modules, 1):
1136− face = 'mod-%d-%d' % (i, j)
1137− lines.append('/* %s %%jibb %s/modules%s/jibb' %
1138− (face, base, module[:-5]))
1139− fixtures.append('[%s %s %s]' % (hoon_cord(module.encode()), at, face))
1140 call = '(weld %s (check-module-trees ~.%s %s ~[%s]))' % (
1161 call = '(weld %s (check-module-trees ~.%s %s ~[%s]))' % (
1141− call, name, expected_modules, ' '.join(fixtures))
1162+ call, name, expected_modules, ' '.join(module_fixtures))
1142 arms.append('++ %s\n %s' % (arm, call))
1163 arms.append('++ %s\n %s' % (arm, call))
1143 lines.append('|%')
1164 lines.append('|%')
1144 if arms:
1165 if arms:
@@ -1229,6 +1250,39 @@ def generate_tests(golden):
1229 =/ out (golden:jibb at.fixture source.fixture)
1250 =/ out (golden:jibb at.fixture source.fixture)
1230 (rap 3 ~[label.fixture '\\0a' tree.out])
1251 (rap 3 ~[label.fixture '\\0a' tree.out])
1231 actual
1252 actual
1253+'''
1254+ if has_module_types:
1255+ types_helper += '''::
1256+++ check-module-types
1257+ |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain]) modules=(list [label=@t at=path source=@t])]
1258+ ^- tang
1259+ =/ result (mule |.((module-types-result at src fixtures marks modules)))
1260+ ?: ?=(%| -.result)
1261+ [leaf+"fixture compilation or type checking crashed" p.result]
1262+ (compare (file case "types.txt") want p.result)
1263+::
1264+++ module-types-result
1265+ |= [at=path src=@t fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain]) modules=(list [label=@t at=path source=@t])]
1266+ ^- @t
1267+ =/ external=(list [module=term name=term result=*])
1268+ %+ turn fixtures
1269+ |= fixture=[module=term mold=term source=wain]
1270+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
1271+ ?~ source.fixture !!
1272+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1273+ =/ cor=type -:(ride -:!>(..zuse) text)
1274+ [module.fixture mold.fixture (read-named:jibb-import module.fixture mold.fixture cor)]
1275+ =/ mark-external=(list [name=term result=*])
1276+ %+ turn marks
1277+ |= fixture=[name=term source=wain]
1278+ ~_ leaf+"/mar/{(trip name.fixture)}.txt fixture"
1279+ ?~ source.fixture !!
1280+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1281+ =/ cor=type -:(ride -:!>(..zuse) text)
1282+ [name.fixture (read-mark:jibb-import name.fixture cor)]
1283+ =/ sources=(list [path=path source=@t])
1284+ (turn modules |=(item=[label=@t at=path source=@t] [at.item source.item]))
1285+ (golden-types-with-modules:jibb at src external mark-external sources)
1232'''
1286'''
1233 return '\n'.join(lines) + '\n' + TESTS_HELPERS.replace('\n--\n', '\n' + types_helper + '--\n')
1287 return '\n'.join(lines) + '\n' + TESTS_HELPERS.replace('\n--\n', '\n' + types_helper + '--\n')
1234
1288
tools/testdata/ship-selftest+41
@@ -165,6 +165,41 @@ def generator_checks(tmp):
165 "['/ui/card.jibb' ~[~.ui ~.card ~.jibb] mod-1-1]" in out and
165 "['/ui/card.jibb' ~[~.ui ~.card ~.jibb] mod-1-1]" in out and
166 '(golden:jibb at.fixture source.fixture)' in out and
166 '(golden:jibb at.fixture source.fixture)' in out and
167 '(check-module-trees ~.main ~' in out, out)
167 '(check-module-trees ~.main ~' in out, out)
168+ with open(os.path.join(folder, 'types.txt'), 'w') as f:
169+ f.write('partial\n')
170+ out = ship.generate_tests(module_cases)
171+ check('Jibb module sources are also supplied to the partial checker',
172+ '(check-module-types ~.main' in out and
173+ '(golden-types-with-modules:jibb at src external mark-external sources)' in out and
174+ "['/ui/card.jibb' ~[~.ui ~.card ~.jibb] mod-1-1]" in out and
175+ 'src-1 `typ-1 ~ ~ ~[[' in out and '~[]' not in out, out)
176+ os.makedirs(os.path.join(folder, 'sur'))
177+ os.makedirs(os.path.join(folder, 'mar'))
178+ with open(os.path.join(folder, 'sur', 'fixture.txt'), 'w') as f:
179+ f.write('|%\n+$ title @t\n--\n')
180+ with open(os.path.join(folder, 'mar', 'label.txt'), 'w') as f:
181+ f.write('|_ a=@t\n--\n')
182+ with open(os.path.join(folder, 'imports.txt'), 'w') as f:
183+ f.write('fixture title\n')
184+ with open(os.path.join(folder, 'marks.txt'), 'w') as f:
185+ f.write('label\n')
186+ out = ship.generate_tests(module_cases)
187+ check('Hoon molds, marks and Jibb modules are supplied together',
188+ '[%fixture %title imp-1-1]' in out and '[%label mark-1-1]' in out and
189+ "['/ui/card.jibb' ~[~.ui ~.card ~.jibb] mod-1-1]" in out and
190+ '(check-module-types ~.main' in out, out)
191+ os.remove(os.path.join(folder, 'imports.txt'))
192+ out = ship.generate_tests(module_cases)
193+ check('Jibb modules and marks work without /sur fixtures',
194+ 'src-1 `typ-1 ~ ~[[%label mark-1-1]] ~[[' in out and
195+ '~[]' not in out, out)
196+ os.remove(os.path.join(folder, 'marks.txt'))
197+ with open(os.path.join(folder, 'imports.txt'), 'w') as f:
198+ f.write('fixture title\n')
199+ out = ship.generate_tests(module_cases)
200+ check('Jibb modules and /sur fixtures work without marks',
201+ 'src-1 `typ-1 ~[[%fixture %title imp-1-1]] ~ ~[[' in out and
202+ '~[]' not in out, out)
168 with open(os.path.join(folder, 'modules.txt'), 'a') as f:
203 with open(os.path.join(folder, 'modules.txt'), 'a') as f:
169 f.write('/ui/card.jibb\n')
204 f.write('/ui/card.jibb\n')
170 try:
205 try:
@@ -205,6 +240,12 @@ def generator_checks(tmp):
205 '(mule |.((mark-types-result at src fixtures marks)))' in out and
240 '(mule |.((mark-types-result at src fixtures marks)))' in out and
206 '/mar/{(trip name.fixture)}.txt fixture' in out and
241 '/mar/{(trip name.fixture)}.txt fixture' in out and
207 '/sur/{(trip module.fixture)}.txt fixture' in out, out)
242 '/sur/{(trip module.fixture)}.txt fixture' in out, out)
243+ os.remove(os.path.join(folder, 'imports.txt'))
244+ out = ship.generate_tests(imported)
245+ check('mark-only fixtures use a valid empty /sur list',
246+ 'src-1 `typ-1 ~ ~[[%label mark-1-1]]' in out and '~[]' not in out, out)
247+ with open(os.path.join(folder, 'imports.txt'), 'w') as f:
248+ f.write('fixture title\n')
208 with open(os.path.join(folder, 'marks.txt'), 'a') as f:
249 with open(os.path.join(folder, 'marks.txt'), 'a') as f:
209 f.write('label\n')
250 f.write('label\n')
210 try:
251 try: