mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-17 11:51:32 +03:00
329 lines
9.9 KiB
Plaintext
329 lines
9.9 KiB
Plaintext
:: Shell
|
|
::
|
|
:::: /hook/core/shell/app
|
|
::
|
|
/? 314
|
|
/- term-line
|
|
/= seeb /~ !>(.)
|
|
::
|
|
:::: structures
|
|
::
|
|
|% ::
|
|
++ gift ::
|
|
$% [%rush p=gilt] ::
|
|
[%mean p=ares] ::
|
|
[%nice ~] ::
|
|
[%meta p=vase] ::
|
|
[%veer p=@ta q=path r=@t] ::
|
|
[%vega p=path] ::
|
|
== ::
|
|
++ gilt ::
|
|
$% [%term-line p=term-line] ::
|
|
[%txt p=cord] ::
|
|
== ::
|
|
++ hapt ,[p=ship q=path] ::
|
|
++ move ,[p=bone q=(mold note gift)] ::
|
|
++ note ::
|
|
$% $: %g ::
|
|
$% [%cide p=span] ::
|
|
[%show p=hapt q=ship r=path] ::
|
|
[%sire p=term q=span] ::
|
|
[%mess p=hapt q=ship r=cage] ::
|
|
[%meta p=vase] ::
|
|
== == == ::
|
|
++ mand ,[p=term q=(list twig)] ::
|
|
++ coma ::
|
|
$% [%start p=term q=(list twig)] ::
|
|
[%end p=(each ,@u cord)] ::
|
|
[%path p=path] ::
|
|
[%hoon p=twig] ::
|
|
[%var p=term q=twig] ::
|
|
[%rvar p=term] ::
|
|
[%pipe p=(list mand)] ::
|
|
== ::
|
|
++ sign ::
|
|
$% $: %g ::
|
|
$% [%gone p=hapt] ::
|
|
[%mean p=ares] ::
|
|
[%nice ~] ::
|
|
[%rush p=mark q=*] ::
|
|
[%rust p=mark q=*] ::
|
|
[%veer p=@ta q=path r=@t] ::
|
|
[%vega p=path] ::
|
|
== == == ::
|
|
--
|
|
!:
|
|
:::: program
|
|
::
|
|
|_ $: hid=hide
|
|
pid=@u
|
|
pax=_`path`/=try=
|
|
act=(unit span)
|
|
pip=(map span span)
|
|
pop=(map span span)
|
|
var=(map term vase)
|
|
==
|
|
++ maybe
|
|
|* fel=_rule
|
|
;~ pose
|
|
fel
|
|
(easy ~)
|
|
==
|
|
::
|
|
++ args
|
|
;~(pfix ace (more ace wide:(vang & pax)))
|
|
::
|
|
++ pipe
|
|
;~ pfix bar
|
|
%+ more
|
|
;~(plug ace bar)
|
|
;~(plug ;~(pfix col sym) (ifix [sel ser] args))
|
|
==
|
|
::
|
|
++ parse
|
|
^- $+(nail (like coma))
|
|
=+ paf=?.(=('0' &3.pax) pax pax(&3 (scot da/lat.hid)))
|
|
;~ pose
|
|
(stag %start ;~(pfix col ;~(plug sym (maybe args(pax paf)))))
|
|
(stag %end ;~(pfix sem ;~(pose (stag %& dem) (stag %| sym))))
|
|
(stag %path (sear plex rood):(vang & pax))
|
|
(stag %pipe pipe(pax paf))
|
|
(stag %var ;~(plug ;~(pfix tis sym) ;~(pfix ace tall:(vang & paf))))
|
|
(stag %rvar ;~(pfix ;~(plug tis tis) sym))
|
|
(stag %hoon tall:(vang & paf))
|
|
==
|
|
::
|
|
++ peer
|
|
|= [ost=bone you=ship pax=path]
|
|
^- [(list move) _+>]
|
|
?~ pax `+>.$
|
|
?+ i.pax `+>.$
|
|
%in :: to app
|
|
?~ t.pax `+>.$
|
|
?. (~(has by cub.hid) i.t.pax) `+>.$
|
|
?: (~(has by pop) i.t.pax) `+>.$
|
|
:_ +>.$(act `i.t.pax)
|
|
(print ost you ~)
|
|
%out :: to terminal
|
|
?> ?=(~ t.pax)
|
|
:_ +>.$
|
|
[ost %give %rush %term-line `term-line`[prompt ~ ~]]~
|
|
==
|
|
::
|
|
++ cubs
|
|
%- sort :_ |=([a=span b=span] (lth (slav %ud a) (slav %ud b)))
|
|
^- (list span)
|
|
%+ murn (~(tap by sup.hid))
|
|
|= [@ @ a=path]
|
|
?. ?=([%in cord ~] a) ~
|
|
?. (~(has by cub.hid) i.t.a) ~
|
|
(some i.t.a)
|
|
::
|
|
++ poke-txt
|
|
|= [ost=bone you=ship txt=cord]
|
|
^- [(list move) _+>]
|
|
?: =('\\' (end 3 1 txt))
|
|
?+ (rsh 3 1 txt)
|
|
:_ +>.$
|
|
:- [ost %give %nice ~]
|
|
(print ost you leaf/"no command {(trip txt)}" ~)
|
|
%x =. act
|
|
=+ ^= opt
|
|
:- i=`(unit span)`~
|
|
t=(turn cubs |=(a=span `(unit span)`[~ a]))
|
|
|-
|
|
?~ t.opt ~
|
|
?: =(act i.opt)
|
|
i.t.opt
|
|
$(opt t.opt)
|
|
:_ +>.$
|
|
:- [ost %give %nice ~]
|
|
(print ost you ~)
|
|
%l =+ =- tak=rose/[" " "[" "]"]^(turn cubs -)
|
|
|= a=span
|
|
leaf/(trip (rap 3 (~(got by cub.hid) a) '(' a ')' ~))
|
|
[[[ost give/nice/~] (print ost you tak ~)] +>.$]
|
|
==
|
|
?^ act
|
|
:_ +>.$
|
|
:- [ost %give %nice ~]
|
|
(spam /in/[u.act] %rush %txt txt)
|
|
::
|
|
=- :_ con
|
|
%+ welp (stash ost you txt)
|
|
?~ tak
|
|
mof
|
|
%+ welp
|
|
(print ost you tak ~)
|
|
[[ost %give %nice ~] mof]
|
|
^- [con=_+>.$ tak=$|(~ tank) mof=(list move)]
|
|
=+ com=(rush txt parse)
|
|
?~ com
|
|
[+>.$ leaf/"Clarify {(trip txt)}" ~]
|
|
?- -.u.com
|
|
%path
|
|
=. pax p.u.com
|
|
[+>.$ leaf/"=% {(spud p.u.com)}" ~]
|
|
::
|
|
%start
|
|
=+ cil=(scot %ud pid)
|
|
=. pid +(pid)
|
|
:- +>.$ :- ~
|
|
:* :^ ost %pass /child/[cil]/main
|
|
:+ %g %meta !>
|
|
:* %mess [our.hid cil imp.hid] you
|
|
(cat 3 p.u.com '-args') (run [%clsg q.u.com])
|
|
==
|
|
[ost %pass /child/[cil]/out %g %show [our.hid cil imp.hid] you /out]
|
|
[ost %pass /child/[cil] %g %sire p.u.com cil] :: XX strange order?
|
|
(print ost you leaf/"+ :{(trip p.u.com)}" ~)
|
|
==
|
|
::
|
|
%end
|
|
?: ?=(%& -.p.u.com)
|
|
=+ cil=(scot %ud p.p.u.com)
|
|
=+ cin=(trip (~(got by cub.hid) cil))
|
|
:- +>.$ :- ~
|
|
:_ (print ost you leaf/"- :{cin}({(trip cil)})" ~)
|
|
[ost %pass /child/[cil] %g %cide cil]
|
|
=* cil p.p.u.com
|
|
=- [+>.$ leaf/"-{<(lent moz)>} :{(trip cil)}" moz]
|
|
^= moz
|
|
%+ murn (~(tap by cub.hid)) |= [a=span b=term]
|
|
?. =(b cil) ~
|
|
%- some
|
|
[ost %pass /child/[a] %g %cide a]
|
|
::
|
|
%pipe
|
|
~& [%pipsqueak <p.u.com>]
|
|
=+ ^= por
|
|
%+ roll
|
|
|- ^- (list ,[p=mand q=(unit mand)])
|
|
?~ p.u.com ~
|
|
:- [i.p.u.com ?~(t.p.u.com ~ `i.t.p.u.com)]
|
|
$(p.u.com t.p.u.com)
|
|
=< .(pid ^pid, pip ^pip, pop ^pop)
|
|
|= $: [p=mand q=(unit mand)]
|
|
mov=(list move)
|
|
pid=@u
|
|
pip=(map span span)
|
|
pop=(map span span)
|
|
==
|
|
^- [(list move) @u (map span span) (map span span)]
|
|
=+ cia=(scot %ud pid)
|
|
=+ cib=(scot %ud +(pid))
|
|
=. pid +(pid)
|
|
=. pip ?~(q pip (~(put by pip) cia cib))
|
|
=. pop ?~(q pop (~(put by pop) cib cia))
|
|
:_ [pid pip pop]
|
|
:^ ^- move
|
|
:^ ost %pass /child/[cia]/main
|
|
:+ %g %meta !>
|
|
:* %mess [our.hid cia imp.hid] you
|
|
(cat 3 p.p '-args') (run [%clsg q.p])
|
|
==
|
|
^- move
|
|
[ost %pass /child/[cia]/out %g %show [our.hid cia imp.hid] you /out]
|
|
^- move
|
|
[ost %pass /child/[cia] %g %sire p.p cia]
|
|
^- (list move)
|
|
mov
|
|
=. pid pid.por
|
|
=. pip pip.por
|
|
=. pop pop.por
|
|
:- +>.$ :- ~
|
|
%+ welp
|
|
mov.por
|
|
:- [ost %give %nice ~]
|
|
(print ost you leaf/"piping {<p.u.com>}" ~)
|
|
::
|
|
%var
|
|
=. var (~(put by var) p.u.com (run q.u.com))
|
|
[+>.$ leaf/"created variable '{(trip p.u.com)}'" ~]
|
|
::
|
|
%rvar
|
|
=. var (~(del by var) p.u.com)
|
|
[+>.$ leaf/"deleted variable '{(trip p.u.com)}'" ~]
|
|
::
|
|
%hoon
|
|
[+>.$ (sell (run p.u.com)) ~]
|
|
==
|
|
::
|
|
++ purr
|
|
|= [ost=bone pax=path typ=type sih=sign]
|
|
^- [(list move) _+>]
|
|
::~& shel-purr/pax
|
|
:: ~& [%shell-pour -.sih (,@ta +<.sih)]
|
|
::=+ sih=((hard sign) sih)
|
|
?: ?=(%veer +<.sih) :: vomit
|
|
[[ost %give +.sih]~ +>.$]
|
|
?: ?=(%vega +<.sih) :: vomit
|
|
[[ost %give +.sih]~ +>.$]
|
|
?~ pax ~& %no-path !!
|
|
?+ &1.pax ~& %strange-path !!
|
|
%print
|
|
`+>.$
|
|
::
|
|
%child
|
|
?~ |1.pax ~& %no-child !!
|
|
?~ |2.pax
|
|
?> ?=(%gone +<.sih)
|
|
:- [ost %give %nice ~]~
|
|
+>.$(act ?:(=(act [~ &2.pax]) ~ act))
|
|
:_ +>.$
|
|
?+ &3.pax ~& %strange-child-path !!
|
|
%main
|
|
?> ?=(?(%nice %mean) +<.sih)
|
|
:- [ost %give +.sih]
|
|
::~& act
|
|
(print ost our.hid ~)
|
|
%out
|
|
?. ?=(?(%rust %rush) +<.sih) ~
|
|
?: (~(has by pip) &2.pax)
|
|
~& [%yay &2.pax <pip> <pop>]
|
|
(spam /in/(~(got by pip) &2.pax) %meta (slot 3 typ sih))
|
|
~& [%nay &2.pax <pip> <pop>]
|
|
%^ print-vase ost our.hid
|
|
?+ p.sih
|
|
!>([(sell (slot 15 [typ sih]))]~)
|
|
%tang
|
|
(slot 15 [typ sih])
|
|
==
|
|
== ==
|
|
::
|
|
++ stash
|
|
|= [a=bone b=ship c=cord]
|
|
%^ spam /out %meta
|
|
!>([%rush %term-line `term-line`[prompt [c]~ ~]])
|
|
::
|
|
++ print |=([a=bone b=ship c=(list tank)] (print-vase a b !>(c)))
|
|
++ print-vase
|
|
|= [ost=bone you=ship tan=vase] :: [p=p:!>(*(list tank)) q=*]
|
|
^- (list move)
|
|
::~& shel-print/prompt
|
|
%^ spam /out %meta
|
|
:(slop !>(%rush) !>(%term-line) !>(prompt) !>(~) tan)
|
|
::
|
|
++ prompt
|
|
^- @t
|
|
?^ act
|
|
(rap 3 (~(got by cub.hid) u.act) '(' u.act ') ' ~)
|
|
?. =('0' &3.pax)
|
|
(spat pax)
|
|
(rap 3 '/' &1.pax '/' &2.pax '=' ?~(|3.pax ~ [(spat |3.pax)]~))
|
|
++ run
|
|
|= gen=twig
|
|
%- slap :_ gen
|
|
%+ roll (~(tap by var))
|
|
=< .(q seeb)
|
|
|= [[n=term v=vase] q=vase]
|
|
(slop [[%face n p.v] q.v] q)
|
|
::
|
|
++ spam
|
|
|= [pax=path gip=gift]
|
|
^- (list move)
|
|
%+ turn
|
|
(~(tap in (~(get ju pus.hid) pax)))
|
|
|=(a=bone [a %give gip])
|
|
--
|