Execute /& in scaffolds

This commit is contained in:
Elliot Glaysher 2018-05-23 15:56:28 -07:00
parent 5764293dae
commit 1e111d9fad
2 changed files with 111 additions and 1 deletions

View File

@ -96,6 +96,7 @@
test-core-fscm
test-plan-fsbc
test-core-fscb
test-core-fspm
test-bunt
test-volt
test-vale
@ -4537,7 +4538,6 @@
++ test-core-fszp-as-mark
:- `tank`leaf+"test-core-fszp-as-mark"
::
::
=/ ford *ford-gate
::
=/ hoon-src-type=type [%atom %$ ~]
@ -4911,6 +4911,86 @@
(expect-ford-empty ford ~nul)
==
::
++ test-core-fspm
:- `tank`leaf+"test-core-fspm"
::
=/ ford *ford-gate
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /&second&first&/~["four" 5 "six"]
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/first/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [word=tape num=@]
++ grab
|%
++ noun |=([a=tape b=@ c=tape] [a b])
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/second/mar]]
:- %hoon
:- hoon-src-type
'''
|_ num=@
++ grab
|%
++ first |=([a=tape b=@] b)
--
--
'''
==
::
=^ results1 ford
%- test-ford-call-with-comparator :*
ford
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
:* duct=~[/path] type=~ %make ~nul
%pin ~1234.5.6
%core [[~nul %home] /hoon/program/gen]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %pin *] i.moves)
=/ result result.p.card.i.moves
=/ pin-result build-result.result
?> ?=([%success %core *] build-result.pin-result)
::
=/ =vase vase.build-result.pin-result
::
%+ weld
%- expect-eq !>
:- 5
q.vase
::
%- expect-eq !>
:- &
(~(nest ut p.vase) | -:!>(5))
==
::
;: weld
results1
(expect-ford-empty ford ~nul)
==
::
++ test-bunt
:- `tank`leaf+"test-bunt"
::

View File

@ -3488,6 +3488,7 @@
%fsbr (run-fsbr +.crane)
%fsts (run-fsts +.crane)
%fscm (run-fscm +.crane)
%fspm (run-fspm +.crane)
%fscb (run-fscb +.crane)
%fsdt (run-fsdt +.crane)
%fssm (run-fssm +.crane)
@ -3580,6 +3581,35 @@
$(cases t.cases)
::
(run-crane subject crane.i.cases)
:: +run-fspm: runs the `/&` rune
::
++ run-fspm
|= [marks=(list mark) sub-crane=^crane]
^- compose-cranes
::
=^ child ..run-crane (run-crane subject sub-crane)
?. ?=([%subject *] child)
[child ..run-crane]
::
=/ cast-build=^build
:- date.build
|-
^- schematic
?~ marks
:: TODO: If we were keeping track of the mark across runes, this
:: wouldn't have %noun here. This is case where it might matter.
::
[%$ %noun subject.child]
[%cast disc.source-rail.scaffold i.marks $(marks t.marks)]
=^ cast-result accessed-builds (depend-on cast-build)
?~ cast-result
[[%block [cast-build]~] ..run-crane]
::
?: ?=([~ %error *] cast-result)
[[%error [leaf+"/& failed: " message.u.cast-result]] ..run-crane]
?> ?=([~ %success %cast *] cast-result)
::
[[%subject q.cage.u.cast-result] ..run-crane]
:: +run-fscb: runs the `/_` rune
::
++ run-fscb