mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 05:22:27 +03:00
neo: minimum viable ford
This commit is contained in:
parent
6dc2e84628
commit
86e84ae8c7
0
pkg/arvo/lib/ford-eval.hoon
Normal file
0
pkg/arvo/lib/ford-eval.hoon
Normal file
0
pkg/arvo/lib/ford-hoon.hoon
Normal file
0
pkg/arvo/lib/ford-hoon.hoon
Normal file
25
pkg/arvo/lib/ford-parser.hoon
Normal file
25
pkg/arvo/lib/ford-parser.hoon
Normal file
@ -0,0 +1,25 @@
|
||||
|%
|
||||
++ run
|
||||
|= txt=@t
|
||||
(scan (trip txt) apex:rein)
|
||||
+$ file
|
||||
$: deps=(list path)
|
||||
=hoon
|
||||
==
|
||||
++ rein
|
||||
|%
|
||||
++ dep
|
||||
^- $-(nail (like path))
|
||||
(ifix [;~(plug fas lus gap) gay] stap)
|
||||
++ deps
|
||||
(star dep)
|
||||
++ hone
|
||||
=+ vaz=vast
|
||||
(ifix [gay gay] tall:vaz)
|
||||
++ apex
|
||||
:: ^- $-(nail (like file))
|
||||
:: ^- rule
|
||||
;~(plug deps hone)
|
||||
--
|
||||
--
|
||||
|
35
pkg/arvo/lib/ford-reef.hoon
Normal file
35
pkg/arvo/lib/ford-reef.hoon
Normal file
@ -0,0 +1,35 @@
|
||||
/- neo
|
||||
=>
|
||||
|%
|
||||
++ card card:neo
|
||||
++ reef ^~(!>(..zuse))
|
||||
--
|
||||
^- firm:neo
|
||||
|%
|
||||
+$ state [cache=(unit vase) ~]
|
||||
+$ poke ~
|
||||
++ kids ~
|
||||
++ deps ~
|
||||
++ form
|
||||
^- form:neo
|
||||
|_ [=bowl:neo case=@ud state-vase=vase *]
|
||||
+* sta !<(state state-vase)
|
||||
++ call
|
||||
|= [old-state=vase act=*]
|
||||
*(list card:neo)
|
||||
++ reduce
|
||||
|= pok=*
|
||||
^- vase
|
||||
state-vase
|
||||
++ init
|
||||
|= old=(unit vase)
|
||||
!>(`state`[`reef ~])
|
||||
++ born *(list card:neo)
|
||||
++ echo
|
||||
|= [=pith val=*]
|
||||
*(list card:neo)
|
||||
++ take
|
||||
|= =sign:neo
|
||||
*(list card:neo)
|
||||
--
|
||||
--
|
0
pkg/arvo/lib/ford-scry.hoon
Normal file
0
pkg/arvo/lib/ford-scry.hoon
Normal file
0
pkg/arvo/lib/ford-slap.hoon
Normal file
0
pkg/arvo/lib/ford-slap.hoon
Normal file
0
pkg/arvo/lib/ford.hoon
Normal file
0
pkg/arvo/lib/ford.hoon
Normal file
71
pkg/arvo/lib/nhoon.hoon
Normal file
71
pkg/arvo/lib/nhoon.hoon
Normal file
@ -0,0 +1,71 @@
|
||||
/- neo
|
||||
=>
|
||||
|%
|
||||
++ card card:neo
|
||||
++ get-sut
|
||||
|= =bowl:neo
|
||||
^- (unit vase)
|
||||
=+ !<([cac=(unit vase) *] q:(~(got by deps.bowl) %sut))
|
||||
cac
|
||||
++ build
|
||||
|= [=bowl:neo =hoon]
|
||||
^- (unit vase)
|
||||
?~ sut=(get-sut bowl)
|
||||
~
|
||||
`(slap u.sut hoon)
|
||||
|
||||
--
|
||||
^- firm:neo
|
||||
|%
|
||||
+$ state [cache=(unit vase) =hoon]
|
||||
+$ poke
|
||||
$% [%dep ~]
|
||||
[%hoon =hoon]
|
||||
==
|
||||
++ kids ~
|
||||
++ deps
|
||||
=< apex
|
||||
|%
|
||||
++ apex
|
||||
%- ~(gas by *deps:neo)
|
||||
:~ sut/sut
|
||||
==
|
||||
++ sut
|
||||
[& ,[cache=(unit vase) *] ,*]
|
||||
--
|
||||
++ form
|
||||
^- form:neo
|
||||
|_ [=bowl:neo case=@ud state-vase=vase *]
|
||||
+* sta !<(state state-vase)
|
||||
++ call
|
||||
|= [old-state=vase act=*]
|
||||
*(list card)
|
||||
++ reduce
|
||||
|= pok=*
|
||||
^- vase
|
||||
=+ ;;(=poke pok)
|
||||
=/ sta sta
|
||||
=? hoon.sta ?=(%hoon -.poke)
|
||||
hoon.poke
|
||||
=. cache.sta (build bowl hoon.sta)
|
||||
!>(sta)
|
||||
++ init
|
||||
|= vax=(unit vase)
|
||||
?~ vax !>(*state)
|
||||
=+ !<([cac=(unit vase) =hoon] u.vax)
|
||||
!>(`state`[~ hoon])
|
||||
++ born
|
||||
=- ~[-]
|
||||
[%neo were.bowl %poke %dep ~]
|
||||
++ echo
|
||||
|= [=pith val=*]
|
||||
*(list card:neo)
|
||||
++ take
|
||||
|= =sign:neo
|
||||
^- (list card:neo)
|
||||
?. ?=([%neo %conf %val @] sign)
|
||||
!!
|
||||
=- ~[-]
|
||||
[%neo were.bowl %poke %dep ~]
|
||||
--
|
||||
--
|
2
pkg/arvo/lib/parse-test.hoon
Normal file
2
pkg/arvo/lib/parse-test.hoon
Normal file
@ -0,0 +1,2 @@
|
||||
/+ /~met/sys/reef
|
||||
zuse
|
20
pkg/arvo/ted/ford-ingest.hoon
Normal file
20
pkg/arvo/ted/ford-ingest.hoon
Normal file
@ -0,0 +1,20 @@
|
||||
/- spider, neo
|
||||
/+ io=strandio, ford=ford-parser
|
||||
=, strand=strand:spider
|
||||
=< run
|
||||
|%
|
||||
++ poke-neo
|
||||
|= =note:neo
|
||||
(poke-our:io %neo noun+!>(note))
|
||||
++ run
|
||||
^- thread:spider
|
||||
|= =vase
|
||||
=/ m (strand ,vase)
|
||||
=+ !<([~ pax=(pole knot)] vase)
|
||||
=/ =beam (need (de-beam pax))
|
||||
;< =cage bind:m (read-file:io beam)
|
||||
?> ?=(%hoon p.cage)
|
||||
=+ !<(src=@t q.cage)
|
||||
=/ =file:ford (scan (trip src) apex:rein:ford)
|
||||
=* loop $
|
||||
;< ~ bind:m (poke-neo
|
@ -50,8 +50,13 @@
|
||||
=/ result=(each ^vase tang)
|
||||
(mule |.(q:(need (need (on-peek:ag /x/dbug/state)))))
|
||||
?:(?=(%& -.result) p.result on-save:ag)
|
||||
=/ prelude=^vase
|
||||
=/ bek
|
||||
/(scot %p our.bowl)/[q.byk.bowl]/(scot %da now.bowl)
|
||||
=+ .^(=open:clay %cs (welp bek /open/foo))
|
||||
(fall (mole |.((open /app/[dap.bowl]/hoon))) !>(..zuse))
|
||||
%+ slap
|
||||
(slop state !>([bowl=bowl ..zuse]))
|
||||
:(slop state !>(bowl=bowl) prelude)
|
||||
(ream grab.dbug)
|
||||
::
|
||||
%incoming
|
||||
|
Loading…
Reference in New Issue
Block a user