on master help sign in
Import mark samples and strengthen partial inference
commitbd379898d1ce1607eabebf14897bf6787b8bc938 authoriko <mail@iko.soy> dateFri 30 Oct 2026, 18:14 (7 hours ago) parent47a1f49
65 files changed+2935−184
docs/compiler.md+2−2 docs/development.md+5−3 docs/status.md+8−6 jibb-dev/lib/jibb-import.hoon+77−5 jibb-dev/lib/jibb.hoon+101−14 jibb-dev/lib/jibb/prelude.jibb+39 my-app/mar/label.hoon+6 tests/clay-fixtures/mark-bridge-expected.txt+1 tests/clay-fixtures/mark-bridge.txt+11 tests/clay-fixtures/mark-import-expected.txt+1 tests/clay-fixtures/mark-import.txt+9 tests/clay-fixtures/mark-shape-expected.txt+1 tests/clay-fixtures/mark-shape.txt+14 tests/golden/prelude-list-helpers/about.txt+1−1 tests/golden/prelude-unit-list-transforms/about.txt+4 tests/golden/prelude-unit-list-transforms/source.jibb+177 tests/golden/prelude-unit-list-transforms/tokens.txt+1084 tests/golden/prelude-unit-list-transforms/tree.txt+454 tests/golden/prelude-unit-list-transforms/types.txt+46 tests/golden/types-import-mark/about.txt+4 tests/golden/types-import-mark/imports.txt+1 tests/golden/types-import-mark/mar/label.txt+5 tests/golden/types-import-mark/marks.txt+1 tests/golden/types-import-mark/source.jibb+4 tests/golden/types-import-mark/sur/fixture.txt+3 tests/golden/types-import-mark/tokens.txt+22 tests/golden/types-import-mark/tree.txt+11 tests/golden/types-import-mark/types.txt+3 tests/golden/types-partial-atom-alias/about.txt+4 tests/golden/types-partial-atom-alias/source.jibb+10 tests/golden/types-partial-atom-alias/tokens.txt+67 tests/golden/types-partial-atom-alias/tree.txt+31 tests/golden/types-partial-atom-alias/types.txt+21 tests/golden/types-partial-branch-widening/about.txt+4 tests/golden/types-partial-branch-widening/source.jibb+20 tests/golden/types-partial-branch-widening/tokens.txt+96 tests/golden/types-partial-branch-widening/tree.txt+49 tests/golden/types-partial-branch-widening/types.txt+12 tests/golden/types-partial-union-cases/types.txt+21−3 tests/golden/types-partial-union-edges/types.txt+7−1 tests/importer/about.txt+6−2 tests/importer/ford.txt+2 tests/importer/mark-gate.txt+3 tests/importer/mark-list.txt+5 tests/importer/mark-recursive.txt+5 tests/importer/mark.txt+5 tests/importer/small.txt+3 tests/importer/tree.txt+11 tests/lib/jibb-import.hoon+9−1 tests/lib/jibb-mark-bridge.hoon+28 tests/lib/jibb.hoon+183−137 tests/type-mark/about.txt+6 tests/type-mark/collision.txt+3 tests/type-mark/declared.txt+2 tests/type-mark/expected.txt+15 tests/type-mark/missing.txt+1 tests/type-mark/sur.txt+2 tools/clay-fixtures+39 tools/golden+25−5 tools/golden_case.py+28 tools/importer-test+6−2 tools/ship+43−2 tools/testdata/selftest+13 tools/testdata/ship-selftest+20 tools/type-mark-test+35
docs/compiler.md+2−2
@@ -56,9 +56,9 @@ The core is split into chapters, `+| %name`, in this order:
5656| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
5757| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
5858
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. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, instantiate them independently, and print multiple constraints. Other cases, including aliasing a constrained generic and numeric defaulting, 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 report both sites and excerpts. Function compatibility involving nested `@`, and ambiguous joins between related auras, 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. 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. Numeric defaulting 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.
6060
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. Nested `$^`, other nested ordered maps, general source-level disjointness, marks 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; 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. 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 the corresponding ship test compose the importer with the inference fragment and compare a separate golden report. `tools/clay-fixtures` also passes a Clay-built `/sur` mold 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 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.
6262
6363And the design notes:
6464
docs/development.md+5−3
@@ -61,7 +61,8 @@ git clone https://github.com/urbit/tools /root/src/tools
6161| `tools/golden` | Runs the golden cases under `urbit eval`: every case, or those matching `--case`; `--update` rewrites the expected outputs; `--show` prints them |
6262| `tools/importer-test` | Compares the partial Hoon importer's diagnostic trees and errors with `tests/importer/tree.txt` under `urbit eval` |
6363| `tools/type-import-test` | Composes the Hoon importer with the partial checker and compares `tests/type-import/expected.txt` under eval |
64−| `tools/clay-fixtures` | Syncs `my-app`, builds its example `/sur` files and marks through Clay, checks selected imported mold projections and the partial checker, and records a Ford-import subject shape on the fake ship |
64+| `tools/type-mark-test` | Checks the partial checker’s mark import boundary against `tests/type-mark/expected.txt` under eval |
65+| `tools/clay-fixtures` | Syncs `my-app`, builds its example `/sur` files and marks through Clay, checks selected mold and mark projections and the partial checker, and records Ford and mark subject shapes on the fake ship |
6566| `tools/hoon` | Evaluates Hoon with the library in scope, as `tools/hoon '(golden /a/b/jibb (crip "++ main view"))'`; `--cord name=file` binds a file's text, `-f` reads the expression from a file |
6667| `tools/doc-blocks` | Checks the doc's `jibb` blocks against the `doc-*` golden cases: `tools/doc-blocks docs/spec` |
6768| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
@@ -76,6 +77,7 @@ git clone https://github.com/urbit/tools /root/src/tools
7677tools/golden # all cases pass
7778tools/importer-test # Hoon importer fixture projections match
7879tools/type-import-test # importer/checker bridge golden report matches
80+tools/type-mark-test # mark/checker bridge golden report matches
7981tools/hoon check-spans-test # prints <<>>
8082tools/testdata/selftest # 19 checks, 0 failed
8183tools/doc-blocks docs/spec # every jibb block has its case
@@ -86,7 +88,7 @@ tools/ship check-commit # when the mark or the desks changed
8688tools/clay-fixtures # when the my-app Hoon fixtures or importer changed
8789```
8890
89−`tools/ship test` regenerates `tests/lib/jibb.hoon` and syncs the `jibb-dev` desk before it runs, so commit the regenerated file. A run with `--stub`, `--lib`, or a custom `--golden` isolates its generated golden tests from the repository's other test programs; run the default command afterward to restore and test those programs. It also runs the independent `tests/lib/jibb-import.hoon` test against the same importer fixtures and expected diagnostic projection as `tools/importer-test`. The projection is an internal tree, not the Jibb type printer. `tests/lib/jibb-bridge.hoon` also runs the importer/checker bridge fixture on the ship; `tools/type-import-test` runs the same report under eval.
91+`tools/ship test` regenerates `tests/lib/jibb.hoon` and syncs the `jibb-dev` desk before it runs, so commit the regenerated file. A run with `--stub`, `--lib`, or a custom `--golden` isolates its generated golden tests from the repository's other test programs; run the default command afterward to restore and test those programs. It also runs the independent `tests/lib/jibb-import.hoon` test against the same importer fixtures and expected diagnostic projection as `tools/importer-test`. The projection is an internal tree, not the Jibb type printer. `tests/lib/jibb-bridge.hoon` also runs the importer/checker bridge fixture on the ship; `tools/type-import-test` runs the same report under eval. The mark bridge has its own `tests/lib/jibb-mark-bridge.hoon` ship test and `tools/type-mark-test` eval test; both compare the same fixture report.
9092
9193## Golden cases
9294
@@ -97,7 +99,7 @@ A case is a folder `tests/golden/<name>/` holding:
9799- the expected outputs, `tokens.txt` and `tree.txt`, each the output plus one newline.
98100- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
99101- 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.
100−- 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. The selected reader results go to the partial checker; a type output is required. This currently handles only sources without Ford imports, not marks or Jibb module fixtures.
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. These fixtures currently handle only sources without Ford imports, not Jibb module fixtures.
101103
102104Names say what a case is for:
103105
docs/status.md+8−6
@@ -19,7 +19,7 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
1919
2020## Milestone 2: in progress
2121
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; a partial bridge passes selected Hoon atoms and unfaced cells into inference, while the reader and bridge do not cover every supported Hoon type. It reads named recursion, nested collections, direct ordered maps, certain ordered-map fields, and direct `$^` unions whose cases can be proved disjoint. Nested `$^`, other nested ordered maps, marks and general union disjointness remain unfinished. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, and generalized atom constraints arising from explicit capitals or bare sample binders; other constraint cases and defaulting 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 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, and generalized atom constraints arising from explicit capitals or bare sample binders, including aliases; other constraint cases and defaulting 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.
2323
2424## Milestone 1: parser and mark
2525
@@ -37,8 +37,8 @@ What the plan asks for, and where it is:
3737
3838Besides the plan's list:
3939
40−- 406 golden cases: 190 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 406-case corpus passed under `urbit eval` in 21.4 s. The fake ship passed all 409 tests, including the importer, importer/checker bridge and unification checks, with 18.9 s for sync and 18.0 s for tests. The importer golden compares 57 projections; `tools/clay-fixtures` built all seven example Hoon fixtures through Clay, read selected molds, passed a Clay-built mold through the Clay-built importer and partial checker, and checked a real Ford-importing `/sur`.
40+- 410 golden cases: 194 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 410-case corpus passed under `urbit eval` in 20.5 s. The fake ship passed all 414 tests, including the importer, importer/checker and mark/checker bridges, and unification checks, with 17.9 s for sync and 15.5 s for tests. The importer golden compares 68 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.
4242- `tools/testdata/selftest` (19 checks) and `tools/testdata/ship-selftest` test the tools themselves.
4343- 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.
4444- 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).
@@ -59,22 +59,24 @@ Besides the plan's list:
5959| be6d2a5 | 2026-10-30 | Add atom widening, nested collections and case-local Hoon import fixtures |
6060| 26554ac | 2026-10-30 | Infer an atom constraint, extend the prelude and read example molds through Clay |
6161| fbeaa83 | 2026-10-30 | Extend atom constraints and nested ordered-map imports; connect Clay types to partial inference |
62−| This change | 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+| This change | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
6364
6465## Checking it
6566
6667On a machine set up as [development.md](development.md) says:
6768
6869```
69−tools/golden # 406 cases under urbit eval
70+tools/golden # 410 cases under urbit eval
7071tools/importer-test # the Hoon importer fixture projection
7172tools/type-import-test # the importer/checker bridge fixture
73+tools/type-mark-test # the mark/checker bridge fixture
7274tools/hoon check-spans-test # prints <<>> when the span checker works
7375tools/testdata/selftest # the tools themselves
7476tools/doc-blocks docs/spec # the doc's examples are golden cases
7577tools/ship start
7678tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
77−tools/ship test # the same 406 cases as -test arms on the ship
79+tools/ship test # the same 410 cases as -test arms on the ship
7880tools/testdata/ship-selftest
7981tools/ship check-commit # |commit stores .jibb files
8082tools/clay-fixtures # example /sur files and marks build through Clay
jibb-dev/lib/jibb-import.hoon+77−5
@@ -14,7 +14,7 @@
1414:: their imported shapes prove disjoint. Nested $^ and some valid but
1515:: unprovably disjoint cases remain unsupported. Source-level overlap in
1616:: other unions, general nested ordered maps, broader Ford subject
17−:: shapes, marks and full error locations still need work. A nested ordered map
17+:: shapes, recursive mark types and full error locations still need work. A nested ordered map
1818:: is recovered only when its key and value are fixed atom molds and
1919:: the other fields are fixed atoms or collections of static atoms;
2020:: other source shapes fail closed.
@@ -76,7 +76,43 @@
7676 ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
7777 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
7878 [%| 'Hoon module provenance does not match the selected mold']
79− (read-with module name typ [~ cor])
79+ =/ result (read-with module name typ [~ cor])
80+ ?. ?=([%& *] result) result
81+ ?: &(!=(q.q.cor -:!>(..zuse)) (contains-ref p.result))
82+ [%| 'a recursive Hoon mold with Ford imports needs source-aware import']
83+ result
84+::
85+:: A mark door's payload is [sample build-subject]. Its outer sample
86+:: face names the door sample, not the imported mark type. Collection
87+:: lookup for the sample happened against the pre-door build subject.
88+++ read-mark
89+ |= [name=term cor=type]
90+ ^- (each imported @t)
91+ ?. ?=([%core *] cor) [%| 'Hoon mark provenance is unavailable']
92+ ?. ?=([%cell *] p.cor) [%| 'Hoon mark sample is unavailable']
93+ ?. =(p.cor q.q.cor) [%| 'Hoon mark provenance is unavailable']
94+ ?. (scope-safe q.p.cor %$) [%| 'Hoon mark provenance is unavailable']
95+ =/ sample=type p.p.cor
96+ =/ raw=type ?:(?=([%face *] sample) q.sample sample)
97+ =/ result (read-with name name raw [~ q.p.cor])
98+ ?. ?=([%& *] result) result
99+ ?: (contains-ref p.result)
100+ [%| 'a recursive Hoon mark needs source-aware import']
101+ result
102+::
103+:: Until recursive holds retain their originating module, a Ford import
104+:: could otherwise label another module's recursive reference as local.
105+++ contains-ref
106+ |= out=imported
107+ ^- ?
108+ ?- out
109+ [%ref *] &
110+ [%cell *] |($(out head.out) $(out tail.out))
111+ [%face *] $(out body.out)
112+ [%fork *] (lien cases.out |=(item=imported (contains-ref item)))
113+ [%apply *] (lien args.out |=(item=imported (contains-ref item)))
114+ * |
115+ ==
80116::
81117++ read-with
82118 |= [module=term name=term typ=type context=(unit type)]
@@ -323,15 +359,35 @@
323359::
324360:: $^ is lowered to a conditional by Hoon's parser; conservatively
325361:: reject its distinctive test until the original branches have been
326−:: checked for disjointness. Other Hoon code can produce the same test,
327−:: so this partial reader may reject some supported molds too.
362+:: checked for disjointness. The tested axis follows the field path;
363+:: tracking that path distinguishes a nested $^ from an ordinary $@.
364+:: Other Hoon code can look the same, so some valid molds may be rejected.
328365++ has-cell-union
366+ |= h=hoon
367+ ^- ?
368+ ?. ?=([%tsls [%note * *] *] h) (has-cell-union-any h)
369+ (has-cell-union-at q.p.h 6)
370+::
371+++ has-cell-union-any
329372 |= h=*
330373 ^- ?
331374 ?@ h |
332375 ?: =(h [%dtwt [%$ 12]]) &
333376 |($(h -.h) $(h +.h))
334377::
378+++ has-cell-union-at
379+ |= [h=hoon axis=@ud]
380+ ^- ?
381+ ?^ -.h
382+ |($(h -.h, axis (mul 2 axis)) $(h +.h, axis (add 1 (mul 2 axis))))
383+ ?+ h (has-cell-union-any h)
384+ [%note *] $(h q.h)
385+ [%ktts *] $(h q.h)
386+ [%wtcl *]
387+ ?: =(p.h [%dtwt [%$ (mul 2 axis)]]) &
388+ |($(h q.h) $(h r.h))
389+ ==
390+::
335391++ cell-branches
336392 |= h=type
337393 ^- (unit [left=type right=type])
@@ -800,7 +856,7 @@
800856 ==
801857::
802858++ fixture-output
803− |= [small=@t epic=@t presence=@t docs=@t shadow=@t shadow-static=@t ford=@t]
859+ |= [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]
804860 ^- wain
805861 =/ sc=type -:(ride -:!>(..zuse) small)
806862 =/ ec=type -:(ride -:!>(..zuse) epic)
@@ -816,6 +872,11 @@
816872 =/ tc=type -:(ride tp only-list)
817873 =/ sp=type [%cell [%face %small xc] -:!>(..zuse)]
818874 =/ shc=type -:(ride sp only-list)
875+ =/ mark-core=type -:(ride fp mark)
876+ =/ mark-rec-core=type -:(ride fp mark-rec)
877+ =/ mark-gate-core=type -:(ride -:!>(..zuse) mark-gate)
878+ =/ mark-basic-core=type -:(ride -:!>(..zuse) mark-basic)
879+ =/ mark-shadow-core=type -:(ride sp mark-basic)
819880 =/ tshp=type [%cell [%face %intermediate shc] -:!>(..zuse)]
820881 =/ tshc=type -:(ride tshp only-list)
821882 =/ sample
@@ -855,8 +916,16 @@
855916 (crip "nested-static-mop: {(show-result (sample %nested-static-mop))}")
856917 (crip "collection-siblings: {(show-result (sample %collection-siblings))}")
857918 (crip "dynamic-sibling-mop: {(show-result (sample %dynamic-sibling-mop))}")
919+ (crip "mark-record: {(show-result (read-mark %todo-item mark-core))}")
920+ (crip "mark-recursive: {(show-result (read-mark %recursive mark-rec-core))}")
921+ (crip "mark-gate: {(show-result (read-mark %bad mark-gate-core))}")
922+ (crip "mark-list: {(show-result (read-mark %list-mark mark-basic-core))}")
923+ (crip "mark-shadow: {(show-result (read-mark %list-mark mark-shadow-core))}")
924+ (crip "mark-not-core: {(show-result (read-mark %bad [%atom %ud ~]))}")
858925 (crip "ford-list: {(show-result (read-mold-in %ford %lists (~(play ut fc) (ream '*lists')) fc))}")
859926 (crip "ford-imported: {(show-result (read-mold-in %ford %wrapped (~(play ut fc) (ream '*wrapped')) fc))}")
927+ (crip "ford-recursive: {(show-result (read-mold-in %ford %recursive (~(play ut fc) (ream '*recursive')) fc))}")
928+ (crip "ford-local-recursive: {(show-result (read-mold-in %ford %local (~(play ut fc) (ream '*local')) fc))}")
860929 (crip "ford-transitive: {(show-result (read-mold-in %ford %lists (~(play ut tc) (ream '*lists')) tc))}")
861930 (crip "ford-shadow: {(show-result (read-mold-in %ford %lists (~(play ut shc) (ream '*lists')) shc))}")
862931 (crip "ford-transitive-shadow: {(show-result (read-mold-in %ford %lists (~(play ut tshc) (ream '*lists')) tshc))}")
@@ -871,6 +940,9 @@
871940 (crip "gate: {(show-result (sample %gate-test))}")
872941 (crip "vase: {(show-result vase)}")
873942 (crip "failed-branch: {(show-result (read-mold %external %bad bad-branch-fixture))}")
943+ (crip "nested-atom-cell: {(show-result (sample %nested-atom-cell))}")
944+ (crip "nested-valid-cell: {(show-result (sample %nested-valid-cell))}")
945+ (crip "nested-invalid-cell: {(show-result (sample %nested-invalid-cell))}")
874946 (crip "valid-cell: {(show-result (sample %valid-cell))}")
875947 (crip "invalid-cell: {(show-result (sample %invalid-cell))}")
876948 (crip "chapter-malformed: {?:((chapter-unsafe [%x %y %z] %jar) "unsafe" "wrong")}")
jibb-dev/lib/jibb.hoon+101−14
@@ -4750,6 +4750,37 @@
47504750 |($(a sample.a, b sample.b) $(a product.a, b product.b))
47514751 |
47524752::
4753+:: A branch whose two result types are already concrete can use an
4754+:: explicitly present parent aura (or @) as its result. This does not
4755+:: guess a parent for sibling auras or solve variable-dependent joins.
4756+::
4757+++ itype-has-fixed-atom
4758+ |= typ=itype
4759+ ^- ?
4760+ ?- -.typ
4761+ %var |
4762+ %avar |
4763+ %nvar |
4764+ %atom &
4765+ %any-atom &
4766+ %flag &
4767+ %fn |($(typ sample.typ) $(typ product.typ))
4768+ %cell |($(typ hed.typ) $(typ tal.typ))
4769+ ==
4770+::
4771+++ itype-concrete-join
4772+ |= [a=itype b=itype sub=isub]
4773+ ^- (unit itype)
4774+ =. a (itype-walk a sub)
4775+ =. b (itype-walk b sub)
4776+ ?: &(?=(%atom -.a) ?=(%atom -.b))
4777+ ?: (aura-prefix aura.a aura.b) `a
4778+ ?: (aura-prefix aura.b aura.a) `b
4779+ ~
4780+ ?: &(?=(%any-atom -.a) |(?=(%atom -.b) ?=(%flag -.b))) `a
4781+ ?: &(?=(%any-atom -.b) |(?=(%atom -.a) ?=(%flag -.a))) `b
4782+ ~
4783+::
47534784++ itype-fit
47544785 |= [actual=itype expected=itype sub=isub next=@ud]
47554786 ^- ifit
@@ -4833,7 +4864,8 @@
48334864:: A caller supplies the exact noun returned by +read-mold:jibb-import.
48344865:: This core has no Ford dependencies; unrecognized payloads fail closed.
48354866+$ iexternals (list [module=term name=term result=*])
4836−+$ istate [next=@ud sub=isub caps=icaps binders=(list @ud) molds=imolds globals=(list term) externals=iexternals surs=(list term) active=(list term) in-mold=?]
4867++$ imark-externals (list [mark=term result=*])
4868++$ istate [next=@ud sub=isub caps=icaps binders=(list @ud) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) active=(list term) in-mold=?]
48374869+$ idiag [msg=tape sites=(list [at=span note=tape])]
48384870+$ iresult (each [typ=itype state=istate] idiag)
48394871+$ isample-result (each [typ=itype env=ienv state=istate] tape)
@@ -4944,7 +4976,11 @@
49444976 ?~ vars [(itype-rename typ.scheme ren) state]
49454977 =/ replacement=itype
49464978 ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state])
4947− $(vars t.vars, ren [[i.vars replacement] ren], state state(next +(next.state)))
4979+ :: A generalized atom variable is a valid origin for re-generalizing
4980+ :: an alias, just as a sample binder is.
4981+ =/ st=istate state(next +(next.state))
4982+ =? binders.st ?=(%avar -.replacement) [next.state binders.state]
4983+ $(vars t.vars, ren [[i.vars replacement] ren], state st)
49484984::
49494985++ icap-lookup
49504986 |= [n=@t caps=icaps]
@@ -5018,6 +5054,27 @@
50185054 [name.i.imports $(imports t.imports)]
50195055 $(imports t.imports)
50205056::
5057+++ collect-mark-imports
5058+ |= imports=(list import)
5059+ ^- (list term)
5060+ ?~ imports ~
5061+ ?: ?=(%mark -.i.imports)
5062+ [mark.i.imports $(imports t.imports)]
5063+ $(imports t.imports)
5064+::
5065+++ find-imported-mark
5066+ |= [name=term externals=imark-externals marks=(list term)]
5067+ ^- (unit itype)
5068+ ?. (unique-value-name name marks) ~
5069+ =/ found=imark-externals
5070+ (skim externals |=(e=[mark=term result=*] =(name mark.e)))
5071+ ?~ found ~
5072+ ?^ t.found ~
5073+ =/ result=* result.i.found
5074+ ?@ result ~
5075+ ?. ?=(%& -.result) ~
5076+ (import-to-itype +.result)
5077+::
50215078++ infer-simple-shape
50225079 |= [sh=shape state=istate]
50235080 ^- (unit [typ=itype state=istate])
@@ -5042,6 +5099,11 @@
50425099 (find-imported-mold i.t.names.sh n externals.state surs.state)
50435100 ?~ found ~
50445101 `[u.found state]
5102+ ?: (lien marks.state |=(x=term =(x n)))
5103+ ?^ (find-simple-mold n molds.state) ~
5104+ =/ imported=(unit itype) (find-imported-mark n mark-externals.state marks.state)
5105+ ?~ imported ~
5106+ `[u.imported state]
50455107 ?: (lien active.state |=(x=term =(x n))) ~
50465108 =/ found=(unit shape) (find-simple-mold n molds.state)
50475109 ?~ found ~
@@ -5147,11 +5209,17 @@
51475209 ?: ?=(%| -.left) left
51485210 =/ right=iresult $(e val.y, state state.p.left)
51495211 ?: ?=(%| -.right) right
5212+ =/ ltype=itype (itype-normalize typ.p.left sub.state.p.right)
5213+ =/ rtype=itype (itype-normalize typ.p.right sub.state.p.right)
5214+ ?: &(!=(ltype rtype) |(?=(^ (itype-vars ltype)) ?=(^ (itype-vars rtype))) |((itype-has-fixed-atom ltype) (itype-has-fixed-atom rtype)))
5215+ [%| ["branch widening is not supported by partial inference" ~]]
51505216 =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
51515217 ?~ joined
5218+ =/ common=(unit itype) (itype-concrete-join typ.p.left typ.p.right sub.state.p.right)
5219+ ?^ common [%& u.common state.p.right]
51525220 ?: |((itype-has-any-atom typ.p.left sub.state.p.right) (itype-has-any-atom typ.p.right sub.state.p.right) (itype-family-related typ.p.left typ.p.right sub.state.p.right))
51535221 [%| ["branch widening is not supported by partial inference" ~]]
5154− [%| ["branch arms have incompatible types" ~]]
5222+ [%| ["branch arms have incompatible types" ~[[(span-of val.x) (site-type-note "first arm" typ.p.left sub.state.p.right)] [(span-of val.y) (site-type-note "second arm" typ.p.right sub.state.p.right)]]]]
51555223 [%& typ.p.left state.p.right(sub u.joined)]
51565224 %cast
51575225 =/ target=(unit [typ=itype state=istate]) (infer-simple-shape shape.e state)
@@ -5303,8 +5371,8 @@
53035371 ?. |(?=(%var -.resolved) ?=(%avar -.resolved)) &
53045372 $(caps t.caps)
53055373::
5306−:: An atom variable may be generalized when an explicit capital or a
5307−:: sample binder resolves to it. Decimal-restricted variables still need
5374+:: An atom variable may be generalized when an explicit capital, sample
5375+:: binder or instantiated constraint resolves to it. Decimal variables need
53085376:: defaulting and must not be generalized as arbitrary atom types.
53095377::
53105378++ atom-var-from-cap
@@ -5336,6 +5404,11 @@
53365404 ^- ?
53375405 ?~ binders |
53385406 =/ resolved=itype (itype-normalize [%var i.binders] sub)
5407+ :: An instantiated atom variable is not itself a substitution, so
5408+ :: its origin still walks as an unbound variable of the same ID.
5409+ ?: ?=(%var -.resolved)
5410+ ?: =(n id.resolved) &
5411+ $(binders t.binders)
53395412 ?: (has-atom-var n resolved) &
53405413 $(binders t.binders)
53415414::
@@ -5346,6 +5419,7 @@
53465419 |-
53475420 ?~ vars |
53485421 ?: (itype-var-is-atom i.vars t)
5422+ ?. (has-atom-var i.vars t) &
53495423 ?. |((atom-var-from-cap i.vars caps sub) (atom-var-from-binder i.vars binders sub)) &
53505424 $(vars t.vars)
53515425 $(vars t.vars)
@@ -5387,14 +5461,14 @@
53875461 |
53885462::
53895463++ add-supported-defs
5390− |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term)]
5464+ |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term)]
53915465 ^- ienv
53925466 ?~ ds env
53935467 =/ d=def i.ds
53945468 ?: ?=(%mold -.d) $(ds t.ds)
53955469 ?. (unique-value-name name.d globals) $(ds t.ds)
53965470 ?^ (ienv-lookup name.d env) $(ds t.ds)
5397− =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs ~ |])
5471+ =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs mark-externals marks ~ |])
53985472 ?: ?=(%| -.result) $(ds t.ds)
53995473 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
54005474 =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
@@ -5404,11 +5478,11 @@
54045478 $(ds t.ds, env [[name.d [typ vars]] env])
54055479::
54065480++ resolve-supported-defs
5407− |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term)]
5481+ |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term)]
54085482 ^- ienv
54095483 =/ env=ienv ~
54105484 |-
5411− =/ next=ienv (add-supported-defs ds env molds globals externals surs)
5485+ =/ next=ienv (add-supported-defs ds env molds globals externals surs mark-externals marks)
54125486 ?: =(next env) env
54135487 $(env next)
54145488::
@@ -5548,7 +5622,7 @@
55485622 (weld pairs $(cases t.cases))
55495623::
55505624++ show-partial-mold
5551− |= [d=def molds=imolds]
5625+ |= [file=path src=@t d=def molds=imolds]
55525626 ^- @t
55535627 ?> ?=(%mold -.d)
55545628 =/ sh=shape shape.d
@@ -5558,7 +5632,10 @@
55585632 =/ overlapping=(list upair) (skim pairs |=(p=upair =(%overlap relation.p)))
55595633 ?^ overlapping
55605634 =/ p=upair i.overlapping
5561− (crip "+$ {(trip name.d)}: overlapping cases at {(show-loc beg.first.p)} and {(show-loc beg.second.p)}; mold not checked")
5635+ =/ summary=@t (crip "+$ {(trip name.d)}: overlapping cases; mold not checked")
5636+ =/ first=@t (show-error src [file line.beg.first.p col.beg.first.p "first union case"])
5637+ =/ second=@t (show-error src [file line.beg.second.p col.beg.second.p "overlapping case"])
5638+ (of-wain:format ~[summary first second])
55625639 ?: (lien pairs |=(p=upair =(%unknown relation.p)))
55635640 (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
55645641 (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
@@ -5591,22 +5668,32 @@
55915668++ golden-types-imports
55925669 |= [file=path src=@t externals=iexternals]
55935670 ^- @t
5671+ (golden-types-with-marks file src externals ~)
5672+::
5673+:: +golden-types-with-marks: supply declared mark types separately from /sur
5674+:: entries, as [mark result] with the result from +read-mark:jibb-import.
5675+:: Unknown, duplicated, failed and undeclared entries never resolve a mold.
5676+::
5677+++ golden-types-with-marks
5678+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals]
5679+ ^- @t
55945680 =/ parsed (parse file src)
55955681 ?: ?=(%| -.parsed) (show-error src p.parsed)
55965682 =/ ds=(list def) defs.p.parsed
55975683 =/ molds=imolds (collect-simple-molds ds)
55985684 =/ globals=(list term) (global-value-names ds)
55995685 =/ surs=(list term) (collect-sur-imports imports.p.parsed)
5600− =/ env=ienv (resolve-supported-defs ds molds globals externals surs)
5686+ =/ marks=(list term) (collect-mark-imports imports.p.parsed)
5687+ =/ env=ienv (resolve-supported-defs ds molds globals externals surs mark-externals marks)
56015688 =/ lines=(list @t) ~
56025689 |-
56035690 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
56045691 =/ d=def i.ds
56055692 ?: ?=(%mold -.d)
5606− $(ds t.ds, lines [(show-partial-mold d molds) lines])
5693+ $(ds t.ds, lines [(show-partial-mold file src d molds) lines])
56075694 ?. (unique-value-name name.d globals)
56085695 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
5609− =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs ~ |])
5696+ =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs mark-externals marks ~ |])
56105697 ?: ?=(%| -.result)
56115698 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
56125699 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
jibb-dev/lib/jibb/prelude.jibb+39
@@ -136,3 +136,42 @@
136136 ~ acc
137137 [item more] (reverse-into more [item acc])
138138 (reverse-into xs ~)
139+
140+++ drop |= maybe=(unit A)
141+ ?- maybe
142+ ~ ~
143+ [~ value] [value ~]
144+
145+++ bind |= args=[(unit A) $-(A B)]
146+ ?- args
147+ [maybe f]
148+ ?- maybe
149+ ~ ~
150+ [~ value] `(f value)
151+
152+++ biff |= args=[(unit A) $-(A (unit B))]
153+ ?- args
154+ [maybe f]
155+ ?- maybe
156+ ~ ~
157+ [~ value] (f value)
158+
159+++ skim |= args=[(list A) $-(A ?)]
160+ ?- args
161+ [xs predicate]
162+ ?- xs
163+ ~ ~
164+ [item rest]
165+ ?- (predicate item)
166+ %.y [item (skim rest predicate)]
167+ %.n (skim rest predicate)
168+
169+++ skip |= args=[(list A) $-(A ?)]
170+ ?- args
171+ [xs predicate]
172+ ?- xs
173+ ~ ~
174+ [item rest]
175+ ?- (predicate item)
176+ %.y (skip rest predicate)
177+ %.n [item (skip rest predicate)]
my-app/mar/label.hoonnew file+6
@@ -0,0 +1,6 @@
1+:: Fixture for the Hoon mark importer; not supplied by the design doc.
2+|_ a=@t
3+++ grab |% ++ noun @t --
4+++ grow |% ++ noun a --
5+++ grad %noun
6+--
tests/clay-fixtures/mark-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ identity: $-(@t @t)'
tests/clay-fixtures/mark-bridge.txtnew file+11
@@ -0,0 +1,11 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/label/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ read-gate=vase (slap reader (ream 'read-mark'))
8+=/ label-result=vase (slym read-gate [%label -.mark])
9+=/ check-gate=vase (slap jibb (ream 'golden-types-with-marks'))
10+=/ src=@t '/% %label\0a++ identity |= x=label x\0a'
11+(pure:m (slym check-gate [/ui/test/jibb src ~ ~[[%label +.label-result]]]))
tests/clay-fixtures/mark-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [add text=@t] [toggle id=@ud])"
tests/clay-fixtures/mark-import.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/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-mark'))
7+=/ got=vase (slym read-gate [%todo-action -.mark])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/mark-shape-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y %.y]
tests/clay-fixtures/mark-shape.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/hoon)
5+=/ cor=type -.mark
6+?. ?=([%core *] cor) (pure:m !>('not a core'))
7+=/ payload=type p.cor
8+?. ?=([%cell *] payload) (pure:m !>('payload is not a cell'))
9+=/ tail=type q.payload
10+=/ face=? ?=([%face %a *] p.payload)
11+=/ same=? =(payload q.q.cor)
12+=/ imported=? ?=([%cell [%face %todo [%core *]] *] tail)
13+=/ zuse=? ?:(?=([%cell *] tail) =(q.tail -:!>(..zuse)) |)
14+(pure:m !>([face same imported zuse]))
tests/golden/prelude-list-helpers/about.txt+1−1
@@ -1,4 +1,4 @@
11source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; Hoon 2a and 2b include `some`, `lure`, `snoc` and `flop`.
2−tests: The prelude's unit constructor, singleton list, append-one gate and tail-recursive list reversal; the local reversal helper shares the enclosing type variable. The source is the complete current prelude.
2+tests: The prelude through its unit constructor, singleton list, append-one gate and tail-recursive list reversal; the local reversal helper shares the enclosing type variable.
33expect: parses
44expect-types: a partial inference report, not a checked module; unit, list and recursive helper typing is not complete
tests/golden/prelude-unit-list-transforms/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; Hoon 2a includes `drop`, `bind` and `biff`, and 2b includes `skim` and `skip`.
2+tests: The complete current prelude parses, including unit-to-list conversion, unit mapping and flat mapping, and the complementary list filters. Both filters retain the order of their selected items.
3+expect: parses
4+expect-types: a partial inference report, not a checked module; unit and list gate typing is not complete
tests/golden/prelude-unit-list-transforms/source.jibbnew file+177
@@ -0,0 +1,177 @@
1+:: Initial prelude functions. The rest of the inventory is still to come.
2+++ same |= x=A x
3+
4+++ head |= p=[A B]
5+ ?- p
6+ [a b] a
7+
8+++ tail |= p=[A B]
9+ ?- p
10+ [a b] b
11+
12+++ not |= b=?
13+ ?- b
14+ %.y %.n
15+ %.n %.y
16+
17++$ list |$ [A]
18+ ~
19+ [i=A t=(list A)]
20+
21++$ unit |$ [A]
22+ ~
23+ [~ u=A]
24+
25+++ fall |= args=[(unit A) A]
26+ ?- args
27+ [maybe fallback]
28+ ?- maybe
29+ ~ fallback
30+ [~ value] value
31+
32+++ need |= maybe=(unit A)
33+ ?- maybe
34+ ~ !!
35+ [~ value] value
36+
37+++ weld |= args=[(list A) (list A)]
38+ ?- args
39+ [xs ys]
40+ ?- xs
41+ ~ ys
42+ [item rest] [item (weld rest ys)]
43+
44+++ turn |= args=[(list A) $-(A B)]
45+ ?- args
46+ [xs f]
47+ ?- xs
48+ ~ ~
49+ [item rest] [(f item) (turn rest f)]
50+
51++$ dime [p=@ta q=@]
52+
53++$ hair [p=@ud q=@ud]
54+
55++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
56+
57++$ coin
58+ [%$ p=dime]
59+ [%blob p=*]
60+ [%many p=(list coin)]
61+
62++$ pair |$ [A B] [p=A q=B]
63+
64++$ trel |$ [A B C] [p=A q=B r=C]
65+
66++$ qual |$ [A B C D] [p=A q=B r=C s=D]
67+
68++$ cord @t
69+
70++$ knot @ta
71+
72++$ tape (list @tD)
73+
74++$ path (list knot)
75+
76++$ tank
77+ cord
78+ [%leaf p=tape]
79+ [%palm p=(qual tape tape tape tape) q=(list tank)]
80+ [%rose p=(trel tape tape tape) q=(list tank)]
81+
82++$ nail [p=hair q=tape]
83+
84++$ edge [p=hair q=(unit [p=* q=nail])]
85+
86++$ rule $-(nail edge)
87+
88++$ spot [p=path q=pint]
89+
90++$ toon
91+ [%0 p=*]
92+ [%1 p=*]
93+ [%2 p=(list tank)]
94+
95++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
96+
97+++ wonk |= veq=(like A)
98+ ?- q.veq
99+ ~ !!
100+ [~ product] p.product
101+
102++$ lone |$ [A] [p=A]
103+
104++$ lest |$ [A] [i=A t=(list A)]
105+
106++$ pole |$ [A]
107+ ~
108+ [A (pole A)]
109+
110++$ quip |$ [A B] [(list A) B]
111+
112++$ tree |$ [A]
113+ ~
114+ [n=A l=(tree A) r=(tree A)]
115+
116++$ each |$ [A B]
117+ [%| p=B]
118+ [%& p=A]
119+
120++$ bloq @
121+
122+++ some |= item=A `item
123+
124+++ lure |= item=A
125+ ^- (list A) [item ~]
126+
127+++ snoc |= args=[(list A) A]
128+ ?- args
129+ [xs item] (weld xs [item ~])
130+
131+++ flop |= xs=(list A)
132+ ++ reverse-into |= args=[(list A) (list A)]
133+ ?- args
134+ [rest acc]
135+ ?- rest
136+ ~ acc
137+ [item more] (reverse-into more [item acc])
138+ (reverse-into xs ~)
139+
140+++ drop |= maybe=(unit A)
141+ ?- maybe
142+ ~ ~
143+ [~ value] [value ~]
144+
145+++ bind |= args=[(unit A) $-(A B)]
146+ ?- args
147+ [maybe f]
148+ ?- maybe
149+ ~ ~
150+ [~ value] `(f value)
151+
152+++ biff |= args=[(unit A) $-(A (unit B))]
153+ ?- args
154+ [maybe f]
155+ ?- maybe
156+ ~ ~
157+ [~ value] (f value)
158+
159+++ skim |= args=[(list A) $-(A ?)]
160+ ?- args
161+ [xs predicate]
162+ ?- xs
163+ ~ ~
164+ [item rest]
165+ ?- (predicate item)
166+ %.y [item (skim rest predicate)]
167+ %.n (skim rest predicate)
168+
169+++ skip |= args=[(list A) $-(A ?)]
170+ ?- args
171+ [xs predicate]
172+ ?- xs
173+ ~ ~
174+ [item rest]
175+ ?- (predicate item)
176+ %.y (skip rest predicate)
177+ %.n [item (skip rest predicate)]
tests/golden/prelude-unit-list-transforms/tokens.txtnew file+1084
@@ -0,0 +1,1084 @@
1+2:1 glyph ++
2+2:4 name same
3+2:9 glyph |=
4+2:12 name x
5+2:13 tight glyph =
6+2:14 tight tvar A
7+2:16 name x
8+4:1 NEWLINE
9+4:1 glyph ++
10+4:4 name head
11+4:9 glyph |=
12+4:12 name p
13+4:13 tight glyph =
14+4:14 tight glyph [
15+4:15 tight tvar A
16+4:17 tvar B
17+4:18 tight glyph ]
18+5:3 INDENT
19+5:3 glyph ?-
20+5:6 name p
21+6:5 INDENT
22+6:5 glyph [
23+6:6 tight name a
24+6:8 name b
25+6:9 tight glyph ]
26+6:11 name a
27+8:1 DEDENT
28+8:1 DEDENT
29+8:1 NEWLINE
30+8:1 glyph ++
31+8:4 name tail
32+8:9 glyph |=
33+8:12 name p
34+8:13 tight glyph =
35+8:14 tight glyph [
36+8:15 tight tvar A
37+8:17 tvar B
38+8:18 tight glyph ]
39+9:3 INDENT
40+9:3 glyph ?-
41+9:6 name p
42+10:5 INDENT
43+10:5 glyph [
44+10:6 tight name a
45+10:8 name b
46+10:9 tight glyph ]
47+10:11 name b
48+12:1 DEDENT
49+12:1 DEDENT
50+12:1 NEWLINE
51+12:1 glyph ++
52+12:4 name not
53+12:8 glyph |=
54+12:11 name b
55+12:12 tight glyph =
56+12:13 tight glyph ?
57+13:3 INDENT
58+13:3 glyph ?-
59+13:6 name b
60+14:5 INDENT
61+14:5 lit %.y
62+14:9 lit %.n
63+15:5 NEWLINE
64+15:5 lit %.n
65+15:9 lit %.y
66+17:1 DEDENT
67+17:1 DEDENT
68+17:1 NEWLINE
69+17:1 glyph +$
70+17:4 name list
71+17:9 glyph |$
72+17:12 glyph [
73+17:13 tight tvar A
74+17:14 tight glyph ]
75+18:3 INDENT
76+18:3 lit ~
77+19:3 NEWLINE
78+19:3 glyph [
79+19:4 tight name i
80+19:5 tight glyph =
81+19:6 tight tvar A
82+19:8 name t
83+19:9 tight glyph =
84+19:10 tight glyph (
85+19:11 tight name list
86+19:16 tvar A
87+19:17 tight glyph )
88+19:18 tight glyph ]
89+21:1 DEDENT
90+21:1 NEWLINE
91+21:1 glyph +$
92+21:4 name unit
93+21:9 glyph |$
94+21:12 glyph [
95+21:13 tight tvar A
96+21:14 tight glyph ]
97+22:3 INDENT
98+22:3 lit ~
99+23:3 NEWLINE
100+23:3 glyph [
101+23:4 tight lit ~
102+23:6 name u
103+23:7 tight glyph =
104+23:8 tight tvar A
105+23:9 tight glyph ]
106+25:1 DEDENT
107+25:1 NEWLINE
108+25:1 glyph ++
109+25:4 name fall
110+25:9 glyph |=
111+25:12 name args
112+25:16 tight glyph =
113+25:17 tight glyph [
114+25:18 tight glyph (
115+25:19 tight name unit
116+25:24 tvar A
117+25:25 tight glyph )
118+25:27 tvar A
119+25:28 tight glyph ]
120+26:3 INDENT
121+26:3 glyph ?-
122+26:6 name args
123+27:5 INDENT
124+27:5 glyph [
125+27:6 tight name maybe
126+27:12 name fallback
127+27:20 tight glyph ]
128+28:7 INDENT
129+28:7 glyph ?-
130+28:10 name maybe
131+29:9 INDENT
132+29:9 lit ~
133+29:11 name fallback
134+30:9 NEWLINE
135+30:9 glyph [
136+30:10 tight lit ~
137+30:12 name value
138+30:17 tight glyph ]
139+30:19 name value
140+32:1 DEDENT
141+32:1 DEDENT
142+32:1 DEDENT
143+32:1 DEDENT
144+32:1 NEWLINE
145+32:1 glyph ++
146+32:4 name need
147+32:9 glyph |=
148+32:12 name maybe
149+32:17 tight glyph =
150+32:18 tight glyph (
151+32:19 tight name unit
152+32:24 tvar A
153+32:25 tight glyph )
154+33:3 INDENT
155+33:3 glyph ?-
156+33:6 name maybe
157+34:5 INDENT
158+34:5 lit ~
159+34:7 glyph !!
160+35:5 NEWLINE
161+35:5 glyph [
162+35:6 tight lit ~
163+35:8 name value
164+35:13 tight glyph ]
165+35:15 name value
166+37:1 DEDENT
167+37:1 DEDENT
168+37:1 NEWLINE
169+37:1 glyph ++
170+37:4 name weld
171+37:9 glyph |=
172+37:12 name args
173+37:16 tight glyph =
174+37:17 tight glyph [
175+37:18 tight glyph (
176+37:19 tight name list
177+37:24 tvar A
178+37:25 tight glyph )
179+37:27 glyph (
180+37:28 tight name list
181+37:33 tvar A
182+37:34 tight glyph )
183+37:35 tight glyph ]
184+38:3 INDENT
185+38:3 glyph ?-
186+38:6 name args
187+39:5 INDENT
188+39:5 glyph [
189+39:6 tight name xs
190+39:9 name ys
191+39:11 tight glyph ]
192+40:7 INDENT
193+40:7 glyph ?-
194+40:10 name xs
195+41:9 INDENT
196+41:9 lit ~
197+41:11 name ys
198+42:9 NEWLINE
199+42:9 glyph [
200+42:10 tight name item
201+42:15 name rest
202+42:19 tight glyph ]
203+42:21 glyph [
204+42:22 tight name item
205+42:27 glyph (
206+42:28 tight name weld
207+42:33 name rest
208+42:38 name ys
209+42:40 tight glyph )
210+42:41 tight glyph ]
211+44:1 DEDENT
212+44:1 DEDENT
213+44:1 DEDENT
214+44:1 DEDENT
215+44:1 NEWLINE
216+44:1 glyph ++
217+44:4 name turn
218+44:9 glyph |=
219+44:12 name args
220+44:16 tight glyph =
221+44:17 tight glyph [
222+44:18 tight glyph (
223+44:19 tight name list
224+44:24 tvar A
225+44:25 tight glyph )
226+44:27 glyph $-(
227+44:30 tight tvar A
228+44:32 tvar B
229+44:33 tight glyph )
230+44:34 tight glyph ]
231+45:3 INDENT
232+45:3 glyph ?-
233+45:6 name args
234+46:5 INDENT
235+46:5 glyph [
236+46:6 tight name xs
237+46:9 name f
238+46:10 tight glyph ]
239+47:7 INDENT
240+47:7 glyph ?-
241+47:10 name xs
242+48:9 INDENT
243+48:9 lit ~
244+48:11 lit ~
245+49:9 NEWLINE
246+49:9 glyph [
247+49:10 tight name item
248+49:15 name rest
249+49:19 tight glyph ]
250+49:21 glyph [
251+49:22 tight glyph (
252+49:23 tight name f
253+49:25 name item
254+49:29 tight glyph )
255+49:31 glyph (
256+49:32 tight name turn
257+49:37 name rest
258+49:42 name f
259+49:43 tight glyph )
260+49:44 tight glyph ]
261+51:1 DEDENT
262+51:1 DEDENT
263+51:1 DEDENT
264+51:1 DEDENT
265+51:1 NEWLINE
266+51:1 glyph +$
267+51:4 name dime
268+51:9 glyph [
269+51:10 tight name p
270+51:11 tight glyph =
271+51:12 tight aura @ta
272+51:16 name q
273+51:17 tight glyph =
274+51:18 tight aura @
275+51:19 tight glyph ]
276+53:1 NEWLINE
277+53:1 glyph +$
278+53:4 name hair
279+53:9 glyph [
280+53:10 tight name p
281+53:11 tight glyph =
282+53:12 tight aura @ud
283+53:16 name q
284+53:17 tight glyph =
285+53:18 tight aura @ud
286+53:21 tight glyph ]
287+55:1 NEWLINE
288+55:1 glyph +$
289+55:4 name pint
290+55:9 glyph [
291+55:10 tight name p
292+55:11 tight glyph =
293+55:12 tight glyph [
294+55:13 tight name p
295+55:14 tight glyph =
296+55:15 tight aura @
297+55:17 name q
298+55:18 tight glyph =
299+55:19 tight aura @
300+55:20 tight glyph ]
301+55:22 name q
302+55:23 tight glyph =
303+55:24 tight glyph [
304+55:25 tight name p
305+55:26 tight glyph =
306+55:27 tight aura @
307+55:29 name q
308+55:30 tight glyph =
309+55:31 tight aura @
310+55:32 tight glyph ]
311+55:33 tight glyph ]
312+57:1 NEWLINE
313+57:1 glyph +$
314+57:4 name coin
315+58:3 INDENT
316+58:3 glyph [
317+58:4 tight lit %$
318+58:7 name p
319+58:8 tight glyph =
320+58:9 tight name dime
321+58:13 tight glyph ]
322+59:3 NEWLINE
323+59:3 glyph [
324+59:4 tight lit %blob
325+59:10 name p
326+59:11 tight glyph =
327+59:12 tight glyph *
328+59:13 tight glyph ]
329+60:3 NEWLINE
330+60:3 glyph [
331+60:4 tight lit %many
332+60:10 name p
333+60:11 tight glyph =
334+60:12 tight glyph (
335+60:13 tight name list
336+60:18 name coin
337+60:22 tight glyph )
338+60:23 tight glyph ]
339+62:1 DEDENT
340+62:1 NEWLINE
341+62:1 glyph +$
342+62:4 name pair
343+62:9 glyph |$
344+62:12 glyph [
345+62:13 tight tvar A
346+62:15 tvar B
347+62:16 tight glyph ]
348+62:18 glyph [
349+62:19 tight name p
350+62:20 tight glyph =
351+62:21 tight tvar A
352+62:23 name q
353+62:24 tight glyph =
354+62:25 tight tvar B
355+62:26 tight glyph ]
356+64:1 NEWLINE
357+64:1 glyph +$
358+64:4 name trel
359+64:9 glyph |$
360+64:12 glyph [
361+64:13 tight tvar A
362+64:15 tvar B
363+64:17 tvar C
364+64:18 tight glyph ]
365+64:20 glyph [
366+64:21 tight name p
367+64:22 tight glyph =
368+64:23 tight tvar A
369+64:25 name q
370+64:26 tight glyph =
371+64:27 tight tvar B
372+64:29 name r
373+64:30 tight glyph =
374+64:31 tight tvar C
375+64:32 tight glyph ]
376+66:1 NEWLINE
377+66:1 glyph +$
378+66:4 name qual
379+66:9 glyph |$
380+66:12 glyph [
381+66:13 tight tvar A
382+66:15 tvar B
383+66:17 tvar C
384+66:19 tvar D
385+66:20 tight glyph ]
386+66:22 glyph [
387+66:23 tight name p
388+66:24 tight glyph =
389+66:25 tight tvar A
390+66:27 name q
391+66:28 tight glyph =
392+66:29 tight tvar B
393+66:31 name r
394+66:32 tight glyph =
395+66:33 tight tvar C
396+66:35 name s
397+66:36 tight glyph =
398+66:37 tight tvar D
399+66:38 tight glyph ]
400+68:1 NEWLINE
401+68:1 glyph +$
402+68:4 name cord
403+68:9 aura @t
404+70:1 NEWLINE
405+70:1 glyph +$
406+70:4 name knot
407+70:9 aura @ta
408+72:1 NEWLINE
409+72:1 glyph +$
410+72:4 name tape
411+72:9 glyph (
412+72:10 tight name list
413+72:15 aura @tD
414+72:18 tight glyph )
415+74:1 NEWLINE
416+74:1 glyph +$
417+74:4 name path
418+74:9 glyph (
419+74:10 tight name list
420+74:15 name knot
421+74:19 tight glyph )
422+76:1 NEWLINE
423+76:1 glyph +$
424+76:4 name tank
425+77:3 INDENT
426+77:3 name cord
427+78:3 NEWLINE
428+78:3 glyph [
429+78:4 tight lit %leaf
430+78:10 name p
431+78:11 tight glyph =
432+78:12 tight name tape
433+78:16 tight glyph ]
434+79:3 NEWLINE
435+79:3 glyph [
436+79:4 tight lit %palm
437+79:10 name p
438+79:11 tight glyph =
439+79:12 tight glyph (
440+79:13 tight name qual
441+79:18 name tape
442+79:23 name tape
443+79:28 name tape
444+79:33 name tape
445+79:37 tight glyph )
446+79:39 name q
447+79:40 tight glyph =
448+79:41 tight glyph (
449+79:42 tight name list
450+79:47 name tank
451+79:51 tight glyph )
452+79:52 tight glyph ]
453+80:3 NEWLINE
454+80:3 glyph [
455+80:4 tight lit %rose
456+80:10 name p
457+80:11 tight glyph =
458+80:12 tight glyph (
459+80:13 tight name trel
460+80:18 name tape
461+80:23 name tape
462+80:28 name tape
463+80:32 tight glyph )
464+80:34 name q
465+80:35 tight glyph =
466+80:36 tight glyph (
467+80:37 tight name list
468+80:42 name tank
469+80:46 tight glyph )
470+80:47 tight glyph ]
471+82:1 DEDENT
472+82:1 NEWLINE
473+82:1 glyph +$
474+82:4 name nail
475+82:9 glyph [
476+82:10 tight name p
477+82:11 tight glyph =
478+82:12 tight name hair
479+82:17 name q
480+82:18 tight glyph =
481+82:19 tight name tape
482+82:23 tight glyph ]
483+84:1 NEWLINE
484+84:1 glyph +$
485+84:4 name edge
486+84:9 glyph [
487+84:10 tight name p
488+84:11 tight glyph =
489+84:12 tight name hair
490+84:17 name q
491+84:18 tight glyph =
492+84:19 tight glyph (
493+84:20 tight name unit
494+84:25 glyph [
495+84:26 tight name p
496+84:27 tight glyph =
497+84:28 tight glyph *
498+84:30 name q
499+84:31 tight glyph =
500+84:32 tight name nail
501+84:36 tight glyph ]
502+84:37 tight glyph )
503+84:38 tight glyph ]
504+86:1 NEWLINE
505+86:1 glyph +$
506+86:4 name rule
507+86:9 glyph $-(
508+86:12 tight name nail
509+86:17 name edge
510+86:21 tight glyph )
511+88:1 NEWLINE
512+88:1 glyph +$
513+88:4 name spot
514+88:9 glyph [
515+88:10 tight name p
516+88:11 tight glyph =
517+88:12 tight name path
518+88:17 name q
519+88:18 tight glyph =
520+88:19 tight name pint
521+88:23 tight glyph ]
522+90:1 NEWLINE
523+90:1 glyph +$
524+90:4 name toon
525+91:3 INDENT
526+91:3 glyph [
527+91:4 tight lit %0
528+91:7 name p
529+91:8 tight glyph =
530+91:9 tight glyph *
531+91:10 tight glyph ]
532+92:3 NEWLINE
533+92:3 glyph [
534+92:4 tight lit %1
535+92:7 name p
536+92:8 tight glyph =
537+92:9 tight glyph *
538+92:10 tight glyph ]
539+93:3 NEWLINE
540+93:3 glyph [
541+93:4 tight lit %2
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph (
545+93:10 tight name list
546+93:15 name tank
547+93:19 tight glyph )
548+93:20 tight glyph ]
549+95:1 DEDENT
550+95:1 NEWLINE
551+95:1 glyph +$
552+95:4 name like
553+95:9 glyph |$
554+95:12 glyph [
555+95:13 tight tvar A
556+95:14 tight glyph ]
557+95:16 glyph [
558+95:17 tight name p
559+95:18 tight glyph =
560+95:19 tight name hair
561+95:24 name q
562+95:25 tight glyph =
563+95:26 tight glyph (
564+95:27 tight name unit
565+95:32 glyph [
566+95:33 tight name p
567+95:34 tight glyph =
568+95:35 tight tvar A
569+95:37 name q
570+95:38 tight glyph =
571+95:39 tight name nail
572+95:43 tight glyph ]
573+95:44 tight glyph )
574+95:45 tight glyph ]
575+97:1 NEWLINE
576+97:1 glyph ++
577+97:4 name wonk
578+97:9 glyph |=
579+97:12 name veq
580+97:15 tight glyph =
581+97:16 tight glyph (
582+97:17 tight name like
583+97:22 tvar A
584+97:23 tight glyph )
585+98:3 INDENT
586+98:3 glyph ?-
587+98:6 wing q.veq
588+99:5 INDENT
589+99:5 lit ~
590+99:7 glyph !!
591+100:5 NEWLINE
592+100:5 glyph [
593+100:6 tight lit ~
594+100:8 name product
595+100:15 tight glyph ]
596+100:17 wing p.product
597+102:1 DEDENT
598+102:1 DEDENT
599+102:1 NEWLINE
600+102:1 glyph +$
601+102:4 name lone
602+102:9 glyph |$
603+102:12 glyph [
604+102:13 tight tvar A
605+102:14 tight glyph ]
606+102:16 glyph [
607+102:17 tight name p
608+102:18 tight glyph =
609+102:19 tight tvar A
610+102:20 tight glyph ]
611+104:1 NEWLINE
612+104:1 glyph +$
613+104:4 name lest
614+104:9 glyph |$
615+104:12 glyph [
616+104:13 tight tvar A
617+104:14 tight glyph ]
618+104:16 glyph [
619+104:17 tight name i
620+104:18 tight glyph =
621+104:19 tight tvar A
622+104:21 name t
623+104:22 tight glyph =
624+104:23 tight glyph (
625+104:24 tight name list
626+104:29 tvar A
627+104:30 tight glyph )
628+104:31 tight glyph ]
629+106:1 NEWLINE
630+106:1 glyph +$
631+106:4 name pole
632+106:9 glyph |$
633+106:12 glyph [
634+106:13 tight tvar A
635+106:14 tight glyph ]
636+107:3 INDENT
637+107:3 lit ~
638+108:3 NEWLINE
639+108:3 glyph [
640+108:4 tight tvar A
641+108:6 glyph (
642+108:7 tight name pole
643+108:12 tvar A
644+108:13 tight glyph )
645+108:14 tight glyph ]
646+110:1 DEDENT
647+110:1 NEWLINE
648+110:1 glyph +$
649+110:4 name quip
650+110:9 glyph |$
651+110:12 glyph [
652+110:13 tight tvar A
653+110:15 tvar B
654+110:16 tight glyph ]
655+110:18 glyph [
656+110:19 tight glyph (
657+110:20 tight name list
658+110:25 tvar A
659+110:26 tight glyph )
660+110:28 tvar B
661+110:29 tight glyph ]
662+112:1 NEWLINE
663+112:1 glyph +$
664+112:4 name tree
665+112:9 glyph |$
666+112:12 glyph [
667+112:13 tight tvar A
668+112:14 tight glyph ]
669+113:3 INDENT
670+113:3 lit ~
671+114:3 NEWLINE
672+114:3 glyph [
673+114:4 tight name n
674+114:5 tight glyph =
675+114:6 tight tvar A
676+114:8 name l
677+114:9 tight glyph =
678+114:10 tight glyph (
679+114:11 tight name tree
680+114:16 tvar A
681+114:17 tight glyph )
682+114:19 name r
683+114:20 tight glyph =
684+114:21 tight glyph (
685+114:22 tight name tree
686+114:27 tvar A
687+114:28 tight glyph )
688+114:29 tight glyph ]
689+116:1 DEDENT
690+116:1 NEWLINE
691+116:1 glyph +$
692+116:4 name each
693+116:9 glyph |$
694+116:12 glyph [
695+116:13 tight tvar A
696+116:15 tvar B
697+116:16 tight glyph ]
698+117:3 INDENT
699+117:3 glyph [
700+117:4 tight lit %|
701+117:7 name p
702+117:8 tight glyph =
703+117:9 tight tvar B
704+117:10 tight glyph ]
705+118:3 NEWLINE
706+118:3 glyph [
707+118:4 tight lit %&
708+118:7 name p
709+118:8 tight glyph =
710+118:9 tight tvar A
711+118:10 tight glyph ]
712+120:1 DEDENT
713+120:1 NEWLINE
714+120:1 glyph +$
715+120:4 name bloq
716+120:9 aura @
717+122:1 NEWLINE
718+122:1 glyph ++
719+122:4 name some
720+122:9 glyph |=
721+122:12 name item
722+122:16 tight glyph =
723+122:17 tight tvar A
724+122:19 glyph `
725+122:20 tight name item
726+124:1 NEWLINE
727+124:1 glyph ++
728+124:4 name lure
729+124:9 glyph |=
730+124:12 name item
731+124:16 tight glyph =
732+124:17 tight tvar A
733+125:3 INDENT
734+125:3 glyph ^-
735+125:6 glyph (
736+125:7 tight name list
737+125:12 tvar A
738+125:13 tight glyph )
739+125:15 glyph [
740+125:16 tight name item
741+125:21 lit ~
742+125:22 tight glyph ]
743+127:1 DEDENT
744+127:1 NEWLINE
745+127:1 glyph ++
746+127:4 name snoc
747+127:9 glyph |=
748+127:12 name args
749+127:16 tight glyph =
750+127:17 tight glyph [
751+127:18 tight glyph (
752+127:19 tight name list
753+127:24 tvar A
754+127:25 tight glyph )
755+127:27 tvar A
756+127:28 tight glyph ]
757+128:3 INDENT
758+128:3 glyph ?-
759+128:6 name args
760+129:5 INDENT
761+129:5 glyph [
762+129:6 tight name xs
763+129:9 name item
764+129:13 tight glyph ]
765+129:15 glyph (
766+129:16 tight name weld
767+129:21 name xs
768+129:24 glyph [
769+129:25 tight name item
770+129:30 lit ~
771+129:31 tight glyph ]
772+129:32 tight glyph )
773+131:1 DEDENT
774+131:1 DEDENT
775+131:1 NEWLINE
776+131:1 glyph ++
777+131:4 name flop
778+131:9 glyph |=
779+131:12 name xs
780+131:14 tight glyph =
781+131:15 tight glyph (
782+131:16 tight name list
783+131:21 tvar A
784+131:22 tight glyph )
785+132:3 INDENT
786+132:3 glyph ++
787+132:6 name reverse-into
788+132:19 glyph |=
789+132:22 name args
790+132:26 tight glyph =
791+132:27 tight glyph [
792+132:28 tight glyph (
793+132:29 tight name list
794+132:34 tvar A
795+132:35 tight glyph )
796+132:37 glyph (
797+132:38 tight name list
798+132:43 tvar A
799+132:44 tight glyph )
800+132:45 tight glyph ]
801+133:5 INDENT
802+133:5 glyph ?-
803+133:8 name args
804+134:7 INDENT
805+134:7 glyph [
806+134:8 tight name rest
807+134:13 name acc
808+134:16 tight glyph ]
809+135:9 INDENT
810+135:9 glyph ?-
811+135:12 name rest
812+136:11 INDENT
813+136:11 lit ~
814+136:13 name acc
815+137:11 NEWLINE
816+137:11 glyph [
817+137:12 tight name item
818+137:17 name more
819+137:21 tight glyph ]
820+137:23 glyph (
821+137:24 tight name reverse-into
822+137:37 name more
823+137:42 glyph [
824+137:43 tight name item
825+137:48 name acc
826+137:51 tight glyph ]
827+137:52 tight glyph )
828+138:3 DEDENT
829+138:3 DEDENT
830+138:3 DEDENT
831+138:3 DEDENT
832+138:3 NEWLINE
833+138:3 glyph (
834+138:4 tight name reverse-into
835+138:17 name xs
836+138:20 lit ~
837+138:21 tight glyph )
838+140:1 DEDENT
839+140:1 NEWLINE
840+140:1 glyph ++
841+140:4 name drop
842+140:9 glyph |=
843+140:12 name maybe
844+140:17 tight glyph =
845+140:18 tight glyph (
846+140:19 tight name unit
847+140:24 tvar A
848+140:25 tight glyph )
849+141:3 INDENT
850+141:3 glyph ?-
851+141:6 name maybe
852+142:5 INDENT
853+142:5 lit ~
854+142:7 lit ~
855+143:5 NEWLINE
856+143:5 glyph [
857+143:6 tight lit ~
858+143:8 name value
859+143:13 tight glyph ]
860+143:15 glyph [
861+143:16 tight name value
862+143:22 lit ~
863+143:23 tight glyph ]
864+145:1 DEDENT
865+145:1 DEDENT
866+145:1 NEWLINE
867+145:1 glyph ++
868+145:4 name bind
869+145:9 glyph |=
870+145:12 name args
871+145:16 tight glyph =
872+145:17 tight glyph [
873+145:18 tight glyph (
874+145:19 tight name unit
875+145:24 tvar A
876+145:25 tight glyph )
877+145:27 glyph $-(
878+145:30 tight tvar A
879+145:32 tvar B
880+145:33 tight glyph )
881+145:34 tight glyph ]
882+146:3 INDENT
883+146:3 glyph ?-
884+146:6 name args
885+147:5 INDENT
886+147:5 glyph [
887+147:6 tight name maybe
888+147:12 name f
889+147:13 tight glyph ]
890+148:7 INDENT
891+148:7 glyph ?-
892+148:10 name maybe
893+149:9 INDENT
894+149:9 lit ~
895+149:11 lit ~
896+150:9 NEWLINE
897+150:9 glyph [
898+150:10 tight lit ~
899+150:12 name value
900+150:17 tight glyph ]
901+150:19 glyph `
902+150:20 tight glyph (
903+150:21 tight name f
904+150:23 name value
905+150:28 tight glyph )
906+152:1 DEDENT
907+152:1 DEDENT
908+152:1 DEDENT
909+152:1 DEDENT
910+152:1 NEWLINE
911+152:1 glyph ++
912+152:4 name biff
913+152:9 glyph |=
914+152:12 name args
915+152:16 tight glyph =
916+152:17 tight glyph [
917+152:18 tight glyph (
918+152:19 tight name unit
919+152:24 tvar A
920+152:25 tight glyph )
921+152:27 glyph $-(
922+152:30 tight tvar A
923+152:32 glyph (
924+152:33 tight name unit
925+152:38 tvar B
926+152:39 tight glyph )
927+152:40 tight glyph )
928+152:41 tight glyph ]
929+153:3 INDENT
930+153:3 glyph ?-
931+153:6 name args
932+154:5 INDENT
933+154:5 glyph [
934+154:6 tight name maybe
935+154:12 name f
936+154:13 tight glyph ]
937+155:7 INDENT
938+155:7 glyph ?-
939+155:10 name maybe
940+156:9 INDENT
941+156:9 lit ~
942+156:11 lit ~
943+157:9 NEWLINE
944+157:9 glyph [
945+157:10 tight lit ~
946+157:12 name value
947+157:17 tight glyph ]
948+157:19 glyph (
949+157:20 tight name f
950+157:22 name value
951+157:27 tight glyph )
952+159:1 DEDENT
953+159:1 DEDENT
954+159:1 DEDENT
955+159:1 DEDENT
956+159:1 NEWLINE
957+159:1 glyph ++
958+159:4 name skim
959+159:9 glyph |=
960+159:12 name args
961+159:16 tight glyph =
962+159:17 tight glyph [
963+159:18 tight glyph (
964+159:19 tight name list
965+159:24 tvar A
966+159:25 tight glyph )
967+159:27 glyph $-(
968+159:30 tight tvar A
969+159:32 glyph ?
970+159:33 tight glyph )
971+159:34 tight glyph ]
972+160:3 INDENT
973+160:3 glyph ?-
974+160:6 name args
975+161:5 INDENT
976+161:5 glyph [
977+161:6 tight name xs
978+161:9 name predicate
979+161:18 tight glyph ]
980+162:7 INDENT
981+162:7 glyph ?-
982+162:10 name xs
983+163:9 INDENT
984+163:9 lit ~
985+163:11 lit ~
986+164:9 NEWLINE
987+164:9 glyph [
988+164:10 tight name item
989+164:15 name rest
990+164:19 tight glyph ]
991+165:11 INDENT
992+165:11 glyph ?-
993+165:14 glyph (
994+165:15 tight name predicate
995+165:25 name item
996+165:29 tight glyph )
997+166:13 INDENT
998+166:13 lit %.y
999+166:17 glyph [
1000+166:18 tight name item
1001+166:23 glyph (
1002+166:24 tight name skim
1003+166:29 name rest
1004+166:34 name predicate
1005+166:43 tight glyph )
1006+166:44 tight glyph ]
1007+167:13 NEWLINE
1008+167:13 lit %.n
1009+167:17 glyph (
1010+167:18 tight name skim
1011+167:23 name rest
1012+167:28 name predicate
1013+167:37 tight glyph )
1014+169:1 DEDENT
1015+169:1 DEDENT
1016+169:1 DEDENT
1017+169:1 DEDENT
1018+169:1 DEDENT
1019+169:1 DEDENT
1020+169:1 NEWLINE
1021+169:1 glyph ++
1022+169:4 name skip
1023+169:9 glyph |=
1024+169:12 name args
1025+169:16 tight glyph =
1026+169:17 tight glyph [
1027+169:18 tight glyph (
1028+169:19 tight name list
1029+169:24 tvar A
1030+169:25 tight glyph )
1031+169:27 glyph $-(
1032+169:30 tight tvar A
1033+169:32 glyph ?
1034+169:33 tight glyph )
1035+169:34 tight glyph ]
1036+170:3 INDENT
1037+170:3 glyph ?-
1038+170:6 name args
1039+171:5 INDENT
1040+171:5 glyph [
1041+171:6 tight name xs
1042+171:9 name predicate
1043+171:18 tight glyph ]
1044+172:7 INDENT
1045+172:7 glyph ?-
1046+172:10 name xs
1047+173:9 INDENT
1048+173:9 lit ~
1049+173:11 lit ~
1050+174:9 NEWLINE
1051+174:9 glyph [
1052+174:10 tight name item
1053+174:15 name rest
1054+174:19 tight glyph ]
1055+175:11 INDENT
1056+175:11 glyph ?-
1057+175:14 glyph (
1058+175:15 tight name predicate
1059+175:25 name item
1060+175:29 tight glyph )
1061+176:13 INDENT
1062+176:13 lit %.y
1063+176:17 glyph (
1064+176:18 tight name skip
1065+176:23 name rest
1066+176:28 name predicate
1067+176:37 tight glyph )
1068+177:13 NEWLINE
1069+177:13 lit %.n
1070+177:17 glyph [
1071+177:18 tight name item
1072+177:23 glyph (
1073+177:24 tight name skip
1074+177:29 name rest
1075+177:34 name predicate
1076+177:43 tight glyph )
1077+177:44 tight glyph ]
1078+177:45 DEDENT
1079+177:45 DEDENT
1080+177:45 DEDENT
1081+177:45 DEDENT
1082+177:45 DEDENT
1083+177:45 DEDENT
1084+177:45 NEWLINE
tests/golden/prelude-unit-list-transforms/tree.txtnew file+454
@@ -0,0 +1,454 @@
1+(module
2+ (value 2:1 same
3+ (gate 2:9
4+ (face 2:12 x (tvar 2:14 A))
5+ (wing 2:16 x)))
6+ (value 4:1 head
7+ (gate 4:9
8+ (face 4:12 p
9+ (cell 4:14 (tvar 4:15 A) (tvar 4:17 B)))
10+ (body 5:3
11+ (branch 5:3
12+ (wing 5:6 p)
13+ (arm 6:5
14+ (cell 6:5 (bind 6:6 a) (bind 6:8 b))
15+ (wing 6:11 a))))))
16+ (value 8:1 tail
17+ (gate 8:9
18+ (face 8:12 p
19+ (cell 8:14 (tvar 8:15 A) (tvar 8:17 B)))
20+ (body 9:3
21+ (branch 9:3
22+ (wing 9:6 p)
23+ (arm 10:5
24+ (cell 10:5 (bind 10:6 a) (bind 10:8 b))
25+ (wing 10:11 b))))))
26+ (value 12:1 not
27+ (gate 12:8
28+ (face 12:11 b (flag 12:13))
29+ (body 13:3
30+ (branch 13:3
31+ (wing 13:6 b)
32+ (arm 14:5 (lit 14:5 %.y) (lit 14:9 %.n))
33+ (arm 15:5 (lit 15:5 %.n) (lit 15:9 %.y))))))
34+ (mold 17:1 list
35+ (generic 17:9 A
36+ (union 18:3
37+ (const 18:3 ~)
38+ (cell 19:3
39+ (face 19:4 i (tvar 19:6 A))
40+ (face 19:8 t
41+ (apply 19:10 list (tvar 19:16 A)))))))
42+ (mold 21:1 unit
43+ (generic 21:9 A
44+ (union 22:3
45+ (const 22:3 ~)
46+ (cell 23:3
47+ (const 23:4 ~)
48+ (face 23:6 u (tvar 23:8 A))))))
49+ (value 25:1 fall
50+ (gate 25:9
51+ (face 25:12 args
52+ (cell 25:17
53+ (apply 25:18 unit (tvar 25:24 A))
54+ (tvar 25:27 A)))
55+ (body 26:3
56+ (branch 26:3
57+ (wing 26:6 args)
58+ (arm 27:5
59+ (cell 27:5 (bind 27:6 maybe) (bind 27:12 fallback))
60+ (body 28:7
61+ (branch 28:7
62+ (wing 28:10 maybe)
63+ (arm 29:9 (lit 29:9 ~) (wing 29:11 fallback))
64+ (arm 30:9
65+ (cell 30:9 (lit 30:10 ~) (bind 30:12 value))
66+ (wing 30:19 value)))))))))
67+ (value 32:1 need
68+ (gate 32:9
69+ (face 32:12 maybe
70+ (apply 32:18 unit (tvar 32:24 A)))
71+ (body 33:3
72+ (branch 33:3
73+ (wing 33:6 maybe)
74+ (arm 34:5 (lit 34:5 ~) (crash 34:7))
75+ (arm 35:5
76+ (cell 35:5 (lit 35:6 ~) (bind 35:8 value))
77+ (wing 35:15 value))))))
78+ (value 37:1 weld
79+ (gate 37:9
80+ (face 37:12 args
81+ (cell 37:17
82+ (apply 37:18 list (tvar 37:24 A))
83+ (apply 37:27 list (tvar 37:33 A))))
84+ (body 38:3
85+ (branch 38:3
86+ (wing 38:6 args)
87+ (arm 39:5
88+ (cell 39:5 (bind 39:6 xs) (bind 39:9 ys))
89+ (body 40:7
90+ (branch 40:7
91+ (wing 40:10 xs)
92+ (arm 41:9 (lit 41:9 ~) (wing 41:11 ys))
93+ (arm 42:9
94+ (cell 42:9 (bind 42:10 item) (bind 42:15 rest))
95+ (tuple 42:21
96+ (wing 42:22 item)
97+ (group 42:27
98+ (call 42:28 (wing 42:28 weld) (wing 42:33 rest) (wing 42:38 ys))))))))))))
99+ (value 44:1 turn
100+ (gate 44:9
101+ (face 44:12 args
102+ (cell 44:17
103+ (apply 44:18 list (tvar 44:24 A))
104+ (fn 44:27 (tvar 44:30 A) (tvar 44:32 B))))
105+ (body 45:3
106+ (branch 45:3
107+ (wing 45:6 args)
108+ (arm 46:5
109+ (cell 46:5 (bind 46:6 xs) (bind 46:9 f))
110+ (body 47:7
111+ (branch 47:7
112+ (wing 47:10 xs)
113+ (arm 48:9 (lit 48:9 ~) (lit 48:11 ~))
114+ (arm 49:9
115+ (cell 49:9 (bind 49:10 item) (bind 49:15 rest))
116+ (tuple 49:21
117+ (group 49:22
118+ (call 49:23 (wing 49:23 f) (wing 49:25 item)))
119+ (group 49:31
120+ (call 49:32 (wing 49:32 turn) (wing 49:37 rest) (wing 49:42 f))))))))))))
121+ (mold 51:1 dime
122+ (cell 51:9
123+ (face 51:10 p (aura 51:12 @ta))
124+ (face 51:16 q (aura 51:18 @))))
125+ (mold 53:1 hair
126+ (cell 53:9
127+ (face 53:10 p (aura 53:12 @ud))
128+ (face 53:16 q (aura 53:18 @ud))))
129+ (mold 55:1 pint
130+ (cell 55:9
131+ (face 55:10 p
132+ (cell 55:12
133+ (face 55:13 p (aura 55:15 @))
134+ (face 55:17 q (aura 55:19 @))))
135+ (face 55:22 q
136+ (cell 55:24
137+ (face 55:25 p (aura 55:27 @))
138+ (face 55:29 q (aura 55:31 @))))))
139+ (mold 57:1 coin
140+ (union 58:3
141+ (cell 58:3
142+ (const 58:4 %$)
143+ (face 58:7 p (ref 58:9 dime)))
144+ (cell 59:3
145+ (const 59:4 %blob)
146+ (face 59:10 p (noun 59:12)))
147+ (cell 60:3
148+ (const 60:4 %many)
149+ (face 60:10 p
150+ (apply 60:12 list (ref 60:18 coin))))))
151+ (mold 62:1 pair
152+ (generic 62:9 A B
153+ (cell 62:18
154+ (face 62:19 p (tvar 62:21 A))
155+ (face 62:23 q (tvar 62:25 B)))))
156+ (mold 64:1 trel
157+ (generic 64:9 A B C
158+ (cell 64:20
159+ (face 64:21 p (tvar 64:23 A))
160+ (face 64:25 q (tvar 64:27 B))
161+ (face 64:29 r (tvar 64:31 C)))))
162+ (mold 66:1 qual
163+ (generic 66:9 A B C D
164+ (cell 66:22
165+ (face 66:23 p (tvar 66:25 A))
166+ (face 66:27 q (tvar 66:29 B))
167+ (face 66:31 r (tvar 66:33 C))
168+ (face 66:35 s (tvar 66:37 D)))))
169+ (mold 68:1 cord (aura 68:9 @t))
170+ (mold 70:1 knot (aura 70:9 @ta))
171+ (mold 72:1 tape
172+ (apply 72:9 list (aura 72:15 @tD)))
173+ (mold 74:1 path
174+ (apply 74:9 list (ref 74:15 knot)))
175+ (mold 76:1 tank
176+ (union 77:3
177+ (ref 77:3 cord)
178+ (cell 78:3
179+ (const 78:4 %leaf)
180+ (face 78:10 p (ref 78:12 tape)))
181+ (cell 79:3
182+ (const 79:4 %palm)
183+ (face 79:10 p
184+ (apply 79:12 qual (ref 79:18 tape) (ref 79:23 tape) (ref 79:28 tape) (ref 79:33 tape)))
185+ (face 79:39 q
186+ (apply 79:41 list (ref 79:47 tank))))
187+ (cell 80:3
188+ (const 80:4 %rose)
189+ (face 80:10 p
190+ (apply 80:12 trel (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape)))
191+ (face 80:34 q
192+ (apply 80:36 list (ref 80:42 tank))))))
193+ (mold 82:1 nail
194+ (cell 82:9
195+ (face 82:10 p (ref 82:12 hair))
196+ (face 82:17 q (ref 82:19 tape))))
197+ (mold 84:1 edge
198+ (cell 84:9
199+ (face 84:10 p (ref 84:12 hair))
200+ (face 84:17 q
201+ (apply 84:19 unit
202+ (cell 84:25
203+ (face 84:26 p (noun 84:28))
204+ (face 84:30 q (ref 84:32 nail)))))))
205+ (mold 86:1 rule
206+ (fn 86:9 (ref 86:12 nail) (ref 86:17 edge)))
207+ (mold 88:1 spot
208+ (cell 88:9
209+ (face 88:10 p (ref 88:12 path))
210+ (face 88:17 q (ref 88:19 pint))))
211+ (mold 90:1 toon
212+ (union 91:3
213+ (cell 91:3
214+ (const 91:4 %0)
215+ (face 91:7 p (noun 91:9)))
216+ (cell 92:3
217+ (const 92:4 %1)
218+ (face 92:7 p (noun 92:9)))
219+ (cell 93:3
220+ (const 93:4 %2)
221+ (face 93:7 p
222+ (apply 93:9 list (ref 93:15 tank))))))
223+ (mold 95:1 like
224+ (generic 95:9 A
225+ (cell 95:16
226+ (face 95:17 p (ref 95:19 hair))
227+ (face 95:24 q
228+ (apply 95:26 unit
229+ (cell 95:32
230+ (face 95:33 p (tvar 95:35 A))
231+ (face 95:37 q (ref 95:39 nail))))))))
232+ (value 97:1 wonk
233+ (gate 97:9
234+ (face 97:12 veq
235+ (apply 97:16 like (tvar 97:22 A)))
236+ (body 98:3
237+ (branch 98:3
238+ (wing 98:6 q.veq)
239+ (arm 99:5 (lit 99:5 ~) (crash 99:7))
240+ (arm 100:5
241+ (cell 100:5 (lit 100:6 ~) (bind 100:8 product))
242+ (wing 100:17 p.product))))))
243+ (mold 102:1 lone
244+ (generic 102:9 A
245+ (cell 102:16
246+ (face 102:17 p (tvar 102:19 A)))))
247+ (mold 104:1 lest
248+ (generic 104:9 A
249+ (cell 104:16
250+ (face 104:17 i (tvar 104:19 A))
251+ (face 104:21 t
252+ (apply 104:23 list (tvar 104:29 A))))))
253+ (mold 106:1 pole
254+ (generic 106:9 A
255+ (union 107:3
256+ (const 107:3 ~)
257+ (cell 108:3
258+ (tvar 108:4 A)
259+ (apply 108:6 pole (tvar 108:12 A))))))
260+ (mold 110:1 quip
261+ (generic 110:9 A B
262+ (cell 110:18
263+ (apply 110:19 list (tvar 110:25 A))
264+ (tvar 110:28 B))))
265+ (mold 112:1 tree
266+ (generic 112:9 A
267+ (union 113:3
268+ (const 113:3 ~)
269+ (cell 114:3
270+ (face 114:4 n (tvar 114:6 A))
271+ (face 114:8 l
272+ (apply 114:10 tree (tvar 114:16 A)))
273+ (face 114:19 r
274+ (apply 114:21 tree (tvar 114:27 A)))))))
275+ (mold 116:1 each
276+ (generic 116:9 A B
277+ (union 117:3
278+ (cell 117:3
279+ (const 117:4 %|)
280+ (face 117:7 p (tvar 117:9 B)))
281+ (cell 118:3
282+ (const 118:4 %&)
283+ (face 118:7 p (tvar 118:9 A))))))
284+ (mold 120:1 bloq (aura 120:9 @))
285+ (value 122:1 some
286+ (gate 122:9
287+ (face 122:12 item (tvar 122:17 A))
288+ (unit 122:19 (wing 122:20 item))))
289+ (value 124:1 lure
290+ (gate 124:9
291+ (face 124:12 item (tvar 124:17 A))
292+ (body 125:3
293+ (cast 125:3
294+ (apply 125:6 list (tvar 125:12 A))
295+ (tuple 125:15 (wing 125:16 item) (lit 125:21 ~))))))
296+ (value 127:1 snoc
297+ (gate 127:9
298+ (face 127:12 args
299+ (cell 127:17
300+ (apply 127:18 list (tvar 127:24 A))
301+ (tvar 127:27 A)))
302+ (body 128:3
303+ (branch 128:3
304+ (wing 128:6 args)
305+ (arm 129:5
306+ (cell 129:5 (bind 129:6 xs) (bind 129:9 item))
307+ (group 129:15
308+ (call 129:16
309+ (wing 129:16 weld)
310+ (wing 129:21 xs)
311+ (tuple 129:24 (wing 129:25 item) (lit 129:30 ~)))))))))
312+ (value 131:1 flop
313+ (gate 131:9
314+ (face 131:12 xs
315+ (apply 131:15 list (tvar 131:21 A)))
316+ (body 132:3
317+ (value 132:3 reverse-into
318+ (gate 132:19
319+ (face 132:22 args
320+ (cell 132:27
321+ (apply 132:28 list (tvar 132:34 A))
322+ (apply 132:37 list (tvar 132:43 A))))
323+ (body 133:5
324+ (branch 133:5
325+ (wing 133:8 args)
326+ (arm 134:7
327+ (cell 134:7 (bind 134:8 rest) (bind 134:13 acc))
328+ (body 135:9
329+ (branch 135:9
330+ (wing 135:12 rest)
331+ (arm 136:11 (lit 136:11 ~) (wing 136:13 acc))
332+ (arm 137:11
333+ (cell 137:11 (bind 137:12 item) (bind 137:17 more))
334+ (group 137:23
335+ (call 137:24
336+ (wing 137:24 reverse-into)
337+ (wing 137:37 more)
338+ (tuple 137:42 (wing 137:43 item) (wing 137:48 acc))))))))))))
339+ (group 138:3
340+ (call 138:4 (wing 138:4 reverse-into) (wing 138:17 xs) (lit 138:20 ~))))))
341+ (value 140:1 drop
342+ (gate 140:9
343+ (face 140:12 maybe
344+ (apply 140:18 unit (tvar 140:24 A)))
345+ (body 141:3
346+ (branch 141:3
347+ (wing 141:6 maybe)
348+ (arm 142:5 (lit 142:5 ~) (lit 142:7 ~))
349+ (arm 143:5
350+ (cell 143:5 (lit 143:6 ~) (bind 143:8 value))
351+ (tuple 143:15 (wing 143:16 value) (lit 143:22 ~)))))))
352+ (value 145:1 bind
353+ (gate 145:9
354+ (face 145:12 args
355+ (cell 145:17
356+ (apply 145:18 unit (tvar 145:24 A))
357+ (fn 145:27 (tvar 145:30 A) (tvar 145:32 B))))
358+ (body 146:3
359+ (branch 146:3
360+ (wing 146:6 args)
361+ (arm 147:5
362+ (cell 147:5 (bind 147:6 maybe) (bind 147:12 f))
363+ (body 148:7
364+ (branch 148:7
365+ (wing 148:10 maybe)
366+ (arm 149:9 (lit 149:9 ~) (lit 149:11 ~))
367+ (arm 150:9
368+ (cell 150:9 (lit 150:10 ~) (bind 150:12 value))
369+ (unit 150:19
370+ (group 150:20
371+ (call 150:21 (wing 150:21 f) (wing 150:23 value))))))))))))
372+ (value 152:1 biff
373+ (gate 152:9
374+ (face 152:12 args
375+ (cell 152:17
376+ (apply 152:18 unit (tvar 152:24 A))
377+ (fn 152:27
378+ (tvar 152:30 A)
379+ (apply 152:32 unit (tvar 152:38 B)))))
380+ (body 153:3
381+ (branch 153:3
382+ (wing 153:6 args)
383+ (arm 154:5
384+ (cell 154:5 (bind 154:6 maybe) (bind 154:12 f))
385+ (body 155:7
386+ (branch 155:7
387+ (wing 155:10 maybe)
388+ (arm 156:9 (lit 156:9 ~) (lit 156:11 ~))
389+ (arm 157:9
390+ (cell 157:9 (lit 157:10 ~) (bind 157:12 value))
391+ (group 157:19
392+ (call 157:20 (wing 157:20 f) (wing 157:22 value)))))))))))
393+ (value 159:1 skim
394+ (gate 159:9
395+ (face 159:12 args
396+ (cell 159:17
397+ (apply 159:18 list (tvar 159:24 A))
398+ (fn 159:27 (tvar 159:30 A) (flag 159:32))))
399+ (body 160:3
400+ (branch 160:3
401+ (wing 160:6 args)
402+ (arm 161:5
403+ (cell 161:5 (bind 161:6 xs) (bind 161:9 predicate))
404+ (body 162:7
405+ (branch 162:7
406+ (wing 162:10 xs)
407+ (arm 163:9 (lit 163:9 ~) (lit 163:11 ~))
408+ (arm 164:9
409+ (cell 164:9 (bind 164:10 item) (bind 164:15 rest))
410+ (body 165:11
411+ (branch 165:11
412+ (group 165:14
413+ (call 165:15 (wing 165:15 predicate) (wing 165:25 item)))
414+ (arm 166:13
415+ (lit 166:13 %.y)
416+ (tuple 166:17
417+ (wing 166:18 item)
418+ (group 166:23
419+ (call 166:24 (wing 166:24 skim) (wing 166:29 rest) (wing 166:34 predicate)))))
420+ (arm 167:13
421+ (lit 167:13 %.n)
422+ (group 167:17
423+ (call 167:18 (wing 167:18 skim) (wing 167:23 rest) (wing 167:28 predicate))))))))))))))
424+ (value 169:1 skip
425+ (gate 169:9
426+ (face 169:12 args
427+ (cell 169:17
428+ (apply 169:18 list (tvar 169:24 A))
429+ (fn 169:27 (tvar 169:30 A) (flag 169:32))))
430+ (body 170:3
431+ (branch 170:3
432+ (wing 170:6 args)
433+ (arm 171:5
434+ (cell 171:5 (bind 171:6 xs) (bind 171:9 predicate))
435+ (body 172:7
436+ (branch 172:7
437+ (wing 172:10 xs)
438+ (arm 173:9 (lit 173:9 ~) (lit 173:11 ~))
439+ (arm 174:9
440+ (cell 174:9 (bind 174:10 item) (bind 174:15 rest))
441+ (body 175:11
442+ (branch 175:11
443+ (group 175:14
444+ (call 175:15 (wing 175:15 predicate) (wing 175:25 item)))
445+ (arm 176:13
446+ (lit 176:13 %.y)
447+ (group 176:17
448+ (call 176:18 (wing 176:18 skip) (wing 176:23 rest) (wing 176:28 predicate))))
449+ (arm 177:13
450+ (lit 177:13 %.n)
451+ (tuple 177:17
452+ (wing 177:18 item)
453+ (group 177:23
454+ (call 177:24 (wing 177:24 skip) (wing 177:29 rest) (wing 177:34 predicate))))))))))))))))
tests/golden/prelude-unit-list-transforms/types.txtnew file+46
@@ -0,0 +1,46 @@
1+partial inference; module not checked
2+++ same: $-(A A)
3+++ head: $-([A B] A)
4+++ tail: $-([A B] B)
5+++ not: $-(? ?)
6++$ list: cases proven disjoint; mold not checked
7++$ unit: cases proven disjoint; mold not checked
8+++ fall: sample mold is not supported by partial inference
9+++ need: sample mold is not supported by partial inference
10+++ weld: sample mold is not supported by partial inference
11+++ turn: sample mold is not supported by partial inference
12++$ dime: not checked
13++$ hair: not checked
14++$ pint: not checked
15++$ coin: cases proven disjoint; mold not checked
16++$ pair: not checked
17++$ trel: not checked
18++$ qual: not checked
19++$ cord: not checked
20++$ knot: not checked
21++$ tape: not checked
22++$ path: not checked
23++$ tank: cases proven disjoint; mold not checked
24++$ nail: not checked
25++$ edge: not checked
26++$ rule: not checked
27++$ spot: not checked
28++$ toon: cases proven disjoint; mold not checked
29++$ like: not checked
30+++ wonk: sample mold is not supported by partial inference
31++$ lone: not checked
32++$ lest: not checked
33++$ pole: cases proven disjoint; mold not checked
34++$ quip: not checked
35++$ tree: cases proven disjoint; mold not checked
36++$ each: cases proven disjoint; mold not checked
37++$ bloq: not checked
38+++ some: expression is not supported by partial inference
39+++ lure: cast mold is not supported by partial inference
40+++ snoc: sample mold is not supported by partial inference
41+++ flop: sample mold is not supported by partial inference
42+++ drop: sample mold is not supported by partial inference
43+++ bind: sample mold is not supported by partial inference
44+++ biff: sample mold is not supported by partial inference
45+++ skim: sample mold is not supported by partial inference
46+++ skip: sample mold is not supported by partial inference
tests/golden/types-import-mark/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/%` names a type after its mark; `/- todo` imports molds from a Hoon `/sur` file.
2+tests: Both runners compile a mark fixture and a `/sur` fixture, then provide their selected types to the partial checker together.
3+expect: parses
4+expect-types: a partial report with the imported mark and `/sur` atom types
tests/golden/types-import-mark/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture title
tests/golden/types-import-mark/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-import-mark/marks.txtnew file+1
@@ -0,0 +1 @@
1+label
tests/golden/types-import-mark/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/- fixture
2+/% %label
3+++ label-id |= x=label x
4+++ title-id |= x=title.fixture x
tests/golden/types-import-mark/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/types-import-mark/tokens.txtnew file+22
@@ -0,0 +1,22 @@
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:4 name label-id
9+3:13 glyph |=
10+3:16 name x
11+3:17 tight glyph =
12+3:18 tight name label
13+3:24 name x
14+4:1 NEWLINE
15+4:1 glyph ++
16+4:4 name title-id
17+4:13 glyph |=
18+4:16 name x
19+4:17 tight glyph =
20+4:18 tight wing title.fixture
21+4:32 name x
22+4:33 NEWLINE
tests/golden/types-import-mark/tree.txtnew file+11
@@ -0,0 +1,11 @@
1+(module
2+ (sur 1:1 fixture)
3+ (mark 2:1 %label)
4+ (value 3:1 label-id
5+ (gate 3:13
6+ (face 3:16 x (ref 3:18 label))
7+ (wing 3:24 x)))
8+ (value 4:1 title-id
9+ (gate 4:13
10+ (face 4:16 x (ref 4:18 title.fixture))
11+ (wing 4:32 x))))
tests/golden/types-import-mark/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ label-id: $-(@t @t)
3+++ title-id: $-(@t @t)
tests/golden/types-partial-atom-alias/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: a type variable used where an atom is required gains an atom constraint, generalized per `++`.
2+tests: an alias preserves the inferred atom constraint and instantiates it independently; decimal literals remain unable to become loobeans through it.
3+expect: parses
4+expect-types: a partial inference report, not a checked module
tests/golden/types-partial-atom-alias/source.jibbnew file+10
@@ -0,0 +1,10 @@
1+++ keep |= x=A
2+ ~& ^- @ x
3+ x
4+++ alias keep
5+++ ship (alias ~zod)
6+++ cord (alias "hello")
7+++ flag (alias %.y)
8+++ bad (alias [~zod "hi"])
9+++ number (alias 7)
10+++ relay ^- ? (alias 7)
tests/golden/types-partial-atom-alias/tokens.txtnew file+67
@@ -0,0 +1,67 @@
1+1:1 glyph ++
2+1:4 name keep
3+1:9 glyph |=
4+1:12 name x
5+1:13 tight glyph =
6+1:14 tight tvar A
7+2:3 INDENT
8+2:3 glyph ~&
9+2:6 glyph ^-
10+2:9 aura @
11+2:11 name x
12+3:5 INDENT
13+3:5 name x
14+4:1 DEDENT
15+4:1 DEDENT
16+4:1 NEWLINE
17+4:1 glyph ++
18+4:4 name alias
19+4:10 name keep
20+5:1 NEWLINE
21+5:1 glyph ++
22+5:4 name ship
23+5:9 glyph (
24+5:10 tight name alias
25+5:16 lit ~zod
26+5:20 tight glyph )
27+6:1 NEWLINE
28+6:1 glyph ++
29+6:4 name cord
30+6:9 glyph (
31+6:10 tight name alias
32+6:16 str "hello"
33+6:23 tight glyph )
34+7:1 NEWLINE
35+7:1 glyph ++
36+7:4 name flag
37+7:9 glyph (
38+7:10 tight name alias
39+7:16 lit %.y
40+7:19 tight glyph )
41+8:1 NEWLINE
42+8:1 glyph ++
43+8:4 name bad
44+8:8 glyph (
45+8:9 tight name alias
46+8:15 glyph [
47+8:16 tight lit ~zod
48+8:21 str "hi"
49+8:25 tight glyph ]
50+8:26 tight glyph )
51+9:1 NEWLINE
52+9:1 glyph ++
53+9:4 name number
54+9:11 glyph (
55+9:12 tight name alias
56+9:18 lit 7
57+9:19 tight glyph )
58+10:1 NEWLINE
59+10:1 glyph ++
60+10:4 name relay
61+10:10 glyph ^-
62+10:13 glyph ?
63+10:15 glyph (
64+10:16 tight name alias
65+10:22 lit 7
66+10:23 tight glyph )
67+10:24 NEWLINE
tests/golden/types-partial-atom-alias/tree.txtnew file+31
@@ -0,0 +1,31 @@
1+(module
2+ (value 1:1 keep
3+ (gate 1:9
4+ (face 1:12 x (tvar 1:14 A))
5+ (body 2:3
6+ (trace 2:3
7+ (cast 2:6 (aura 2:9 @) (wing 2:11 x))
8+ (body 3:5 (wing 3:5 x))))))
9+ (value 4:1 alias (wing 4:10 keep))
10+ (value 5:1 ship
11+ (group 5:9
12+ (call 5:10 (wing 5:10 alias) (lit 5:16 ~zod))))
13+ (value 6:1 cord
14+ (group 6:9
15+ (call 6:10 (wing 6:10 alias) (str 6:16 "hello"))))
16+ (value 7:1 flag
17+ (group 7:9
18+ (call 7:10 (wing 7:10 alias) (lit 7:16 %.y))))
19+ (value 8:1 bad
20+ (group 8:8
21+ (call 8:9
22+ (wing 8:9 alias)
23+ (tuple 8:15 (lit 8:16 ~zod) (str 8:21 "hi")))))
24+ (value 9:1 number
25+ (group 9:11
26+ (call 9:12 (wing 9:12 alias) (lit 9:18 7))))
27+ (value 10:1 relay
28+ (cast 10:10
29+ (flag 10:13)
30+ (group 10:15
31+ (call 10:16 (wing 10:16 alias) (lit 10:22 7))))))
tests/golden/types-partial-atom-alias/types.txtnew file+21
@@ -0,0 +1,21 @@
1+partial inference; module not checked
2+++ keep: $-(A A) where A is an atom
3+++ alias: $-(A A) where A is an atom
4+++ ship: @p
5+++ cord: @t
6+++ flag: ?
7+++ bad: call's sample and argument types do not unify
8+/tests/golden/types-partial-atom-alias/source.jibb:8:9: called gate has type $-(A A) where A is an atom
9+++ bad (alias [~zod "hi"])
10+ ^
11+/tests/golden/types-partial-atom-alias/source.jibb:8:15: argument has type [@p @t]
12+++ bad (alias [~zod "hi"])
13+ ^
14+++ number: unresolved aura-variable inference
15+++ relay: cast mold and expression type do not unify
16+/tests/golden/types-partial-atom-alias/source.jibb:10:13: cast mold has type ?
17+++ relay ^- ? (alias 7)
18+ ^
19+/tests/golden/types-partial-atom-alias/source.jibb:10:15: expression
20+++ relay ^- ? (alias 7)
21+ ^
tests/golden/types-partial-branch-widening/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: a specific atom fits `@`, and a subaura fits its parent; different specific auras do not unify.
2+tests: a branch joins an already present parent aura or unrestricted atom in either order; unresolved variable-dependent joins stay unsupported, and sibling auras remain distinct.
3+expect: parses
4+expect-types: a partial inference report, not a checked module
tests/golden/types-partial-branch-widening/source.jibbnew file+20
@@ -0,0 +1,20 @@
1+++ join |= b=?
2+ ?- b
3+ %.y ^- @u 0x1f
4+ %.n 0x1f
5+++ reverse |= b=?
6+ ?- b
7+ %.y 0x1f
8+ %.n ^- @u 0x1f
9+++ atom |= b=?
10+ ?- b
11+ %.y ^- @ ~zod
12+ %.n "hi"
13+++ unknown |= x
14+ ?- %.y
15+ %.y x
16+ %.n 0x1f
17+++ siblings |= b=?
18+ ?- b
19+ %.y ^- @ud 1
20+ %.n 0x1f
tests/golden/types-partial-branch-widening/tokens.txtnew file+96
@@ -0,0 +1,96 @@
1+1:1 glyph ++
2+1:4 name join
3+1:9 glyph |=
4+1:12 name b
5+1:13 tight glyph =
6+1:14 tight glyph ?
7+2:3 INDENT
8+2:3 glyph ?-
9+2:6 name b
10+3:5 INDENT
11+3:5 lit %.y
12+3:9 glyph ^-
13+3:12 aura @u
14+3:15 lit 0x1f
15+4:5 NEWLINE
16+4:5 lit %.n
17+4:9 lit 0x1f
18+5:1 DEDENT
19+5:1 DEDENT
20+5:1 NEWLINE
21+5:1 glyph ++
22+5:4 name reverse
23+5:12 glyph |=
24+5:15 name b
25+5:16 tight glyph =
26+5:17 tight glyph ?
27+6:3 INDENT
28+6:3 glyph ?-
29+6:6 name b
30+7:5 INDENT
31+7:5 lit %.y
32+7:9 lit 0x1f
33+8:5 NEWLINE
34+8:5 lit %.n
35+8:9 glyph ^-
36+8:12 aura @u
37+8:15 lit 0x1f
38+9:1 DEDENT
39+9:1 DEDENT
40+9:1 NEWLINE
41+9:1 glyph ++
42+9:4 name atom
43+9:9 glyph |=
44+9:12 name b
45+9:13 tight glyph =
46+9:14 tight glyph ?
47+10:3 INDENT
48+10:3 glyph ?-
49+10:6 name b
50+11:5 INDENT
51+11:5 lit %.y
52+11:9 glyph ^-
53+11:12 aura @
54+11:14 lit ~zod
55+12:5 NEWLINE
56+12:5 lit %.n
57+12:9 str "hi"
58+13:1 DEDENT
59+13:1 DEDENT
60+13:1 NEWLINE
61+13:1 glyph ++
62+13:4 name unknown
63+13:12 glyph |=
64+13:15 name x
65+14:3 INDENT
66+14:3 glyph ?-
67+14:6 lit %.y
68+15:5 INDENT
69+15:5 lit %.y
70+15:9 name x
71+16:5 NEWLINE
72+16:5 lit %.n
73+16:9 lit 0x1f
74+17:1 DEDENT
75+17:1 DEDENT
76+17:1 NEWLINE
77+17:1 glyph ++
78+17:4 name siblings
79+17:13 glyph |=
80+17:16 name b
81+17:17 tight glyph =
82+17:18 tight glyph ?
83+18:3 INDENT
84+18:3 glyph ?-
85+18:6 name b
86+19:5 INDENT
87+19:5 lit %.y
88+19:9 glyph ^-
89+19:12 aura @ud
90+19:16 lit 1
91+20:5 NEWLINE
92+20:5 lit %.n
93+20:9 lit 0x1f
94+20:13 DEDENT
95+20:13 DEDENT
96+20:13 NEWLINE
tests/golden/types-partial-branch-widening/tree.txtnew file+49
@@ -0,0 +1,49 @@
1+(module
2+ (value 1:1 join
3+ (gate 1:9
4+ (face 1:12 b (flag 1:14))
5+ (body 2:3
6+ (branch 2:3
7+ (wing 2:6 b)
8+ (arm 3:5
9+ (lit 3:5 %.y)
10+ (cast 3:9 (aura 3:12 @u) (lit 3:15 0x1f)))
11+ (arm 4:5 (lit 4:5 %.n) (lit 4:9 0x1f))))))
12+ (value 5:1 reverse
13+ (gate 5:12
14+ (face 5:15 b (flag 5:17))
15+ (body 6:3
16+ (branch 6:3
17+ (wing 6:6 b)
18+ (arm 7:5 (lit 7:5 %.y) (lit 7:9 0x1f))
19+ (arm 8:5
20+ (lit 8:5 %.n)
21+ (cast 8:9 (aura 8:12 @u) (lit 8:15 0x1f)))))))
22+ (value 9:1 atom
23+ (gate 9:9
24+ (face 9:12 b (flag 9:14))
25+ (body 10:3
26+ (branch 10:3
27+ (wing 10:6 b)
28+ (arm 11:5
29+ (lit 11:5 %.y)
30+ (cast 11:9 (aura 11:12 @) (lit 11:14 ~zod)))
31+ (arm 12:5 (lit 12:5 %.n) (str 12:9 "hi"))))))
32+ (value 13:1 unknown
33+ (gate 13:12
34+ (bind 13:15 x)
35+ (body 14:3
36+ (branch 14:3
37+ (lit 14:6 %.y)
38+ (arm 15:5 (lit 15:5 %.y) (wing 15:9 x))
39+ (arm 16:5 (lit 16:5 %.n) (lit 16:9 0x1f))))))
40+ (value 17:1 siblings
41+ (gate 17:13
42+ (face 17:16 b (flag 17:18))
43+ (body 18:3
44+ (branch 18:3
45+ (wing 18:6 b)
46+ (arm 19:5
47+ (lit 19:5 %.y)
48+ (cast 19:9 (aura 19:12 @ud) (lit 19:16 1)))
49+ (arm 20:5 (lit 20:5 %.n) (lit 20:9 0x1f)))))))
tests/golden/types-partial-branch-widening/types.txtnew file+12
@@ -0,0 +1,12 @@
1+partial inference; module not checked
2+++ join: $-(? @u)
3+++ reverse: $-(? @u)
4+++ atom: $-(? @)
5+++ unknown: branch widening is not supported by partial inference
6+++ siblings: branch arms have incompatible types
7+/tests/golden/types-partial-branch-widening/source.jibb:19:9: first arm has type @ud
8+ %.y ^- @ud 1
9+ ^
10+/tests/golden/types-partial-branch-widening/source.jibb:20:9: second arm has type @ux
11+ %.n 0x1f
12+ ^
tests/golden/types-partial-union-cases/types.txt+21−3
@@ -1,11 +1,29 @@
11partial inference; module not checked
22+$ tagged: cases proven disjoint; mold not checked
3−+$ overlapping: overlapping cases at 5:3 and 6:3; mold not checked
3++$ overlapping: overlapping cases; mold not checked
4+/tests/golden/types-partial-union-cases/source.jibb:5:3: first union case
5+ [%a @t]
6+ ^
7+/tests/golden/types-partial-union-cases/source.jibb:6:3: overlapping case
8+ [%a @ud]
9+ ^
410+$ unresolved: case disjointness unresolved; mold not checked
511+$ flag-tag: cases proven disjoint; mold not checked
612+$ flag-cell: cases proven disjoint; mold not checked
7−+$ flag-value: overlapping cases at 17:3 and 18:3; mold not checked
8−+$ wildcard: overlapping cases at 20:3 and 21:3; mold not checked
13++$ flag-value: overlapping cases; mold not checked
14+/tests/golden/types-partial-union-cases/source.jibb:17:3: first union case
15+ ?
16+ ^
17+/tests/golden/types-partial-union-cases/source.jibb:18:3: overlapping case
18+ %.y
19+ ^
20++$ wildcard: overlapping cases; mold not checked
21+/tests/golden/types-partial-union-cases/source.jibb:20:3: first union case
22+ *
23+ ^
24+/tests/golden/types-partial-union-cases/source.jibb:21:3: overlapping case
25+ %a
26+ ^
927+$ nested: cases proven disjoint; mold not checked
1028+$ case-a: not checked
1129+$ through-name: cases proven disjoint; mold not checked
tests/golden/types-partial-union-edges/types.txt+7−1
@@ -3,7 +3,13 @@ partial inference; module not checked
33+$ empty-cell: cases proven disjoint; mold not checked
44+$ inner: cases proven disjoint; mold not checked
55+$ named-disjoint: cases proven disjoint; mold not checked
6−+$ named-overlap: overlapping cases at 14:3 and 15:3; mold not checked
6++$ named-overlap: overlapping cases; mold not checked
7+/tests/golden/types-partial-union-edges/source.jibb:14:3: first union case
8+ inner
9+ ^
10+/tests/golden/types-partial-union-edges/source.jibb:15:3: overlapping case
11+ %b
12+ ^
713+$ opaque: case disjointness unresolved; mold not checked
814+$ tagged-gates: cases proven disjoint; mold not checked
915+$ same-tag-gates: case disjointness unresolved; mold not checked
tests/importer/about.txt+6−2
@@ -2,9 +2,13 @@
22recursion, and unsupported forms. `shadow.txt` checks local generator
33shadowing and missing provenance. `shadow-static.txt` checks that a local
44list shadow alongside a nested ordered map is rejected. Static sibling
5−collections and dependent sibling molds are tested separately. `ford.txt`
5+collections and dependent sibling molds are tested separately. Nested `$^`
6+cases fail closed, while nested `$@` cases remain supported. `ford.txt`
67checks a synthetic imported subject and selected mold; other cases check
7−transitive imports, shadowing and malformed subjects. The synthetic hold in +bad-branch-fixture checks that a failed Hoon branch expansion returns
8+transitive imports, shadowing, malformed subjects and recursion whose
9+origin cannot yet be established. The mark fixtures check door samples,
10+collection provenance, unsupported gates and recursive sample rejection.
11+The synthetic hold in +bad-branch-fixture checks that a failed Hoon branch expansion returns
812an error. `tlon-epic.txt`, `tlon-presence.txt` and `tlon-docs.txt` are the
913unmodified `desk/sur/epic.hoon`, `desk/sur/presence.hoon` and
1014`desk/sur/docs.hoon` from tloncorp/tlon-apps at commit
tests/importer/ford.txt+2
@@ -1,4 +1,6 @@
11|%
22+$ lists (list @ud)
33+$ wrapped item:small
4++$ recursive chain:small
5++$ local $@(~ [v=@ud next=local])
46--
tests/importer/mark-gate.txtnew file+3
@@ -0,0 +1,3 @@
1+|_ a=$-(@t @t)
2+++ grad %noun
3+--
tests/importer/mark-list.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=(list @ud)
2+++ grab |% ++ noun (list @ud) --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/importer/mark-recursive.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=chain:small
2+++ grab |% ++ noun chain:small --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/importer/mark.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=item:small
2+++ grab |% ++ noun item:small --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/importer/small.txt+3
@@ -25,6 +25,9 @@
2525+$ signed @sd
2626+$ float @rd
2727+$ gate-test $-(@ud @ud)
28++$ nested-atom-cell [left=$@(@ud [a=@ud b=@t]) right=$@(@t [c=@ud d=@t])]
29++$ nested-valid-cell [id=@ud value=$^(@ud [a=@ud b=@t])]
30++$ nested-invalid-cell [id=@ud value=$^(@ud @ud)]
2831+$ valid-cell $^(@ud [x=@ud y=@ud])
2932+$ invalid-cell $^(@ud @ud)
3033--
tests/importer/tree.txt+11
@@ -17,8 +17,16 @@ mixed-mop: [a=(mop @ud @t) b=(list @ud)]
1717nested-static-mop: [a=(mop @ud @t) b=(map @ud (jar @t @ud))]
1818collection-siblings: [a=(mop @ud @t) [b=(set @ud) [c=(qeu @t) [d=(unit @ud) e=(jug @ud @t)]]]]
1919dynamic-sibling-mop: error: a nested Hoon mop needs source-aware import
20+mark-record: [id=@ud text=@t]
21+mark-recursive: error: a recursive Hoon mark needs source-aware import
22+mark-gate: error: cores and gates cannot be imported
23+mark-list: (list @ud)
24+mark-shadow: error: Hoon collection provenance is unavailable or shadowed
25+mark-not-core: error: Hoon mark provenance is unavailable
2026ford-list: (list @ud)
2127ford-imported: [id=@ud text=@t]
28+ford-recursive: error: a recursive Hoon mold with Ford imports needs source-aware import
29+ford-local-recursive: error: a recursive Hoon mold with Ford imports needs source-aware import
2230ford-transitive: (list @ud)
2331ford-shadow: error: Hoon collection provenance is unavailable or shadowed
2432ford-transitive-shadow: error: Hoon collection provenance is unavailable or shadowed
@@ -33,6 +41,9 @@ float: error: signed and float auras cannot be imported
3341gate: error: cores and gates cannot be imported
3442vase: error: vases cannot be imported
3543failed-branch: error: a Hoon $^ union needs a source-level disjointness check
44+nested-atom-cell: [left=(union [a=@ud b=@t] @ud) right=(union [c=@ud d=@t] @t)]
45+nested-valid-cell: error: a Hoon $^ union needs a source-level disjointness check
46+nested-invalid-cell: error: a Hoon $^ union needs a source-level disjointness check
3647valid-cell: (union [x=@ud y=@ud] @ud)
3748invalid-cell: error: a Hoon $^ union has overlapping cases
3849chapter-malformed: unsafe
tests/lib/jibb-import.hoon+9−1
@@ -8,6 +8,10 @@
88/* shadow %txt /tests/importer/shadow/txt
99/* shadow-static %txt /tests/importer/shadow-static/txt
1010/* ford %txt /tests/importer/ford/txt
11+/* mark %txt /tests/importer/mark/txt
12+/* mark-rec %txt /tests/importer/mark-recursive/txt
13+/* mark-gate %txt /tests/importer/mark-gate/txt
14+/* mark-basic %txt /tests/importer/mark-list/txt
1115/* expected %txt /tests/importer/tree/txt
1216|%
1317++ lines-to-cord
@@ -24,8 +28,12 @@
2428 ?~ shadow ~[leaf+"shadow fixture is missing"]
2529 ?~ shadow-static ~[leaf+"static shadow fixture is missing"]
2630 ?~ ford ~[leaf+"Ford importer fixture is missing"]
31+ ?~ mark ~[leaf+"mark fixture is missing"]
32+ ?~ mark-rec ~[leaf+"recursive mark fixture is missing"]
33+ ?~ mark-gate ~[leaf+"gate mark fixture is missing"]
34+ ?~ mark-basic ~[leaf+"list mark fixture is missing"]
2735 ?~ expected ~[leaf+"importer golden output is missing"]
28− =/ 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))
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))
2937 ?. =(actual expected)
3038 ~[leaf+"importer projection differs from tests/importer/tree.txt"]
3139 ~
tests/lib/jibb-mark-bridge.hoonnew file+28
@@ -0,0 +1,28 @@
1+:: Check the explicit mark boundary under eval and on the fake ship.
2+/+ jibb
3+/* declared %txt /tests/type-mark/declared/txt
4+/* missing %txt /tests/type-mark/missing/txt
5+/* sur %txt /tests/type-mark/sur/txt
6+/* collision %txt /tests/type-mark/collision/txt
7+/* expected %txt /tests/type-mark/expected/txt
8+|%
9+++ text
10+ |= lines=wain
11+ ^- @t
12+ (rap 3 (turn lines |=(line=@t (cat 3 line '\0a'))))
13+++ test-mark-bridge
14+ ^- tang
15+ ?~ declared ~[leaf+"mark bridge declared fixture is missing"]
16+ ?~ missing ~[leaf+"mark bridge missing fixture is missing"]
17+ ?~ sur ~[leaf+"mark bridge /sur fixture is missing"]
18+ ?~ collision ~[leaf+"mark bridge collision fixture is missing"]
19+ ?~ expected ~[leaf+"mark bridge expected output is missing"]
20+ =/ got (bridge-output (text declared) (text missing) (text sur) (text collision))
21+ ?. =((to-wain:format (cat 3 got '\0a')) expected)
22+ ~[leaf+"mark bridge output differs from tests/type-mark/expected.txt"]
23+ ~
24+++ bridge-output
25+ |= [declared=@t missing=@t sur=@t collision=@t]
26+ ^- @t
27+ (of-wain:format ~[(golden-types-with-marks:jibb /test/jibb declared ~ ~[[%label [%& [%atom %t ~]]]]) (golden-types-with-marks:jibb /test/jibb missing ~ ~[[%label [%& [%atom %t ~]]]]) (golden-types-with-marks:jibb /test/jibb sur ~ ~[[%label [%& [%atom %t ~]]]]) (golden-types-with-marks:jibb /test/jibb collision ~ ~[[%label [%& [%atom %t ~]]]]) (golden-types-with-marks:jibb /test/jibb declared ~ ~[[%label [%| 'failed']]]) (golden-types-with-marks:jibb /test/jibb declared ~ ~[[%label [%& [%atom %t ~]]] [%label [%& [%atom %ud ~]]]]) (golden-types-with-marks:jibb /test/jibb declared ~ ~[[%label [%& [%face %x [%atom %t ~]]]]])])
28+--
tests/lib/jibb.hoon+183−137
@@ -1164,116 +1164,134 @@
11641164/* tok-379 %txt /tests/golden/prelude-list-unit/tokens/txt
11651165/* tre-379 %txt /tests/golden/prelude-list-unit/tree/txt
11661166/* typ-379 %txt /tests/golden/prelude-list-unit/types/txt
1167−/* src-380 %jibb /tests/golden/types-import-sur/source/jibb
1168−/* tok-380 %txt /tests/golden/types-import-sur/tokens/txt
1169−/* tre-380 %txt /tests/golden/types-import-sur/tree/txt
1170−/* typ-380 %txt /tests/golden/types-import-sur/types/txt
1171−/* imp-380-1 %txt /tests/golden/types-import-sur/sur/fixture/txt
1172−/* imp-380-2 %txt /tests/golden/types-import-sur/sur/fixture/txt
1173−/* src-381 %jibb /tests/golden/types-partial-apply/source/jibb
1174−/* tok-381 %txt /tests/golden/types-partial-apply/tokens/txt
1175−/* tre-381 %txt /tests/golden/types-partial-apply/tree/txt
1176−/* typ-381 %txt /tests/golden/types-partial-apply/types/txt
1177−/* src-382 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1178−/* tok-382 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1179−/* tre-382 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1180−/* typ-382 %txt /tests/golden/types-partial-atom-constraint/types/txt
1181−/* src-383 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1182−/* tok-383 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1183−/* tre-383 %txt /tests/golden/types-partial-atom-widening/tree/txt
1184−/* typ-383 %txt /tests/golden/types-partial-atom-widening/types/txt
1185−/* src-384 %jibb /tests/golden/types-partial-aura/source/jibb
1186−/* tok-384 %txt /tests/golden/types-partial-aura/tokens/txt
1187−/* tre-384 %txt /tests/golden/types-partial-aura/tree/txt
1188−/* typ-384 %txt /tests/golden/types-partial-aura/types/txt
1189−/* src-385 %jibb /tests/golden/types-partial-aura-family/source/jibb
1190−/* tok-385 %txt /tests/golden/types-partial-aura-family/tokens/txt
1191−/* tre-385 %txt /tests/golden/types-partial-aura-family/tree/txt
1192−/* typ-385 %txt /tests/golden/types-partial-aura-family/types/txt
1193−/* src-386 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1194−/* tok-386 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1195−/* tre-386 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1196−/* typ-386 %txt /tests/golden/types-partial-aura-generalization/types/txt
1197−/* src-387 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1198−/* tok-387 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1199−/* tre-387 %txt /tests/golden/types-partial-bare-atom/tree/txt
1200−/* typ-387 %txt /tests/golden/types-partial-bare-atom/types/txt
1201−/* src-388 %jibb /tests/golden/types-partial-conflicting-sites/source/jibb
1202−/* tok-388 %txt /tests/golden/types-partial-conflicting-sites/tokens/txt
1203−/* tre-388 %txt /tests/golden/types-partial-conflicting-sites/tree/txt
1204−/* typ-388 %txt /tests/golden/types-partial-conflicting-sites/types/txt
1205−/* src-389 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1206−/* tok-389 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1207−/* tre-389 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1208−/* typ-389 %txt /tests/golden/types-partial-dependency-chain/types/txt
1209−/* src-390 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1210−/* tok-390 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1211−/* tre-390 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1212−/* typ-390 %txt /tests/golden/types-partial-explicit-capital/types/txt
1213−/* src-391 %jibb /tests/golden/types-partial-forward/source/jibb
1214−/* tok-391 %txt /tests/golden/types-partial-forward/tokens/txt
1215−/* tre-391 %txt /tests/golden/types-partial-forward/tree/txt
1216−/* typ-391 %txt /tests/golden/types-partial-forward/types/txt
1217−/* src-392 %jibb /tests/golden/types-partial-generalization/source/jibb
1218−/* tok-392 %txt /tests/golden/types-partial-generalization/tokens/txt
1219−/* tre-392 %txt /tests/golden/types-partial-generalization/tree/txt
1220−/* typ-392 %txt /tests/golden/types-partial-generalization/types/txt
1221−/* src-393 %jibb /tests/golden/types-partial-identity/source/jibb
1222−/* tok-393 %txt /tests/golden/types-partial-identity/tokens/txt
1223−/* tre-393 %txt /tests/golden/types-partial-identity/tree/txt
1224−/* typ-393 %txt /tests/golden/types-partial-identity/types/txt
1225−/* src-394 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1226−/* tok-394 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1227−/* tre-394 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1228−/* typ-394 %txt /tests/golden/types-partial-independent-atoms/types/txt
1229−/* src-395 %jibb /tests/golden/types-partial-many-atom-constraints/source/jibb
1230−/* tok-395 %txt /tests/golden/types-partial-many-atom-constraints/tokens/txt
1231−/* tre-395 %txt /tests/golden/types-partial-many-atom-constraints/tree/txt
1232−/* typ-395 %txt /tests/golden/types-partial-many-atom-constraints/types/txt
1233−/* src-396 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1234−/* tok-396 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1235−/* tre-396 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1236−/* typ-396 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1237−/* src-397 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1238−/* tok-397 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1239−/* tre-397 %txt /tests/golden/types-partial-mold-composite/tree/txt
1240−/* typ-397 %txt /tests/golden/types-partial-mold-composite/types/txt
1241−/* src-398 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1242−/* tok-398 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1243−/* tre-398 %txt /tests/golden/types-partial-mold-forward/tree/txt
1244−/* typ-398 %txt /tests/golden/types-partial-mold-forward/types/txt
1245−/* src-399 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1246−/* tok-399 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1247−/* tre-399 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1248−/* typ-399 %txt /tests/golden/types-partial-mold-recursive/types/txt
1249−/* src-400 %jibb /tests/golden/types-partial-occurs/source/jibb
1250−/* tok-400 %txt /tests/golden/types-partial-occurs/tokens/txt
1251−/* tre-400 %txt /tests/golden/types-partial-occurs/tree/txt
1252−/* typ-400 %txt /tests/golden/types-partial-occurs/types/txt
1253−/* src-401 %jibb /tests/golden/types-partial-projection/source/jibb
1254−/* tok-401 %txt /tests/golden/types-partial-projection/tokens/txt
1255−/* tre-401 %txt /tests/golden/types-partial-projection/tree/txt
1256−/* typ-401 %txt /tests/golden/types-partial-projection/types/txt
1257−/* src-402 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1258−/* tok-402 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1259−/* tre-402 %txt /tests/golden/types-partial-shadow-global/tree/txt
1260−/* typ-402 %txt /tests/golden/types-partial-shadow-global/types/txt
1261−/* src-403 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1262−/* tok-403 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1263−/* tre-403 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1264−/* typ-403 %txt /tests/golden/types-partial-shared-tvar/types/txt
1265−/* src-404 %jibb /tests/golden/types-partial-union-cases/source/jibb
1266−/* tok-404 %txt /tests/golden/types-partial-union-cases/tokens/txt
1267−/* tre-404 %txt /tests/golden/types-partial-union-cases/tree/txt
1268−/* typ-404 %txt /tests/golden/types-partial-union-cases/types/txt
1269−/* src-405 %jibb /tests/golden/types-partial-union-edges/source/jibb
1270−/* tok-405 %txt /tests/golden/types-partial-union-edges/tokens/txt
1271−/* tre-405 %txt /tests/golden/types-partial-union-edges/tree/txt
1272−/* typ-405 %txt /tests/golden/types-partial-union-edges/types/txt
1273−/* src-406 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1274−/* tok-406 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1275−/* tre-406 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1276−/* typ-406 %txt /tests/golden/types-partial-unresolved-tag/types/txt
1167+/* src-380 %jibb /tests/golden/prelude-unit-list-transforms/source/jibb
1168+/* tok-380 %txt /tests/golden/prelude-unit-list-transforms/tokens/txt
1169+/* tre-380 %txt /tests/golden/prelude-unit-list-transforms/tree/txt
1170+/* typ-380 %txt /tests/golden/prelude-unit-list-transforms/types/txt
1171+/* src-381 %jibb /tests/golden/types-import-mark/source/jibb
1172+/* tok-381 %txt /tests/golden/types-import-mark/tokens/txt
1173+/* tre-381 %txt /tests/golden/types-import-mark/tree/txt
1174+/* typ-381 %txt /tests/golden/types-import-mark/types/txt
1175+/* imp-381-1 %txt /tests/golden/types-import-mark/sur/fixture/txt
1176+/* mark-381-1 %txt /tests/golden/types-import-mark/mar/label/txt
1177+/* src-382 %jibb /tests/golden/types-import-sur/source/jibb
1178+/* tok-382 %txt /tests/golden/types-import-sur/tokens/txt
1179+/* tre-382 %txt /tests/golden/types-import-sur/tree/txt
1180+/* typ-382 %txt /tests/golden/types-import-sur/types/txt
1181+/* imp-382-1 %txt /tests/golden/types-import-sur/sur/fixture/txt
1182+/* imp-382-2 %txt /tests/golden/types-import-sur/sur/fixture/txt
1183+/* src-383 %jibb /tests/golden/types-partial-apply/source/jibb
1184+/* tok-383 %txt /tests/golden/types-partial-apply/tokens/txt
1185+/* tre-383 %txt /tests/golden/types-partial-apply/tree/txt
1186+/* typ-383 %txt /tests/golden/types-partial-apply/types/txt
1187+/* src-384 %jibb /tests/golden/types-partial-atom-alias/source/jibb
1188+/* tok-384 %txt /tests/golden/types-partial-atom-alias/tokens/txt
1189+/* tre-384 %txt /tests/golden/types-partial-atom-alias/tree/txt
1190+/* typ-384 %txt /tests/golden/types-partial-atom-alias/types/txt
1191+/* src-385 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1192+/* tok-385 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1193+/* tre-385 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1194+/* typ-385 %txt /tests/golden/types-partial-atom-constraint/types/txt
1195+/* src-386 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1196+/* tok-386 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1197+/* tre-386 %txt /tests/golden/types-partial-atom-widening/tree/txt
1198+/* typ-386 %txt /tests/golden/types-partial-atom-widening/types/txt
1199+/* src-387 %jibb /tests/golden/types-partial-aura/source/jibb
1200+/* tok-387 %txt /tests/golden/types-partial-aura/tokens/txt
1201+/* tre-387 %txt /tests/golden/types-partial-aura/tree/txt
1202+/* typ-387 %txt /tests/golden/types-partial-aura/types/txt
1203+/* src-388 %jibb /tests/golden/types-partial-aura-family/source/jibb
1204+/* tok-388 %txt /tests/golden/types-partial-aura-family/tokens/txt
1205+/* tre-388 %txt /tests/golden/types-partial-aura-family/tree/txt
1206+/* typ-388 %txt /tests/golden/types-partial-aura-family/types/txt
1207+/* src-389 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1208+/* tok-389 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1209+/* tre-389 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1210+/* typ-389 %txt /tests/golden/types-partial-aura-generalization/types/txt
1211+/* src-390 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1212+/* tok-390 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1213+/* tre-390 %txt /tests/golden/types-partial-bare-atom/tree/txt
1214+/* typ-390 %txt /tests/golden/types-partial-bare-atom/types/txt
1215+/* src-391 %jibb /tests/golden/types-partial-branch-widening/source/jibb
1216+/* tok-391 %txt /tests/golden/types-partial-branch-widening/tokens/txt
1217+/* tre-391 %txt /tests/golden/types-partial-branch-widening/tree/txt
1218+/* typ-391 %txt /tests/golden/types-partial-branch-widening/types/txt
1219+/* src-392 %jibb /tests/golden/types-partial-conflicting-sites/source/jibb
1220+/* tok-392 %txt /tests/golden/types-partial-conflicting-sites/tokens/txt
1221+/* tre-392 %txt /tests/golden/types-partial-conflicting-sites/tree/txt
1222+/* typ-392 %txt /tests/golden/types-partial-conflicting-sites/types/txt
1223+/* src-393 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1224+/* tok-393 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1225+/* tre-393 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1226+/* typ-393 %txt /tests/golden/types-partial-dependency-chain/types/txt
1227+/* src-394 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1228+/* tok-394 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1229+/* tre-394 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1230+/* typ-394 %txt /tests/golden/types-partial-explicit-capital/types/txt
1231+/* src-395 %jibb /tests/golden/types-partial-forward/source/jibb
1232+/* tok-395 %txt /tests/golden/types-partial-forward/tokens/txt
1233+/* tre-395 %txt /tests/golden/types-partial-forward/tree/txt
1234+/* typ-395 %txt /tests/golden/types-partial-forward/types/txt
1235+/* src-396 %jibb /tests/golden/types-partial-generalization/source/jibb
1236+/* tok-396 %txt /tests/golden/types-partial-generalization/tokens/txt
1237+/* tre-396 %txt /tests/golden/types-partial-generalization/tree/txt
1238+/* typ-396 %txt /tests/golden/types-partial-generalization/types/txt
1239+/* src-397 %jibb /tests/golden/types-partial-identity/source/jibb
1240+/* tok-397 %txt /tests/golden/types-partial-identity/tokens/txt
1241+/* tre-397 %txt /tests/golden/types-partial-identity/tree/txt
1242+/* typ-397 %txt /tests/golden/types-partial-identity/types/txt
1243+/* src-398 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1244+/* tok-398 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1245+/* tre-398 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1246+/* typ-398 %txt /tests/golden/types-partial-independent-atoms/types/txt
1247+/* src-399 %jibb /tests/golden/types-partial-many-atom-constraints/source/jibb
1248+/* tok-399 %txt /tests/golden/types-partial-many-atom-constraints/tokens/txt
1249+/* tre-399 %txt /tests/golden/types-partial-many-atom-constraints/tree/txt
1250+/* typ-399 %txt /tests/golden/types-partial-many-atom-constraints/types/txt
1251+/* src-400 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1252+/* tok-400 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1253+/* tre-400 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1254+/* typ-400 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1255+/* src-401 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1256+/* tok-401 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1257+/* tre-401 %txt /tests/golden/types-partial-mold-composite/tree/txt
1258+/* typ-401 %txt /tests/golden/types-partial-mold-composite/types/txt
1259+/* src-402 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1260+/* tok-402 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1261+/* tre-402 %txt /tests/golden/types-partial-mold-forward/tree/txt
1262+/* typ-402 %txt /tests/golden/types-partial-mold-forward/types/txt
1263+/* src-403 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1264+/* tok-403 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1265+/* tre-403 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1266+/* typ-403 %txt /tests/golden/types-partial-mold-recursive/types/txt
1267+/* src-404 %jibb /tests/golden/types-partial-occurs/source/jibb
1268+/* tok-404 %txt /tests/golden/types-partial-occurs/tokens/txt
1269+/* tre-404 %txt /tests/golden/types-partial-occurs/tree/txt
1270+/* typ-404 %txt /tests/golden/types-partial-occurs/types/txt
1271+/* src-405 %jibb /tests/golden/types-partial-projection/source/jibb
1272+/* tok-405 %txt /tests/golden/types-partial-projection/tokens/txt
1273+/* tre-405 %txt /tests/golden/types-partial-projection/tree/txt
1274+/* typ-405 %txt /tests/golden/types-partial-projection/types/txt
1275+/* src-406 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1276+/* tok-406 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1277+/* tre-406 %txt /tests/golden/types-partial-shadow-global/tree/txt
1278+/* typ-406 %txt /tests/golden/types-partial-shadow-global/types/txt
1279+/* src-407 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1280+/* tok-407 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1281+/* tre-407 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1282+/* typ-407 %txt /tests/golden/types-partial-shared-tvar/types/txt
1283+/* src-408 %jibb /tests/golden/types-partial-union-cases/source/jibb
1284+/* tok-408 %txt /tests/golden/types-partial-union-cases/tokens/txt
1285+/* tre-408 %txt /tests/golden/types-partial-union-cases/tree/txt
1286+/* typ-408 %txt /tests/golden/types-partial-union-cases/types/txt
1287+/* src-409 %jibb /tests/golden/types-partial-union-edges/source/jibb
1288+/* tok-409 %txt /tests/golden/types-partial-union-edges/tokens/txt
1289+/* tre-409 %txt /tests/golden/types-partial-union-edges/tree/txt
1290+/* typ-409 %txt /tests/golden/types-partial-union-edges/types/txt
1291+/* src-410 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1292+/* tok-410 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1293+/* tre-410 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1294+/* typ-410 %txt /tests/golden/types-partial-unresolved-tag/types/txt
12771295|%
12781296:: one arm per case
12791297::
@@ -2035,60 +2053,68 @@
20352053 (weld (check ~.prelude-list-helpers src-378 `tok-378 `tre-378) (check-types ~.prelude-list-helpers ~[%tests %golden ~.prelude-list-helpers %source %jibb] src-378 `typ-378))
20362054++ test-prelude-list-unit
20372055 (weld (check ~.prelude-list-unit src-379 `tok-379 `tre-379) (check-types ~.prelude-list-unit ~[%tests %golden ~.prelude-list-unit %source %jibb] src-379 `typ-379))
2056+++ test-prelude-unit-list-transforms
2057+ (weld (check ~.prelude-unit-list-transforms src-380 `tok-380 `tre-380) (check-types ~.prelude-unit-list-transforms ~[%tests %golden ~.prelude-unit-list-transforms %source %jibb] src-380 `typ-380))
2058+++ test-types-import-mark
2059+ (weld (check ~.types-import-mark src-381 `tok-381 `tre-381) (check-mark-types ~.types-import-mark ~[%tests %golden ~.types-import-mark %source %jibb] src-381 `typ-381 ~[[%fixture %title imp-381-1]] ~[[%label mark-381-1]]))
20382060++ test-types-import-sur
2039− (weld (check ~.types-import-sur src-380 `tok-380 `tre-380) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-380 `typ-380 ~[[%fixture %title imp-380-1] [%fixture %pair imp-380-2]]))
2061+ (weld (check ~.types-import-sur src-382 `tok-382 `tre-382) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-382 `typ-382 ~[[%fixture %title imp-382-1] [%fixture %pair imp-382-2]]))
20402062++ test-types-partial-apply
2041− (weld (check ~.types-partial-apply src-381 `tok-381 `tre-381) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-381 `typ-381))
2063+ (weld (check ~.types-partial-apply src-383 `tok-383 `tre-383) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-383 `typ-383))
2064+++ test-types-partial-atom-alias
2065+ (weld (check ~.types-partial-atom-alias src-384 `tok-384 `tre-384) (check-types ~.types-partial-atom-alias ~[%tests %golden ~.types-partial-atom-alias %source %jibb] src-384 `typ-384))
20422066++ test-types-partial-atom-constraint
2043− (weld (check ~.types-partial-atom-constraint src-382 `tok-382 `tre-382) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-382 `typ-382))
2067+ (weld (check ~.types-partial-atom-constraint src-385 `tok-385 `tre-385) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-385 `typ-385))
20442068++ test-types-partial-atom-widening
2045− (weld (check ~.types-partial-atom-widening src-383 `tok-383 `tre-383) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-383 `typ-383))
2069+ (weld (check ~.types-partial-atom-widening src-386 `tok-386 `tre-386) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-386 `typ-386))
20462070++ test-types-partial-aura
2047− (weld (check ~.types-partial-aura src-384 `tok-384 `tre-384) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-384 `typ-384))
2071+ (weld (check ~.types-partial-aura src-387 `tok-387 `tre-387) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-387 `typ-387))
20482072++ test-types-partial-aura-family
2049− (weld (check ~.types-partial-aura-family src-385 `tok-385 `tre-385) (check-types ~.types-partial-aura-family ~[%tests %golden ~.types-partial-aura-family %source %jibb] src-385 `typ-385))
2073+ (weld (check ~.types-partial-aura-family src-388 `tok-388 `tre-388) (check-types ~.types-partial-aura-family ~[%tests %golden ~.types-partial-aura-family %source %jibb] src-388 `typ-388))
20502074++ test-types-partial-aura-generalization
2051− (weld (check ~.types-partial-aura-generalization src-386 `tok-386 `tre-386) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-386 `typ-386))
2075+ (weld (check ~.types-partial-aura-generalization src-389 `tok-389 `tre-389) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-389 `typ-389))
20522076++ test-types-partial-bare-atom
2053− (weld (check ~.types-partial-bare-atom src-387 `tok-387 `tre-387) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-387 `typ-387))
2077+ (weld (check ~.types-partial-bare-atom src-390 `tok-390 `tre-390) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-390 `typ-390))
2078+++ test-types-partial-branch-widening
2079+ (weld (check ~.types-partial-branch-widening src-391 `tok-391 `tre-391) (check-types ~.types-partial-branch-widening ~[%tests %golden ~.types-partial-branch-widening %source %jibb] src-391 `typ-391))
20542080++ test-types-partial-conflicting-sites
2055− (weld (check ~.types-partial-conflicting-sites src-388 `tok-388 `tre-388) (check-types ~.types-partial-conflicting-sites ~[%tests %golden ~.types-partial-conflicting-sites %source %jibb] src-388 `typ-388))
2081+ (weld (check ~.types-partial-conflicting-sites src-392 `tok-392 `tre-392) (check-types ~.types-partial-conflicting-sites ~[%tests %golden ~.types-partial-conflicting-sites %source %jibb] src-392 `typ-392))
20562082++ test-types-partial-dependency-chain
2057− (weld (check ~.types-partial-dependency-chain src-389 `tok-389 `tre-389) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-389 `typ-389))
2083+ (weld (check ~.types-partial-dependency-chain src-393 `tok-393 `tre-393) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-393 `typ-393))
20582084++ test-types-partial-explicit-capital
2059− (weld (check ~.types-partial-explicit-capital src-390 `tok-390 `tre-390) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-390 `typ-390))
2085+ (weld (check ~.types-partial-explicit-capital src-394 `tok-394 `tre-394) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-394 `typ-394))
20602086++ test-types-partial-forward
2061− (weld (check ~.types-partial-forward src-391 `tok-391 `tre-391) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-391 `typ-391))
2087+ (weld (check ~.types-partial-forward src-395 `tok-395 `tre-395) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-395 `typ-395))
20622088++ test-types-partial-generalization
2063− (weld (check ~.types-partial-generalization src-392 `tok-392 `tre-392) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-392 `typ-392))
2089+ (weld (check ~.types-partial-generalization src-396 `tok-396 `tre-396) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-396 `typ-396))
20642090++ test-types-partial-identity
2065− (weld (check ~.types-partial-identity src-393 `tok-393 `tre-393) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-393 `typ-393))
2091+ (weld (check ~.types-partial-identity src-397 `tok-397 `tre-397) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-397 `typ-397))
20662092++ test-types-partial-independent-atoms
2067− (weld (check ~.types-partial-independent-atoms src-394 `tok-394 `tre-394) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-394 `typ-394))
2093+ (weld (check ~.types-partial-independent-atoms src-398 `tok-398 `tre-398) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-398 `typ-398))
20682094++ test-types-partial-many-atom-constraints
2069− (weld (check ~.types-partial-many-atom-constraints src-395 `tok-395 `tre-395) (check-types ~.types-partial-many-atom-constraints ~[%tests %golden ~.types-partial-many-atom-constraints %source %jibb] src-395 `typ-395))
2095+ (weld (check ~.types-partial-many-atom-constraints src-399 `tok-399 `tre-399) (check-types ~.types-partial-many-atom-constraints ~[%tests %golden ~.types-partial-many-atom-constraints %source %jibb] src-399 `typ-399))
20702096++ test-types-partial-mold-bare-aura
2071− (weld (check ~.types-partial-mold-bare-aura src-396 `tok-396 `tre-396) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-396 `typ-396))
2097+ (weld (check ~.types-partial-mold-bare-aura src-400 `tok-400 `tre-400) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-400 `typ-400))
20722098++ test-types-partial-mold-composite
2073− (weld (check ~.types-partial-mold-composite src-397 `tok-397 `tre-397) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-397 `typ-397))
2099+ (weld (check ~.types-partial-mold-composite src-401 `tok-401 `tre-401) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-401 `typ-401))
20742100++ test-types-partial-mold-forward
2075− (weld (check ~.types-partial-mold-forward src-398 `tok-398 `tre-398) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-398 `typ-398))
2101+ (weld (check ~.types-partial-mold-forward src-402 `tok-402 `tre-402) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-402 `typ-402))
20762102++ test-types-partial-mold-recursive
2077− (weld (check ~.types-partial-mold-recursive src-399 `tok-399 `tre-399) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-399 `typ-399))
2103+ (weld (check ~.types-partial-mold-recursive src-403 `tok-403 `tre-403) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-403 `typ-403))
20782104++ test-types-partial-occurs
2079− (weld (check ~.types-partial-occurs src-400 `tok-400 `tre-400) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-400 `typ-400))
2105+ (weld (check ~.types-partial-occurs src-404 `tok-404 `tre-404) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-404 `typ-404))
20802106++ test-types-partial-projection
2081− (weld (check ~.types-partial-projection src-401 `tok-401 `tre-401) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-401 `typ-401))
2107+ (weld (check ~.types-partial-projection src-405 `tok-405 `tre-405) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-405 `typ-405))
20822108++ test-types-partial-shadow-global
2083− (weld (check ~.types-partial-shadow-global src-402 `tok-402 `tre-402) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-402 `typ-402))
2109+ (weld (check ~.types-partial-shadow-global src-406 `tok-406 `tre-406) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-406 `typ-406))
20842110++ test-types-partial-shared-tvar
2085− (weld (check ~.types-partial-shared-tvar src-403 `tok-403 `tre-403) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-403 `typ-403))
2111+ (weld (check ~.types-partial-shared-tvar src-407 `tok-407 `tre-407) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-407 `typ-407))
20862112++ test-types-partial-union-cases
2087− (weld (check ~.types-partial-union-cases src-404 `tok-404 `tre-404) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-404 `typ-404))
2113+ (weld (check ~.types-partial-union-cases src-408 `tok-408 `tre-408) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-408 `typ-408))
20882114++ test-types-partial-union-edges
2089− (weld (check ~.types-partial-union-edges src-405 `tok-405 `tre-405) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-405 `typ-405))
2115+ (weld (check ~.types-partial-union-edges src-409 `tok-409 `tre-409) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-409 `typ-409))
20902116++ test-types-partial-unresolved-tag
2091− (weld (check ~.types-partial-unresolved-tag src-406 `tok-406 `tre-406) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-406 `typ-406))
2117+ (weld (check ~.types-partial-unresolved-tag src-410 `tok-410 `tre-410) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-410 `typ-410))
20922118::
20932119:: +check: run golden:jibb on a case and compare both outputs
20942120::
@@ -2163,4 +2189,24 @@
21632189 =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
21642190 [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
21652191 (compare (file case "types.txt") want (golden-types-imports:jibb at src external))
2192+::
2193+++ check-mark-types
2194+ |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
2195+ ^- tang
2196+ ?: |((lien fixtures |=(f=[module=term mold=term source=wain] ?=(~ source.f))) (lien marks |=(m=[name=term source=wain] ?=(~ source.m))))
2197+ ~[leaf+"an imported Hoon fixture is missing or empty"]
2198+ =/ external=(list [module=term name=term result=*])
2199+ %+ turn fixtures
2200+ |= fixture=[module=term mold=term source=wain]
2201+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2202+ =/ cor=type -:(ride -:!>(..zuse) text)
2203+ =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
2204+ [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
2205+ =/ mark-external=(list [name=term result=*])
2206+ %+ turn marks
2207+ |= fixture=[name=term source=wain]
2208+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2209+ =/ cor=type -:(ride -:!>(..zuse) text)
2210+ [name.fixture (read-mark:jibb-import name.fixture cor)]
2211+ (compare (file case "types.txt") want (golden-types-with-marks:jibb at src external mark-external))
21662212--
tests/type-mark/about.txtnew file+6
@@ -0,0 +1,6 @@
1+The partial checker may use a mark only when that mark is explicitly
2+imported with /%. The caller supplies mark results separately from /sur
3+results. This report tests a supported aura, a supplied but undeclared mark,
4+a same-named /sur import, a local mold collision, a failed importer result,
5+duplicate supplied results, and an unsupported faced payload. Only the first
6+resolves; every report states that the module has not been checked.
tests/type-mark/collision.txtnew file+3
@@ -0,0 +1,3 @@
1+/% %label
2++$ label @ud
3+++ identity |= x=label x
tests/type-mark/declared.txtnew file+2
@@ -0,0 +1,2 @@
1+/% %label
2+++ identity |= x=label x
tests/type-mark/expected.txtnew file+15
@@ -0,0 +1,15 @@
1+partial inference; module not checked
2+++ identity: $-(@t @t)
3+partial inference; module not checked
4+++ identity: sample mold is not supported by partial inference
5+partial inference; module not checked
6+++ identity: sample mold is not supported by partial inference
7+partial inference; module not checked
8++$ label: not checked
9+++ identity: sample mold is not supported by partial inference
10+partial inference; module not checked
11+++ identity: sample mold is not supported by partial inference
12+partial inference; module not checked
13+++ identity: sample mold is not supported by partial inference
14+partial inference; module not checked
15+++ identity: sample mold is not supported by partial inference
tests/type-mark/missing.txtnew file+1
@@ -0,0 +1 @@
1+++ identity |= x=label x
tests/type-mark/sur.txtnew file+2
@@ -0,0 +1,2 @@
1+/- label
2+++ identity |= x=label x
tools/clay-fixtures+39
@@ -89,3 +89,42 @@ if result.stdout != expected:
8989 print('actual: ', result.stdout.decode().rstrip(), file=sys.stderr)
9090 sys.exit(1)
9191print('Clay Ford importer golden passed')
92+
93+try:
94+ result = subprocess.run([str(ship), 'run', str(fixtures / 'mark-shape.txt')],
95+ stdout=subprocess.PIPE, check=True)
96+except subprocess.CalledProcessError as error:
97+ sys.exit(error.returncode)
98+expected = (fixtures / 'mark-shape-expected.txt').read_bytes()
99+if result.stdout != expected:
100+ print('Clay mark subject differs from tests/clay-fixtures/mark-shape-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 mark subject golden passed')
105+
106+try:
107+ result = subprocess.run([str(ship), 'run', str(fixtures / 'mark-import.txt')],
108+ stdout=subprocess.PIPE, check=True)
109+except subprocess.CalledProcessError as error:
110+ sys.exit(error.returncode)
111+expected = (fixtures / 'mark-import-expected.txt').read_bytes()
112+if result.stdout != expected:
113+ print('Clay mark import differs from tests/clay-fixtures/mark-import-expected.txt', file=sys.stderr)
114+ print('expected:', expected.decode().rstrip(), file=sys.stderr)
115+ print('actual: ', result.stdout.decode().rstrip(), file=sys.stderr)
116+ sys.exit(1)
117+print('Clay mark importer golden passed')
118+
119+try:
120+ result = subprocess.run([str(ship), 'run', str(fixtures / 'mark-bridge.txt')],
121+ stdout=subprocess.PIPE, check=True)
122+except subprocess.CalledProcessError as error:
123+ sys.exit(error.returncode)
124+expected = (fixtures / 'mark-bridge-expected.txt').read_bytes()
125+if result.stdout != expected:
126+ print('Clay mark bridge differs from tests/clay-fixtures/mark-bridge-expected.txt', file=sys.stderr)
127+ print('expected:', expected.decode().rstrip(), file=sys.stderr)
128+ print('actual: ', result.stdout.decode().rstrip(), file=sys.stderr)
129+ sys.exit(1)
130+print('Clay mark importer/checker bridge golden passed')
tools/golden+25−5
@@ -55,7 +55,7 @@ HARNESS = r""":: The harness tools/golden writes after the library. It runs
5555 ==
5656::
5757++ run
58− |= [name=@t metadata=[logical=(unit path) check=? imports=(list [module=term mold=term source=@t])] src=@t]
58+ |= [name=@t metadata=[logical=(unit path) check=? imports=(list [module=term mold=term source=@t]) marks=(list [name=term source=@t])] src=@t]
5959 ^- @t
6060 =/ at=path ?~(logical.metadata (file name) u.logical.metadata)
6161 =/ res (mule |.([(golden:lib at src) {types-expr}]))
@@ -101,6 +101,14 @@ IMPORT_HELPER = r"""
101101 =/ cor=type -:(ride -:!>(..zuse) source.fixture)
102102 =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
103103 [module.fixture mold.fixture (read-mold-in:reader module.fixture mold.fixture typ cor)]
104+::
105+++ import-marks
106+ |= fixtures=(list [name=term source=@t])
107+ ^- (list [name=term result=*])
108+ %+ turn fixtures
109+ |= fixture=[name=term source=@t]
110+ =/ cor=type -:(ride -:!>(..zuse) source.fixture)
111+ [name.fixture (read-mark:reader name.fixture cor)]
104112"""
105113
106114
@@ -121,6 +129,7 @@ class Case:
121129 try:
122130 self.logical_path = golden_case.source_path(folder)
123131 self.imports = golden_case.sur_imports(folder)
132+ self.marks = golden_case.mark_imports(folder)
124133 except ValueError as e:
125134 raise ue.ToolError(str(e))
126135 self.want_types = golden_case.wants_types(folder)
@@ -163,10 +172,17 @@ def run_lines(case):
163172 source = '(rap 3 `(list @t)`~[%s])' % ' '.join(ue.cord_literal(p) for p in parts)
164173 fixtures.append('[%%%s %%%s %s]' % (module, mold, source))
165174 imports = '~[' + ' '.join(fixtures) + ']' if fixtures else '~'
166− out = [' %%^ run %s [%s %s %s]' % (
175+ fixtures = []
176+ for name, path in case.marks:
177+ with open(path, 'rb') as f:
178+ parts = ue.cord_pieces(f.read())
179+ source = '(rap 3 `(list @t)`~[%s])' % ' '.join(ue.cord_literal(p) for p in parts)
180+ fixtures.append('[%%%s %s]' % (name, source))
181+ marks = '~[' + ' '.join(fixtures) + ']' if fixtures else '~'
182+ out = [' %%^ run %s [%s %s %s %s]' % (
167183 ue.cord_literal(case.name.encode()),
168184 '`' + case.logical_path if case.logical_path else '~',
169− '%.y' if case.want_types else '%.n', imports),
185+ '%.y' if case.want_types else '%.n', imports, marks),
170186 ' %- text',
171187 ' :~ ' + ue.cord_literal(lines[0])]
172188 out += [' ' + ue.cord_literal(line) for line in lines[1:]]
@@ -177,14 +193,18 @@ def run_lines(case):
177193def golden_program(lib_path, cases):
178194 prog = ue.library_program(lib_path)
179195 runs = '\n'.join(line for case in cases for line in run_lines(case))
180− imported = any(c.imports for c in cases)
196+ imported = any(c.imports or c.marks for c in cases)
197+ has_marks = any(c.marks for c in cases)
181198 harness = HARNESS
182199 if imported:
183200 reader = ue.read_text(os.path.join(ue.ROOT, 'jibb-dev', 'lib', 'jibb-import.hoon'))
184201 harness = harness.replace('=> [lib=. ..zuse]',
185202 '=/ jibb-lib .\n=/ reader\n' + reader +
186203 '\n=> [lib=jibb-lib reader=reader ..zuse]')
187− types_expr = ("?:(check.metadata ?~(imports.metadata (golden-types:lib at src) "
204+ types_expr = ("?:(check.metadata (golden-types-with-marks:lib at src "
205+ "(import-types imports.metadata) (import-marks marks.metadata)) '')"
206+ if has_marks else
207+ "?:(check.metadata ?~(imports.metadata (golden-types:lib at src) "
188208 "(golden-types-imports:lib at src (import-types imports.metadata))) '')"
189209 if imported else "?:(check.metadata (golden-types:lib at src) '')")
190210 prog.add(harness.replace('{count}', str(len(cases)))
tools/golden_case.py+28
@@ -67,3 +67,31 @@ def sur_imports(folder):
6767 if out and not wants_types(folder):
6868 raise ValueError('%s: imported molds require a types output' % filename)
6969 return out
70+
71+
72+def mark_imports(folder):
73+ """Selected mark names and plain-text Hoon source fixtures, in file order."""
74+ filename = os.path.join(folder, 'marks.txt')
75+ try:
76+ with open(filename, encoding='utf-8') as f:
77+ lines = list(f)
78+ except FileNotFoundError:
79+ return []
80+ except UnicodeError:
81+ raise ValueError('%s: marks must be UTF-8' % filename)
82+ out, seen = [], set()
83+ for number, line in enumerate(lines, 1):
84+ parts = line.split()
85+ if len(parts) != 1 or not TERM.fullmatch(parts[0]):
86+ raise ValueError('%s:%d: expected a mark name' % (filename, number))
87+ mark = parts[0]
88+ if mark in seen:
89+ raise ValueError('%s:%d: duplicate imported mark' % (filename, number))
90+ fixture = os.path.join(folder, 'mar', mark + '.txt')
91+ if not os.path.isfile(fixture):
92+ raise ValueError('%s:%d: no fixture at %s' % (filename, number, fixture))
93+ seen.add(mark)
94+ out.append((mark, fixture))
95+ if out and not wants_types(folder):
96+ raise ValueError('%s: imported marks require a types output' % filename)
97+ return out
tools/importer-test+6−2
@@ -15,7 +15,11 @@ command = [str(root / 'tools' / 'hoon'), '--lib', str(root / 'jibb-dev' / 'lib'
1515 '--cord', 'shadow=' + str(fixture / 'shadow.txt'),
1616 '--cord', 'shadow-static=' + str(fixture / 'shadow-static.txt'),
1717 '--cord', 'ford=' + str(fixture / 'ford.txt'),
18− '(fixture-output small epic presence docs shadow shadow-static ford)']
18+ '--cord', 'mark=' + str(fixture / 'mark.txt'),
19+ '--cord', 'mark-rec=' + str(fixture / 'mark-recursive.txt'),
20+ '--cord', 'mark-gate=' + str(fixture / 'mark-gate.txt'),
21+ '--cord', 'mark-basic=' + str(fixture / 'mark-list.txt'),
22+ '(fixture-output small epic presence docs shadow shadow-static ford mark mark-rec mark-gate mark-basic)']
1923result = subprocess.run(command, stdout=subprocess.PIPE)
2024if result.returncode:
2125 sys.exit(result.returncode)
@@ -27,4 +31,4 @@ if result.stdout != expected:
2731 result.stdout.decode().splitlines(keepends=True),
2832 fromfile='expected tree.txt', tofile='actual types'))
2933 sys.exit(1)
30−print('importer golden: 57 projections passed')
34+print('importer golden: 68 projections passed')
tools/ship+43−2
@@ -1053,9 +1053,13 @@ def arm_names(names):
10531053def generate_tests(golden):
10541054 cases = golden_cases(golden)
10551055 has_imports = False
1056+ has_marks = False
10561057 for _, folder in cases:
10571058 try:
1058− has_imports |= bool(golden_case.sur_imports(folder))
1059+ sur = golden_case.sur_imports(folder)
1060+ marks = golden_case.mark_imports(folder)
1061+ has_imports |= bool(sur or marks)
1062+ has_marks |= bool(marks)
10591063 except ValueError as e:
10601064 raise Unable(str(e))
10611065 lines = [fill(TESTS_HEADER, SOURCE=show(golden)).rstrip('\n'),
@@ -1070,6 +1074,7 @@ def generate_tests(golden):
10701074 try:
10711075 logical = golden_case.source_path(folder)
10721076 imports = golden_case.sur_imports(folder)
1077+ marks = golden_case.mark_imports(folder)
10731078 except ValueError as e:
10741079 raise Unable(str(e))
10751080 args = ['~.%s' % name]
@@ -1091,7 +1096,21 @@ def generate_tests(golden):
10911096 else:
10921097 expected_types = '~'
10931098 path = logical or '~[%%tests %%golden ~.%s %%source %%jibb]' % name
1094− if imports:
1099+ if marks:
1100+ fixtures = []
1101+ for j, (module, mold, _) in enumerate(imports, 1):
1102+ face = 'imp-%d-%d' % (i, j)
1103+ lines.append('/* %s %%txt %s/sur/%s/txt' % (face, base, module))
1104+ fixtures.append('[%%%s %%%s %s]' % (module, mold, face))
1105+ mark_fixtures = []
1106+ for j, (mark, _) in enumerate(marks, 1):
1107+ face = 'mark-%d-%d' % (i, j)
1108+ lines.append('/* %s %%txt %s/mar/%s/txt' % (face, base, mark))
1109+ mark_fixtures.append('[%%%s %s]' % (mark, face))
1110+ call = '(weld %s (check-mark-types ~.%s %s src-%d %s ~[%s] ~[%s]))' % (
1111+ call, name, path, i, expected_types, ' '.join(fixtures),
1112+ ' '.join(mark_fixtures))
1113+ elif imports:
10951114 fixtures = []
10961115 for j, (module, mold, _) in enumerate(imports, 1):
10971116 face = 'imp-%d-%d' % (i, j)
@@ -1131,6 +1150,28 @@ def generate_tests(golden):
11311150 =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
11321151 [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
11331152 (compare (file case "types.txt") want (golden-types-imports:jibb at src external))
1153+'''
1154+ if has_marks:
1155+ types_helper += '''::
1156+++ check-mark-types
1157+ |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
1158+ ^- tang
1159+ ?: |((lien fixtures |=(f=[module=term mold=term source=wain] ?=(~ source.f))) (lien marks |=(m=[name=term source=wain] ?=(~ source.m))))
1160+ ~[leaf+"an imported Hoon fixture is missing or empty"]
1161+ =/ external=(list [module=term name=term result=*])
1162+ %+ turn fixtures
1163+ |= fixture=[module=term mold=term source=wain]
1164+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1165+ =/ cor=type -:(ride -:!>(..zuse) text)
1166+ =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
1167+ [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
1168+ =/ mark-external=(list [name=term result=*])
1169+ %+ turn marks
1170+ |= fixture=[name=term source=wain]
1171+ =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1172+ =/ cor=type -:(ride -:!>(..zuse) text)
1173+ [name.fixture (read-mark:jibb-import name.fixture cor)]
1174+ (compare (file case "types.txt") want (golden-types-with-marks:jibb at src external mark-external))
11341175'''
11351176 return '\n'.join(lines) + '\n' + TESTS_HELPERS.replace('\n--\n', '\n' + types_helper + '--\n')
11361177
tools/testdata/selftest+13
@@ -184,6 +184,19 @@ def check_types_and_logical_path(c, tmp):
184184 status, out = golden('--dir', cases, '--lib', STUB, '--case', 'basic')
185185 c.expect(status == 2 and 'duplicate imported mold' in out,
186186 'duplicate imported mold: ' + out)
187+ os.remove(os.path.join(folder, 'imports.txt'))
188+ with open(os.path.join(folder, 'marks.txt'), 'w') as f:
189+ f.write('missing\n')
190+ status, out = golden('--dir', cases, '--lib', STUB, '--case', 'basic')
191+ c.expect(status == 2 and 'no fixture' in out, 'missing mark fixture: ' + out)
192+ os.makedirs(os.path.join(folder, 'mar'))
193+ with open(os.path.join(folder, 'mar', 'missing.txt'), 'w') as f:
194+ f.write('|_ a=@t\n--\n')
195+ with open(os.path.join(folder, 'marks.txt'), 'w') as f:
196+ f.write('missing\nmissing\n')
197+ status, out = golden('--dir', cases, '--lib', STUB, '--case', 'basic')
198+ c.expect(status == 2 and 'duplicate imported mark' in out,
199+ 'duplicate imported mark: ' + out)
187200
188201
189202def check_mismatch_diff(c, tmp):
tools/testdata/ship-selftest+20
@@ -167,6 +167,26 @@ def generator_checks(tmp):
167167 '/tests/golden/molds/sur/fixture/txt' in out and
168168 '[%fixture %title imp-1-1]' in out and
169169 '(golden-types-imports:jibb at src external)' in out, out)
170+ os.makedirs(os.path.join(folder, 'mar'))
171+ with open(os.path.join(folder, 'mar', 'label.txt'), 'w') as f:
172+ f.write('|_ a=@t\n--\n')
173+ with open(os.path.join(folder, 'marks.txt'), 'w') as f:
174+ f.write('label\n')
175+ out = ship.generate_tests(imported)
176+ check('Hoon marks and molds are supplied together on the ship',
177+ '/tests/golden/molds/mar/label/txt' in out and
178+ '[%label mark-1-1]' in out and '[%fixture %title imp-1-1]' in out and
179+ '(golden-types-with-marks:jibb at src external mark-external)' in out, out)
180+ with open(os.path.join(folder, 'marks.txt'), 'a') as f:
181+ f.write('label\n')
182+ try:
183+ ship.generate_tests(imported)
184+ except ship.Unable as e:
185+ duplicate_mark = 'duplicate imported mark' in str(e)
186+ else:
187+ duplicate_mark = False
188+ check('duplicate imported marks are rejected', duplicate_mark)
189+ os.remove(os.path.join(folder, 'marks.txt'))
170190 with open(os.path.join(folder, 'imports.txt'), 'a') as f:
171191 f.write('fixture title\n')
172192 try:
tools/type-mark-testnew file+35
@@ -0,0 +1,35 @@
1+#!/usr/bin/env python3
2+"""Compare the mark/checker bridge fixture under urbit eval."""
3+
4+from pathlib import Path
5+import difflib
6+import subprocess
7+import sys
8+import tempfile
9+
10+root = Path(__file__).resolve().parent.parent
11+fixture = root / 'tests' / 'type-mark'
12+tests = (root / 'tests/lib/jibb-mark-bridge.hoon').read_text()
13+tests = tests[tests.index('\n|%\n') + 1:]
14+expression = ('=/ jibb .\n' +
15+ ''.join('=/ ' + n + '=wain (to-wain:format ' + n + '-text)\n'
16+ for n in ('declared', 'missing', 'sur', 'collision', 'expected')) +
17+ '=/ bridge\n' + tests +
18+ '\n(bridge-output:bridge declared-text missing-text sur-text collision-text)\n')
19+with tempfile.TemporaryDirectory(prefix='jibb-type-mark-') as tmp:
20+ program = Path(tmp) / 'bridge.hoon'
21+ program.write_text(expression)
22+ command = [str(root / 'tools/hoon'), '--raw', '-f', str(program)]
23+ for name in ('declared', 'missing', 'sur', 'collision', 'expected'):
24+ command += ['--cord', name + '-text=' + str(fixture / (name + '.txt'))]
25+ result = subprocess.run(command, stdout=subprocess.PIPE)
26+if result.returncode:
27+ sys.exit(result.returncode)
28+expected = (fixture / 'expected.txt').read_bytes()
29+if result.stdout != expected:
30+ sys.stderr.writelines(difflib.unified_diff(
31+ expected.decode().splitlines(keepends=True),
32+ result.stdout.decode().splitlines(keepends=True),
33+ fromfile='expected.txt', tofile='actual types'))
34+ sys.exit(1)
35+print('mark/checker bridge golden passed')