Comments!

This commit is contained in:
Anton Dyudin 2014-10-09 15:57:24 -07:00 committed by Anton Dyudin
parent 95153f9c7c
commit ed51b6236a
2 changed files with 48 additions and 45 deletions

View File

@ -22,7 +22,7 @@
++ pour ++ pour
|= [ost=bone pax=path sih=*] |= [ost=bone pax=path sih=*]
=+ sih=;;(sign sih) =+ sih=;;(sign sih)
~& grep-por/[pax sih] ::~& grep-por/[pax sih]
?^ pax `+>.$ ?^ pax `+>.$
:_ +>.$ :_ +>.$
?- &2.sih ?- &2.sih

View File

@ -31,14 +31,14 @@
[%mess p=hapt q=ship r=cage] :: [%mess p=hapt q=ship r=cage] ::
[%meta p=vase] :: [%meta p=vase] ::
== == == :: == == == ::
++ mand ,[p=term q=(list twig)] :: ++ mand ,[p=term q=(list twig)] :: name and arguments
++ coma :: ++ coma ::
$% [%run p=(list mand) q=mand] :: pipe into $% [%run p=(list mand) q=mand] :: pipe into
[%end p=(each ,@u cord)] :: [%end p=(each ,@u cord)] :: kill pid/name
[%path p=path] :: [%path p=path] :: chdir
[%hoon p=twig] :: [%hoon p=twig] :: eval expression
[%var p=term q=twig] :: [%var p=term q=twig] :: set variable
[%rvar p=term] :: [%rvar p=term] :: unset variable
== :: == ::
++ sign :: ++ sign ::
$% $: %g :: $% $: %g ::
@ -56,17 +56,17 @@
:: ::
|% |%
++ maybe |*(fel=_rule (cook |*(a=(unit) (fall a ~)) (opts fel))) ++ maybe |*(fel=_rule (cook |*(a=(unit) (fall a ~)) (opts fel)))
++ opts ++ opts :: parse unit
|* fel=_rule |* fel=_rule
;~ pose ;~ pose
(cook some fel) (cook some fel)
(easy ~) (easy ~)
== ==
:: ::
++ from ++ from :: parse door
=+ tol=`?(0 1 2)`%2 =+ tol=`?(0 1 2)`%2 :: wide, tallish, tall
|_ [pax=path lat=time] |_ [pax=path lat=time]
++ rail ++ rail :: build from wide/tall
|* [wid=_rule wif=_rule tal=_rule] |* [wid=_rule wif=_rule tal=_rule]
?~ tol wid ?~ tol wid
;~ pose wid ;~ pose wid
@ -74,26 +74,27 @@
;~(pose wif tal) ;~(pose wif tal)
== ==
:: ::
++ parse ++ parse :: top level
^- $+(nail (like coma)) ^- $+(nail (like coma))
=+ paf=pax =+ paf=pax
=. pax ?.(&(?=([@ @ @ *] pax) =('0' &3.pax)) pax pax(&3 (scot da/lat))) =. pax ?.(&(?=([@ @ @ *] pax) =('0' &3.pax)) pax pax(&3 (scot da/lat)))
;~ pose ;~ pose
(stag %run ;~(plug (star ;~(sfix (comd(tol %0) bar) ace)) (comd col))) (stag %run ;~(plug (star ;~(sfix (task(tol %0) bar) ace)) (task col)))
(stag %end ;~(pfix sem ;~(pose (stag %& dem) (stag %| sym)))) (stag %end ;~(pfix sem ;~(pose (stag %& dem) (stag %| sym))))
(stag %path (sear plex rood):(vang & paf)) (stag %path (sear plex rood):(vang & paf))
(stag %var ;~(plug ;~(pfix tis sym) ;~(pfix ace tall:(vang & pax)))) (stag %var ;~(plug ;~(pfix tis sym) ;~(pfix ace tall:(vang & pax))))
(stag %rvar ;~(pfix ;~(plug tis tis) sym)) (stag %rvar ;~(pfix ;~(plug tis tis) sym))
(stag %hoon tall:(vang & pax)) (stag %hoon tall:(vang & pax))
== ==
++ args ::
++ args :: task arguments
=+ wid=wide:(vang & pax) =+ wid=wide:(vang & pax)
%^ rail %^ rail
(ifix sel^ser (most ace wid)) (ifix sel^ser (most ace wid))
(plus ;~(pfix ace wid)) (plus ;~(pfix ace wid))
;~(sfix (plus ;~(pfix gap tall:(vang & pax))) ;~(plug gap duz)) ;~(sfix (plus ;~(pfix gap tall:(vang & pax))) ;~(plug gap duz))
:: ::
++ comd |*(fel=_rule ;~(pfix fel ;~(plug sym (maybe args)))) ++ task |*(fel=_rule ;~(pfix fel ;~(plug sym (maybe args))))
:: ::
-- --
-- --
@ -109,7 +110,7 @@
var=(map term vase) var=(map term vase)
== ==
:: ::
++ peer ++ peer :: handle subscription
|= [ost=bone you=ship pax=path] |= [ost=bone you=ship pax=path]
^- [(list move) _+>] ^- [(list move) _+>]
?~ pax `+>.$ ?~ pax `+>.$
@ -126,7 +127,7 @@
[ost %give %rush %term-line `term-line`[prompt ~ ~]]~ [ost %give %rush %term-line `term-line`[prompt ~ ~]]~
== ==
:: ::
++ cubs ++ cubs :: tasks with open /in
%- sort :_ |=([a=span b=span] (lth (slav %ud a) (slav %ud b))) %- sort :_ |=([a=span b=span] (lth (slav %ud a) (slav %ud b)))
^- (list span) ^- (list span)
%+ murn (~(tap by sup.hid)) %+ murn (~(tap by sup.hid))
@ -138,37 +139,39 @@
~ ~
(some i.t.a) (some i.t.a)
:: ::
++ poke-kyev ++ next-act :: rotate active task
|= [ost=bone you=ship key=kyev] =+ opt=[i=`(unit span)`~ t=(turn cubs |=(a=span `(unit span)`[~ a]))]
?> ?=([[%ctrl ~ ~] @t] key) |-
(poke-txt ost you (cat 3 '\\' q.key)) ?~ t.opt ~
?: =(act i.opt)
i.t.opt
$(opt t.opt)
:: ::
++ poke-txt ++ poke-kyev :: handle key event
|= [ost=bone you=ship txt=cord] |= [ost=bone you=ship key=kyev]
^- [(list move) _+>] ^- [(list move) _+>]
?: =('\\' (end 3 1 txt)) ?: ?=([~ @] key) (poke-txt ost you q.key) :: simple keypress
?+ (rsh 3 1 txt) ?> ?=([[%ctrl ~ ~] @t] key)
?+ q.key
:_ +>.$
:- [ost %give %nice ~]
(print ost you leaf/"no command \\{(trip q.key)}" ~)
%x =. act next-act
:_ +>.$ :_ +>.$
:- [ost %give %nice ~] :- [ost %give %nice ~]
(print ost you leaf/"no command {(trip txt)}" ~) (print ost you ~)
%x =. act %l =+ =- tak=rose/[" " "[" "]"]^(turn cubs -)
=+ ^= opt |= a=span
:- i=`(unit span)`~ leaf/(trip (rap 3 (~(got by cub.hid) a) '(' a ')' ~))
t=(turn cubs |=(a=span `(unit span)`[~ a])) [[[ost give/nice/~] (print ost you tak ~)] +>.$]
|- ==
?~ t.opt ~ ::
?: =(act i.opt) ++ poke-txt :: handle command
i.t.opt |= [ost=bone you=ship txt=cord]
$(opt t.opt) ^- [(list move) _+>]
:_ +>.$ ?: =('\\' (end 3 1 txt)) :: escaped ctrl-key
:- [ost %give %nice ~] (poke-kyev ost you [%ctrl ~ ~] (rsh 3 1 txt))
(print ost you ~) ?^ act :: pipe to child
%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 ~] :- [ost %give %nice ~]
(spam /in/[u.act] %rush %txt txt) (spam /in/[u.act] %rush %txt txt)