mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 13:55:54 +03:00
cabclean cleaned up, except for some %talk stuff.
This commit is contained in:
parent
05bbab743d
commit
cb89113986
475
ape/talk.hoon
475
ape/talk.hoon
@ -10,11 +10,11 @@
|
||||
::
|
||||
[. talk sole]
|
||||
=> |% :: data structures
|
||||
++ house ,[%5 house-5] :: full state
|
||||
++ house {$5 house-5} :: full state
|
||||
++ house-any :: app history
|
||||
$% [%3 house-3] :: 3: talk
|
||||
[%4 house-4] :: 4: talk
|
||||
[%5 house-5] :: 5: talk
|
||||
_% {$3 house-3} :: 3: talk
|
||||
{$4 house-4} :: 4: talk
|
||||
{$5 house-5} :: 5: talk
|
||||
== ::
|
||||
++ house-3 ::
|
||||
%+ cork house-4 |= house-4 :: modern house with
|
||||
@ -23,93 +23,93 @@
|
||||
%+ cork house-5 |= house-5 :: modern house with
|
||||
+<(shells (~(run by shells) shell-4)) :: no settings
|
||||
++ house-5 ::
|
||||
$: stories=(map span story) :: conversations
|
||||
general=(set bone) :: meta-subscribe
|
||||
outbox=(pair ,@ud (map ,@ud thought)) :: urbit outbox
|
||||
folks=(map ship human) :: human identities
|
||||
shells=(map bone shell) :: interaction state
|
||||
log=(map span ,@ud) :: logged to clay
|
||||
nik=(map (set partner) char) :: bound station glyphs
|
||||
nak=(jug char (set partner)) :: station glyph lookup
|
||||
_: stories+(map span story) :: conversations
|
||||
general+(set bone) :: meta-subscribe
|
||||
outbox+(pair @ud (map @ud thought)) :: urbit outbox
|
||||
folks+(map ship human) :: human identities
|
||||
shells+(map bone shell) :: interaction state
|
||||
log+(map span @ud) :: logged to clay
|
||||
nik+(map (set partner) char) :: bound station glyphs
|
||||
nak+(jug char (set partner)) :: station glyph lookup
|
||||
== ::
|
||||
++ story-3 (cork story |=(story +<(|10 &11.+<))) :: missing glyphers
|
||||
++ story :: wire content
|
||||
$: count=@ud :: (lent grams)
|
||||
grams=(list telegram) :: all history
|
||||
locals=(map ship (pair ,@da status)) :: local presence
|
||||
remotes=(map partner atlas) :: remote presence
|
||||
mirrors=(map station config) :: remote config
|
||||
sequence=(map partner ,@ud) :: partners heard
|
||||
shape=config :: configuration
|
||||
known=(map serial ,@ud) :: messages heard
|
||||
gramsers=(map bone river) :: message followers
|
||||
groupers=(set bone) :: presence followers
|
||||
cabalers=(set bone) :: config followers
|
||||
glyphers=(set bone) :: glyph followers
|
||||
_: count+@ud :: (lent grams)
|
||||
grams+(list telegram) :: all history
|
||||
locals+(map ship (pair @da status)) :: local presence
|
||||
remotes+(map partner atlas) :: remote presence
|
||||
mirrors+(map station config) :: remote config
|
||||
sequence+(map partner @ud) :: partners heard
|
||||
shape+config :: configuration
|
||||
known+(map serial @ud) :: messages heard
|
||||
gramsers+(map bone river) :: message followers
|
||||
groupers+(set bone) :: presence followers
|
||||
cabalers+(set bone) :: config followers
|
||||
glyphers+(set bone) :: glyph followers
|
||||
== ::
|
||||
++ shell :: console session
|
||||
$: her=ship :: client identity
|
||||
man=span :: mailbox
|
||||
count=@ud :: messages shown
|
||||
say=sole-share :: console state
|
||||
active=(unit (set partner)) :: active targets
|
||||
passive=(set partner) :: passive targets
|
||||
owners=register :: presence mirror
|
||||
harbor=(map span (pair posture cord)) :: stations mirror
|
||||
system=cabal :: config mirror
|
||||
settings=(set span) :: frontend settings
|
||||
_: her+ship :: client identity
|
||||
man+span :: mailbox
|
||||
count+@ud :: messages shown
|
||||
say+sole-share :: console state
|
||||
active+(unit (set partner)) :: active targets
|
||||
passive+(set partner) :: passive targets
|
||||
owners+register :: presence mirror
|
||||
harbor+(map span (pair posture cord)) :: stations mirror
|
||||
system+cabal :: config mirror
|
||||
settings+(set span) :: frontend settings
|
||||
== ::
|
||||
++ shell-4 (cork shell |=(shell +<(|8 &9.+<))) :: missing settings
|
||||
++ river (pair point point) :: stream definition
|
||||
++ point :: stream endpoint
|
||||
$% [%ud p=@ud] :: by number
|
||||
[%da p=@da] :: by date
|
||||
_% {$ud p+@ud} :: by number
|
||||
{$da p+@da} :: by date
|
||||
== ::
|
||||
++ move (pair bone card) :: all actions
|
||||
++ lime :: diff fruit
|
||||
$% [%talk-report report] ::
|
||||
[%sole-effect sole-effect] ::
|
||||
_% {$talk-report report} ::
|
||||
{$sole-effect sole-effect} ::
|
||||
== ::
|
||||
++ pear :: poke fruit
|
||||
$% [%talk-command command] ::
|
||||
_% {$talk-command command} ::
|
||||
== ::
|
||||
++ card :: general card
|
||||
$% [%diff lime] ::
|
||||
[%info wire @p @tas nori] ::
|
||||
[%peer wire dock path] ::
|
||||
[%poke wire dock pear] ::
|
||||
[%pull wire dock ~] ::
|
||||
[%quit ~] ::
|
||||
_% {$diff lime} ::
|
||||
{$info wire @p @tas nori} ::
|
||||
{$peer wire dock path} ::
|
||||
{$poke wire dock pear} ::
|
||||
{$pull wire dock ~} ::
|
||||
{$quit $~} ::
|
||||
== ::
|
||||
++ weir :: parsed wire
|
||||
$% [%repeat p=@ud q=@p r=span] ::
|
||||
[%friend p=span q=station] ::
|
||||
_% {$repeat p+@ud q+@p r+span} ::
|
||||
{$friend p+span q+station} ::
|
||||
== ::
|
||||
++ work :: interface action
|
||||
$% [%number p=$|(@ud [@u @ud])] :: relative/absolute
|
||||
[%help ~] :: print usage info
|
||||
[%who p=where] :: presence
|
||||
[%what p=$|(char (set partner))] :: show bound glyph
|
||||
[%bind p=char q=(unit where)] ::
|
||||
[%join p=where] ::
|
||||
[%leave p=where] ::
|
||||
[%say p=(list speech)] ::
|
||||
[%eval p=cord q=twig] ::
|
||||
[%invite p=span q=(list partner)] :: whitelist add
|
||||
[%banish p=span q=(list partner)] :: blacklist add
|
||||
[%block p=span q=(list partner)] :: blacklist add
|
||||
[%author p=span q=(list partner)] :: whitelist add
|
||||
[%nick p=(unit ship) q=(unit cord)] ::
|
||||
[%set p=span] ::
|
||||
[%unset p=span] ::
|
||||
[%target p=where q=(unit work)] :: set active targets
|
||||
:: [%destroy p=span] ::
|
||||
[%create p=posture q=span r=cord] ::
|
||||
[%probe p=station] ::
|
||||
_% {$number p+$|(@ud {@u @ud})} :: relative/absolute
|
||||
{$help ~} :: print usage info
|
||||
{$who p+where} :: presence
|
||||
{$what p+$|(char (set partner))} :: show bound glyph
|
||||
{$bind p+char q+(unit where)} ::
|
||||
{$join p+where} ::
|
||||
{$leave p+where} ::
|
||||
{$say p+(list speech)} ::
|
||||
{$eval p+cord q+twig} ::
|
||||
{$invite p+span q+(list partner)} :: whitelist add
|
||||
{$banish p+span q+(list partner)} :: blacklist add
|
||||
{$block p+span q+(list partner)} :: blacklist add
|
||||
{$author p+span q+(list partner)} :: whitelist add
|
||||
{$nick p+(unit ship) q+(unit cord)} ::
|
||||
{$set p+span} ::
|
||||
{$unset p+span} ::
|
||||
{$target p+where q+(unit work)} :: set active targets
|
||||
:: {$destroy p+span} ::
|
||||
{$create p+posture q+span r+cord} ::
|
||||
{$probe p+station} ::
|
||||
== ::
|
||||
++ where (set partner) :: non-empty audience
|
||||
++ sigh :: assemble label
|
||||
|= [len=@ud pre=tape yiz=cord]
|
||||
|= {len+@ud pre+tape yiz+cord}
|
||||
^- tape
|
||||
=+ nez=(trip yiz)
|
||||
=+ lez=(lent nez)
|
||||
@ -124,30 +124,31 @@
|
||||
--
|
||||
|_ [hid=bowl house]
|
||||
++ ra :: per transaction
|
||||
|_ moves=(list move)
|
||||
|_ moves+(list move)
|
||||
++ sh :: per console
|
||||
|_ $: coz=(list command) :: talk actions
|
||||
she=shell
|
||||
|_ $^
|
||||
_: coz+(list command) :: talk actions
|
||||
she+shell
|
||||
==
|
||||
++ sh-scad :: command parser
|
||||
=< work
|
||||
|%
|
||||
++ expr :: [cord twig]
|
||||
|= tub=nail %. tub
|
||||
|= tub+nail %. tub
|
||||
%+ stag (crip q.tub)
|
||||
wide:(vang & [&1:% &2:% (scot %da now.hid) |3:%])
|
||||
::
|
||||
++ dare :: @dr
|
||||
%+ sear
|
||||
|= a=coin
|
||||
?. ?=([%$ %dr @] a) ~
|
||||
|= a+coin
|
||||
?. ?=({$$ $dr @} a) ~
|
||||
(some `@dr`+>.a)
|
||||
nuck:so
|
||||
::
|
||||
++ ship ;~(pfix sig fed:ag) :: ship
|
||||
++ shiz :: ship set
|
||||
%+ cook
|
||||
|=(a=(list ^ship) (~(gas in *(set ^ship)) a))
|
||||
|=(a+(list ^ship) (~(gas in *(set ^ship)) a))
|
||||
(most ;~(plug com (star ace)) ship)
|
||||
::
|
||||
++ pasp :: passport
|
||||
@ -164,7 +165,7 @@
|
||||
;~(pfix fas (stag (sein our.hid) sym))
|
||||
::
|
||||
%+ cook
|
||||
|= [a=@p b=(unit term)]
|
||||
|= {a+@p b+(unit term)}
|
||||
[a ?^(b u.b (main a))]
|
||||
;~ plug
|
||||
ship
|
||||
@ -178,12 +179,12 @@
|
||||
(stag %| pasp)
|
||||
==
|
||||
++ partners-flat :: collapse mixed list
|
||||
|= a=(list (each partner (set partner)))
|
||||
|= a+(list (each partner (set partner)))
|
||||
^- (set partner)
|
||||
?~ a ~
|
||||
?- -.i.a
|
||||
%& (~(put in $(a t.a)) p.i.a)
|
||||
%| (~(uni in $(a t.a)) p.i.a)
|
||||
{$&} (~(put in $(a t.a)) p.i.a)
|
||||
{$|} (~(uni in $(a t.a)) p.i.a)
|
||||
==
|
||||
::
|
||||
++ para :: partners alias
|
||||
@ -288,23 +289,23 @@
|
||||
|= cod=command
|
||||
^+ +>
|
||||
?- -.cod
|
||||
%design
|
||||
$design
|
||||
?~ q.cod
|
||||
=. +>+>.$ (ra-config p.cod *config)
|
||||
+>.$(stories (~(del by stories) p.cod))
|
||||
+>(+> (ra-config p.cod u.q.cod))
|
||||
::
|
||||
%review +>(+> (ra-think | her.she +.cod))
|
||||
%publish +>(+> (ra-think & her.she +.cod))
|
||||
$review +>(+> (ra-think | her.she +.cod))
|
||||
$publish +>(+> (ra-think & her.she +.cod))
|
||||
==
|
||||
::
|
||||
++ sh-fact :: send console effect
|
||||
|= fec=sole-effect
|
||||
|= fec+sole-effect
|
||||
^+ +>
|
||||
+>(moves :_(moves [ost.hid %diff %sole-effect fec]))
|
||||
::
|
||||
++ sh-peep :: peer to path
|
||||
|= pax=path
|
||||
|= pax+path
|
||||
^+ +>
|
||||
+>(+> (ra-subscribe her.she pax))
|
||||
::
|
||||
@ -320,7 +321,7 @@
|
||||
%+ sh-fact %pro
|
||||
:+ & %talk-line
|
||||
^- tape
|
||||
=+ ^= rew ^- (pair (pair ,@t ,@t) (set partner))
|
||||
=+ ^= rew ^- (pair (pair @t @t) (set partner))
|
||||
?~ active.she
|
||||
[['(' ')'] passive.she]
|
||||
[['[' ']'] u.active.she]
|
||||
@ -331,19 +332,19 @@
|
||||
(weld `tape`[p.p.rew por] `tape`[q.p.rew ' ' ~])
|
||||
::
|
||||
++ sh-pact :: update active aud
|
||||
|= lix=(set partner)
|
||||
|= lix+(set partner)
|
||||
^+ +>
|
||||
=+ act=?~(lix ~ `(sh-pare lix))
|
||||
?: =(active.she act) +>.$
|
||||
sh-prod(active.she act)
|
||||
::
|
||||
++ sh-pare :: adjust target list
|
||||
|= paz=(set partner)
|
||||
|= paz+(set partner)
|
||||
?: (sh-pear paz) paz
|
||||
(~(put in paz) [%& our.hid man.she])
|
||||
::
|
||||
++ sh-pear :: hearback
|
||||
|= paz=(set partner)
|
||||
|= paz+(set partner)
|
||||
?~ paz |
|
||||
?| $(paz l.paz)
|
||||
$(paz r.paz)
|
||||
@ -351,13 +352,13 @@
|
||||
==
|
||||
::
|
||||
++ sh-pass :: passive from aud
|
||||
|= aud=audience
|
||||
|= aud+audience
|
||||
%- sh-poss
|
||||
%- ~(gas in *(set partner))
|
||||
(turn (~(tap by aud)) |=([a=partner *] a))
|
||||
::
|
||||
++ sh-poss :: passive update
|
||||
|= lix=(set partner)
|
||||
|= lix+(set partner)
|
||||
?^ buf.say.she
|
||||
+>.$
|
||||
=+ sap=(sh-pare lix)
|
||||
@ -366,33 +367,31 @@
|
||||
sh-prod(passive.she sap)
|
||||
::
|
||||
++ sh-pest :: report listen
|
||||
|= tay=partner
|
||||
|= tay+partner
|
||||
^+ +>
|
||||
?. ?=(%& -.tay) +>
|
||||
?. ?=($& -.tay) +>
|
||||
=+ sib=(~(get by ham.system.she) `station`p.tay)
|
||||
?. |(?=(~ sib) !?=(%white p.cordon.u.sib))
|
||||
?. |(?=($~ sib) !?=($white p.cordon.u.sib))
|
||||
+>.$
|
||||
(sh-poss [tay ~ ~])
|
||||
::
|
||||
++ sh-rend :: print on one line
|
||||
|= gam=telegram
|
||||
|= gam+telegram
|
||||
=+ lin=~(tr-line tr man.she (~(has in settings.she) %noob) gam)
|
||||
(sh-pass:(sh-fact %txt lin) q.q.gam)
|
||||
::
|
||||
++ sh-numb :: print msg number
|
||||
|= num=@ud
|
||||
|= num+@ud
|
||||
^+ +>
|
||||
=+ bun=(scow %ud num)
|
||||
:: =+ pad=(sub 36 (lent bun))
|
||||
:: =+ now=`@da`(dis now.hid 0xffff.ffff.ffff.ffff.0000.0000.0000.0000)
|
||||
%+ sh-fact %txt
|
||||
(runt [(sub 13 (lent bun)) '-'] "[{bun}]")
|
||||
::
|
||||
++ sh-glyf :: decode glyph
|
||||
|= cha=char ^- (unit (set partner))
|
||||
|= cha+char ^- (unit (set partner))
|
||||
=+ lax=(~(get ju nak) cha)
|
||||
?: =(~ lax) ~
|
||||
?: ?=([* ~ ~] lax) `n.lax
|
||||
?: ?=({* $~ $~} lax) `n.lax
|
||||
=+ grams=grams:(~(got by stories) man.she)
|
||||
|- ^- (unit (set partner))
|
||||
?~ grams ~
|
||||
@ -401,11 +400,11 @@
|
||||
$(grams t.grams)
|
||||
::
|
||||
++ sh-repo-house-diff
|
||||
|= [one=shelf two=shelf]
|
||||
=| $= ret
|
||||
$: old=(list (pair span (pair posture cord)))
|
||||
new=(list (pair span (pair posture cord)))
|
||||
cha=(list (pair span (pair posture cord)))
|
||||
|= {one+shelf two+shelf}
|
||||
=| _= ret
|
||||
_: old+(list (pair span (pair posture cord)))
|
||||
new+(list (pair span (pair posture cord)))
|
||||
cha+(list (pair span (pair posture cord)))
|
||||
==
|
||||
^+ ret
|
||||
=. ret
|
||||
@ -429,11 +428,11 @@
|
||||
ret
|
||||
::
|
||||
++ sh-repo-atlas-diff
|
||||
|= [one=atlas two=atlas]
|
||||
=| $= ret
|
||||
$: old=(list (pair ship status))
|
||||
new=(list (pair ship status))
|
||||
cha=(list (pair ship status))
|
||||
|= {one+atlas two+atlas}
|
||||
=| _= ret
|
||||
_: old+(list (pair ship status))
|
||||
new+(list (pair ship status))
|
||||
cha+(list (pair ship status))
|
||||
==
|
||||
^+ ret
|
||||
=. ret
|
||||
@ -457,11 +456,11 @@
|
||||
ret
|
||||
::
|
||||
++ sh-repo-cabal-diff
|
||||
|= [one=(map station config) two=(map station config)]
|
||||
=| $= ret
|
||||
$: old=(list (pair station config))
|
||||
new=(list (pair station config))
|
||||
cha=(list (pair station config))
|
||||
|= {one+(map station config) two+(map station config)}
|
||||
=| _= ret
|
||||
_: old+(list (pair station config))
|
||||
new+(list (pair station config))
|
||||
cha+(list (pair station config))
|
||||
==
|
||||
^+ ret
|
||||
=. ret
|
||||
@ -485,9 +484,9 @@
|
||||
ret
|
||||
::
|
||||
++ sh-repo-rogue-diff
|
||||
|= [one=(map partner atlas) two=(map partner atlas)]
|
||||
=| $= ret
|
||||
$: old=(list (pair partner atlas))
|
||||
|= {one+(map partner atlas) two+(map partner atlas)}
|
||||
=| _= ret
|
||||
_: old+(list (pair partner atlas))
|
||||
new=(list (pair partner atlas))
|
||||
cha=(list (pair partner atlas))
|
||||
==
|
||||
@ -513,10 +512,10 @@
|
||||
ret
|
||||
::
|
||||
++ sh-repo-whom-diff
|
||||
|= [one=(set partner) two=(set partner)]
|
||||
=| $= ret
|
||||
$: old=(list partner)
|
||||
new=(list partner)
|
||||
|= {one+(set partner) two+(set partner)}
|
||||
=| _= ret
|
||||
_: old+(list partner)
|
||||
new+(list partner)
|
||||
==
|
||||
^+ ret
|
||||
=. ret
|
||||
@ -538,10 +537,10 @@
|
||||
ret
|
||||
::
|
||||
++ sh-repo-ship-diff
|
||||
|= [one=(set ship) two=(set ship)]
|
||||
=| $= ret
|
||||
$: old=(list ship)
|
||||
new=(list ship)
|
||||
|= {one+(set ship) two+(set ship)}
|
||||
=| _= ret
|
||||
_: old+(list ship)
|
||||
new+(list ship)
|
||||
==
|
||||
^+ ret
|
||||
=. ret
|
||||
@ -563,18 +562,18 @@
|
||||
ret
|
||||
::
|
||||
++ sh-puss
|
||||
|= a=posture ^- tape
|
||||
|= a+posture ^- tape
|
||||
?- a
|
||||
%black "channel"
|
||||
%brown "mailbox"
|
||||
%white "village"
|
||||
%green "journal"
|
||||
$black "channel"
|
||||
$brown "mailbox"
|
||||
$white "village"
|
||||
$green "journal"
|
||||
==
|
||||
::
|
||||
++ sh-repo-config-exceptions
|
||||
|= [pre=tape por=posture old=(list ship) new=(list ship)]
|
||||
=+ out=?:(?=(?(%black %brown) por) "try " "cut ")
|
||||
=+ inn=?:(?=(?(%black %brown) por) "ban " "add ")
|
||||
|= {pre+tape por+posture old+(list ship) new+(list ship)}
|
||||
=+ out=?:(?=(?($black $brown) por) "try " "cut ")
|
||||
=+ inn=?:(?=(?($black $brown) por) "ban " "add ")
|
||||
=. +>.$
|
||||
|- ^+ +>.^$
|
||||
?~ old +>.^$
|
||||
@ -588,7 +587,7 @@
|
||||
+>.$
|
||||
::
|
||||
++ sh-repo-config-sources
|
||||
|= [pre=tape old=(list partner) new=(list partner)]
|
||||
|= {pre+tape old+(list partner) new+(list partner)}
|
||||
^+ +>
|
||||
=. +>.$
|
||||
|- ^+ +>.^$
|
||||
@ -603,7 +602,7 @@
|
||||
+>.$
|
||||
::
|
||||
++ sh-repo-config-show
|
||||
|= [pre=tape laz=config loc=config]
|
||||
|= {pre+tape laz+config loc+config}
|
||||
^+ +>
|
||||
=. +>.$
|
||||
?: =(caption.loc caption.laz) +>.$
|
||||
@ -624,10 +623,11 @@
|
||||
(sh-repo-ship-diff q.cordon.laz q.cordon.loc)
|
||||
::
|
||||
++ sh-repo-cabal-changes
|
||||
|= $: laz=(map station config)
|
||||
old=(list (pair station config))
|
||||
new=(list (pair station config))
|
||||
cha=(list (pair station config))
|
||||
|= $^
|
||||
_: laz+(map station config)
|
||||
old+(list (pair station config))
|
||||
new+(list (pair station config))
|
||||
cha+(list (pair station config))
|
||||
==
|
||||
=. +>.$
|
||||
|- ^+ +>.^$
|
||||
@ -647,7 +647,7 @@
|
||||
+>.$
|
||||
::
|
||||
++ sh-repo-cabal
|
||||
|= bal=cabal
|
||||
|= bal+cabal
|
||||
^+ +>
|
||||
=+ laz=system.she
|
||||
=. system.she bal
|
||||
@ -657,7 +657,7 @@
|
||||
(sh-repo-config-show "" loc.laz loc.bal)
|
||||
::
|
||||
++ sh-repo-house
|
||||
|= awl=(map span (pair posture cord))
|
||||
|= awl+(map span (pair posture cord))
|
||||
^+ +>
|
||||
=+ dif=(sh-repo-house-diff harbor.she awl)
|
||||
=. harbor.she awl
|
||||
@ -687,21 +687,22 @@
|
||||
+>.$
|
||||
::
|
||||
++ sh-note :: shell message
|
||||
|= txt=tape
|
||||
|= txt+tape
|
||||
^+ +>
|
||||
(sh-fact %txt (runt [14 '-'] `tape`['|' ' ' (scag 64 txt)]))
|
||||
::
|
||||
++ sh-spaz :: print status
|
||||
|= saz=status
|
||||
|= saz+status
|
||||
^- tape
|
||||
['%' (trip p.saz)]
|
||||
::
|
||||
++ sh-repo-group-diff-here :: print atlas diff
|
||||
|= $: pre=tape
|
||||
$= cul
|
||||
$: old=(list (pair ship status))
|
||||
new=(list (pair ship status))
|
||||
cha=(list (pair ship status))
|
||||
|= $^
|
||||
_: pre+tape
|
||||
_= cul
|
||||
_: old+(list (pair ship status))
|
||||
new+(list (pair ship status))
|
||||
cha+(list (pair ship status))
|
||||
==
|
||||
==
|
||||
=. +>.$
|
||||
@ -723,14 +724,14 @@
|
||||
+>.$
|
||||
::
|
||||
++ sh-repo-group-here :: update local
|
||||
|= loc=atlas
|
||||
|= loc+atlas
|
||||
^+ +>
|
||||
=+ cul=(sh-repo-atlas-diff p.owners.she loc)
|
||||
=. p.owners.she loc
|
||||
(sh-repo-group-diff-here "" cul)
|
||||
::
|
||||
++ sh-repo-group-there :: update foreign
|
||||
|= yid=(map partner atlas)
|
||||
|= yid+(map partner atlas)
|
||||
=+ day=(sh-repo-rogue-diff q.owners.she yid)
|
||||
=+ dun=q.owners.she
|
||||
=. q.owners.she yid
|
||||
@ -758,14 +759,14 @@
|
||||
+>.$
|
||||
::
|
||||
++ sh-repo-group
|
||||
|= ges=register
|
||||
|= ges+register
|
||||
^+ +>
|
||||
=. +> (sh-repo-group-here p.ges)
|
||||
=. +> (sh-repo-group-there q.ges)
|
||||
+>
|
||||
::
|
||||
++ sh-repo-gram
|
||||
|= [num=@ud gam=telegram]
|
||||
|= {num+@ud gam+telegram}
|
||||
^+ +>
|
||||
?: =(num count.she)
|
||||
=. +> ?:(=(0 (mod num 5)) (sh-numb num) +>)
|
||||
@ -776,13 +777,13 @@
|
||||
+>
|
||||
::
|
||||
++ sh-repo-grams :: apply telegrams
|
||||
|= [num=@ud gaz=(list telegram)]
|
||||
|= {num+@ud gaz+(list telegram)}
|
||||
^+ +>
|
||||
?~ gaz +>
|
||||
$(gaz t.gaz, num +(num), +> (sh-repo-gram num i.gaz))
|
||||
::
|
||||
++ sh-repo-glyph :: apply binding
|
||||
|= nac=(jug char (set partner))
|
||||
|= nac+(jug char (set partner))
|
||||
^+ +>
|
||||
%_ sh-prod
|
||||
nak nac
|
||||
@ -794,19 +795,19 @@
|
||||
==
|
||||
::
|
||||
++ sh-repo :: apply report
|
||||
|= rad=report
|
||||
|= rad+report
|
||||
^+ +>
|
||||
:: ~& [%sh-repo rad]
|
||||
?- -.rad
|
||||
%cabal (sh-repo-cabal +.rad)
|
||||
%grams (sh-repo-grams +.rad)
|
||||
%glyph (sh-repo-glyph +.rad) :: XX ever happens?
|
||||
%group (sh-repo-group +.rad)
|
||||
%house (sh-repo-house +.rad)
|
||||
$cabal (sh-repo-cabal +.rad)
|
||||
$grams (sh-repo-grams +.rad)
|
||||
$glyph (sh-repo-glyph +.rad) :: XX ever happens?
|
||||
$group (sh-repo-group +.rad)
|
||||
$house (sh-repo-house +.rad)
|
||||
==
|
||||
::
|
||||
++ sh-sane-chat :: sanitize chatter
|
||||
|= buf=(list ,@c)
|
||||
|= buf+(list @c)
|
||||
^- (list sole-edit)
|
||||
?~ buf ~
|
||||
=+ [inx=0 sap=0 con=0]
|
||||
@ -834,24 +835,24 @@
|
||||
--
|
||||
::
|
||||
++ sh-sane :: sanitize input
|
||||
|= [inv=sole-edit buf=(list ,@c)]
|
||||
|= {inv+sole-edit buf+(list @c)}
|
||||
^- (list sole-edit)
|
||||
=+ res=(rose (tufa buf) sh-scad)
|
||||
?: ?=(| -.res) [inv ~]
|
||||
?: ?=($| -.res) [inv ~]
|
||||
=+ wok=`(unit work)`p.res
|
||||
|- ^- (list sole-edit)
|
||||
?~ wok ~
|
||||
?+ -.u.wok ~
|
||||
%target $(wok q.u.wok)
|
||||
%say |- :: XX per line
|
||||
$target $(wok q.u.wok)
|
||||
$say |- :: XX per line
|
||||
?~ p.u.wok ~
|
||||
?: ?=(%lin -.i.p.u.wok)
|
||||
?: ?=($lin -.i.p.u.wok)
|
||||
(sh-sane-chat buf)
|
||||
$(p.u.wok t.p.u.wok)
|
||||
==
|
||||
::
|
||||
++ sh-slug :: edit to sanity
|
||||
|= lit=(list sole-edit)
|
||||
|= lit+(list sole-edit)
|
||||
^+ +>
|
||||
?~ lit +>
|
||||
=^ lic say.she
|
||||
@ -859,7 +860,7 @@
|
||||
(sh-fact [%mor [%det lic] ~])
|
||||
::
|
||||
++ sh-stir :: apply edit
|
||||
|= cal=sole-change
|
||||
|= cal+sole-change
|
||||
^+ +>
|
||||
=^ inv say.she (~(transceive sole say.she) cal)
|
||||
=+ lit=(sh-sane inv buf.say.she)
|
||||
@ -868,7 +869,7 @@
|
||||
(sh-slug lit)
|
||||
::
|
||||
++ sh-lame :: send error
|
||||
|= txt=tape
|
||||
|= txt+tape
|
||||
(sh-fact [%txt txt])
|
||||
::
|
||||
++ sh-whom :: current audience
|
||||
@ -878,43 +879,43 @@
|
||||
|=(a=partner [a *envelope %pending])
|
||||
::
|
||||
++ sh-tell :: add command
|
||||
|= cod=command
|
||||
|= cod+command
|
||||
%_(+> coz [cod coz])
|
||||
::
|
||||
++ sh-twig-head ^- vase :: eval data
|
||||
!>(`[our=@p now=@da eny=@uvI]`[our.hid now.hid (shas %eny eny.hid)])
|
||||
!>(`{our+@p now+@da eny+@uvI}`[our.hid now.hid (shas %eny eny.hid)])
|
||||
::
|
||||
++ sh-work :: do work
|
||||
|= job=work
|
||||
|= job+work
|
||||
^+ +>
|
||||
=+ roy=(~(got by stories) man.she)
|
||||
=< work
|
||||
|%
|
||||
++ work
|
||||
?- -.job
|
||||
%number (number +.job)
|
||||
%leave (leave +.job)
|
||||
%join (join +.job)
|
||||
%eval (eval +.job)
|
||||
%who (who +.job)
|
||||
%what (what +.job)
|
||||
%bind (bind +.job)
|
||||
%invite (invite +.job)
|
||||
%banish (banish +.job)
|
||||
%author (author +.job)
|
||||
%block (block +.job)
|
||||
%create (create +.job)
|
||||
%nick (nick +.job)
|
||||
%set (wo-set +.job)
|
||||
%unset (unset +.job)
|
||||
%target (target +.job)
|
||||
%probe (probe +.job)
|
||||
%help help
|
||||
%say (say +.job)
|
||||
$number (number +.job)
|
||||
$leave (leave +.job)
|
||||
$join (join +.job)
|
||||
$eval (eval +.job)
|
||||
$who (who +.job)
|
||||
$what (what +.job)
|
||||
$bind (bind +.job)
|
||||
$invite (invite +.job)
|
||||
$banish (banish +.job)
|
||||
$author (author +.job)
|
||||
$block (block +.job)
|
||||
$create (create +.job)
|
||||
$nick (nick +.job)
|
||||
$set (wo-set +.job)
|
||||
$unset (unset +.job)
|
||||
$target (target +.job)
|
||||
$probe (probe +.job)
|
||||
$help help
|
||||
$say (say +.job)
|
||||
==
|
||||
::
|
||||
++ activate :: from %number
|
||||
|= gam=telegram
|
||||
|= gam+telegram
|
||||
^+ ..sh-work
|
||||
=+ tay=~(. tr man.she (~(has in settings.she) %noob) gam)
|
||||
=. ..sh-work (sh-fact tr-fact:tay)
|
||||
@ -924,10 +925,10 @@
|
||||
(sh-fact %txt "see http://urbit.org/docs/user/talk")
|
||||
::
|
||||
++ glyph
|
||||
|= idx=@
|
||||
|= idx+@
|
||||
=< cha.ole
|
||||
%+ reel glyphs
|
||||
|= [all=tape ole=[cha=char num=@]]
|
||||
|= {all+tape ole+{cha+char num+@}}
|
||||
=+ new=(snag (mod idx (lent all)) all)
|
||||
=+ num=~(wyt in (~(get ju nak) new))
|
||||
?~ cha.ole [new num]
|
||||
@ -936,7 +937,7 @@
|
||||
[new num]
|
||||
::
|
||||
++ set-glyph
|
||||
|= [cha=char lix=(set partner)]
|
||||
|= {cha+char lix+(set partner)}
|
||||
=: nik (~(put by nik) lix cha)
|
||||
nak (~(put ju nak) cha lix)
|
||||
==
|
||||
@ -947,7 +948,7 @@
|
||||
==
|
||||
::
|
||||
++ join :: %join
|
||||
|= pan=(set partner)
|
||||
|= pan+(set partner)
|
||||
^+ ..sh-work
|
||||
=. ..sh-work
|
||||
=+ (~(get by nik) pan)
|
||||
@ -959,65 +960,65 @@
|
||||
`loc(sources (~(uni in sources.loc) pan))
|
||||
::
|
||||
++ leave :: %leave
|
||||
|= pan=(set partner)
|
||||
|= pan+(set partner)
|
||||
^+ ..sh-work
|
||||
=+ loc=loc.system.she
|
||||
%^ sh-tell %design man.she
|
||||
`loc(sources (~(dif in sources.loc) pan))
|
||||
::
|
||||
++ what :: %what
|
||||
|= qur=$|(char (set partner)) ^+ ..sh-work
|
||||
|= qur=_|(char (set partner)) ^+ ..sh-work
|
||||
?^ qur
|
||||
=+ cha=(~(get by nik) qur)
|
||||
(sh-fact %txt ?~(cha "none" [u.cha]~))
|
||||
=+ pan=(~(tap in (~(get ju nak) qur)))
|
||||
?: =(~ pan) (sh-fact %txt "~")
|
||||
=< (sh-fact %mor (turn pan .))
|
||||
|=(a=(set partner) [%txt <a>]) :: XX ~(te-whom te man.she a)
|
||||
|=(a+(set partner) [%txt <a>]) :: XX ~(te-whom te man.she a)
|
||||
::
|
||||
++ who :: %who
|
||||
|= pan=(set partner) ^+ ..sh-work
|
||||
|= pan+(set partner) ^+ ..sh-work
|
||||
=< (sh-fact %mor (murn (sort (~(tap by q.owners.she)) aor) .))
|
||||
|= [pon=partner alt=atlas] ^- (unit sole-effect)
|
||||
|= {pon+partner alt+atlas} ^- (unit sole-effect)
|
||||
?. |(=(~ pan) (~(has in pan) pon)) ~
|
||||
=- `[%tan rose/[", " `~]^- leaf/~(ta-full ta man.she pon) ~]
|
||||
=< (murn (sort (~(tap by alt)) aor) .)
|
||||
|= [a=ship b=presence c=human] ^- (unit tank) :: XX names
|
||||
|= {a+ship b+presence c+human} ^- (unit tank) :: XX names
|
||||
?- b
|
||||
%gone ~
|
||||
%hear `>a<
|
||||
%talk `>a< :: XX difference
|
||||
$gone ~
|
||||
$hear `>a<
|
||||
$talk `>a< :: XX difference
|
||||
==
|
||||
::
|
||||
++ bind :: %bind
|
||||
|= [cha=char pan=(unit (set partner))] ^+ ..sh-work
|
||||
|= {cha+char pan+(unit (set partner))} ^+ ..sh-work
|
||||
?~ pan $(pan [~ ?~(active.she passive.she u.active.she)])
|
||||
=+ ole=(~(get by nik) u.pan)
|
||||
?: =(ole [~ cha]) ..sh-work
|
||||
(sh-note:(set-glyph cha u.pan) "bound {<cha>} {<u.pan>}")
|
||||
::
|
||||
++ invite :: %invite
|
||||
|= [nom=span tal=(list partner)]
|
||||
|= {nom+span tal+(list partner)}
|
||||
^+ ..sh-work
|
||||
!!
|
||||
::
|
||||
++ block :: %block
|
||||
|= [nom=span tal=(list partner)]
|
||||
|= {nom+span tal+(list partner)}
|
||||
^+ ..sh-work
|
||||
!!
|
||||
::
|
||||
++ author :: %author
|
||||
|= [nom=span tal=(list partner)]
|
||||
|= {nom+span tal+(list partner)}
|
||||
^+ ..sh-work
|
||||
!!
|
||||
::
|
||||
++ banish :: %banish
|
||||
|= [nom=span tal=(list partner)]
|
||||
|= {nom+span tal+(list partner)}
|
||||
^+ ..sh-work
|
||||
!!
|
||||
::
|
||||
++ create :: %create
|
||||
|= [por=posture nom=span txt=cord]
|
||||
|= {por+posture nom+span txt+cord}
|
||||
^+ ..sh-work
|
||||
?: (~(has in stories) nom)
|
||||
(sh-lame "{(trip nom)}: already exists")
|
||||
@ -1030,7 +1031,7 @@
|
||||
(join [[%& our.hid nom] ~ ~])
|
||||
::
|
||||
++ reverse-folks
|
||||
|= nym=span
|
||||
|= nym+span
|
||||
^- (list ship)
|
||||
%+ murn (~(tap by folks))
|
||||
|= [p=ship q=human]
|
||||
@ -1039,12 +1040,12 @@
|
||||
[~ u=p]
|
||||
::
|
||||
++ nick :: %nick
|
||||
|= [her=(unit ship) nym=(unit cord)]
|
||||
|= {her+(unit ship) nym+(unit cord)}
|
||||
^+ ..sh-work
|
||||
?: ?=([~ ~] +<)
|
||||
?: ?=({$~ $~} +<)
|
||||
%+ sh-fact %mor
|
||||
%+ turn (~(tap by folks))
|
||||
|= [p=ship q=human]
|
||||
|= {p+ship q+human}
|
||||
:- %txt
|
||||
?~ hand.q
|
||||
"{<p>}:"
|
||||
@ -1059,7 +1060,7 @@
|
||||
?~ her
|
||||
%+ sh-fact %mor
|
||||
%+ turn (reverse-folks u.nym)
|
||||
|= p=ship
|
||||
|= p+ship
|
||||
[%txt "{<p>}: {<u.nym>}"]
|
||||
%= ..sh-work
|
||||
folks ?~ u.nym
|
||||
@ -1068,32 +1069,32 @@
|
||||
==
|
||||
::
|
||||
++ wo-set :: %set
|
||||
|= seg=span
|
||||
|= seg+span
|
||||
^+ ..sh-work
|
||||
?~ seg
|
||||
%+ sh-fact %mor
|
||||
%+ turn (~(tap in settings.she))
|
||||
|= s=span
|
||||
|= s+span
|
||||
[%txt (trip s)]
|
||||
%= ..sh-work
|
||||
settings.she (~(put in settings.she) seg)
|
||||
==
|
||||
::
|
||||
++ unset :: %unset
|
||||
|= neg=span
|
||||
|= neg+span
|
||||
^+ ..sh-work
|
||||
%= ..sh-work
|
||||
settings.she (~(del in settings.she) neg)
|
||||
==
|
||||
::
|
||||
++ target :: %target
|
||||
|= [pan=(set partner) woe=(unit ^work)]
|
||||
|= {pan+(set partner) woe+(unit ^work)}
|
||||
^+ ..sh-work
|
||||
=. ..sh-pact (sh-pact pan)
|
||||
?~(woe ..sh-work work(job u.woe))
|
||||
::
|
||||
++ number :: %number
|
||||
|= num=$|(@ud [p=@u q=@ud])
|
||||
|= num+_|(@ud {p+@u q+@ud})
|
||||
^+ ..sh-work
|
||||
=+ roy=(~(got by stories) man.she)
|
||||
|-
|
||||
@ -1111,26 +1112,26 @@
|
||||
(sh-lame "…{(reap p.num '0')}{(scow %ud q.num)}: no such telegram")
|
||||
::
|
||||
++ deli :: find number
|
||||
|= [max=@ud nul=@u fin=@ud] ^- @ud
|
||||
|= {max+@ud nul+@u fin+@ud} ^- @ud
|
||||
=+ dog=|-(?:(=(0 fin) 1 (mul 10 $(fin (div fin 10)))))
|
||||
=. dog (mul dog (pow 10 nul))
|
||||
=- ?:((lte - max) - (sub - dog))
|
||||
(add fin (sub max (mod max dog)))
|
||||
::
|
||||
++ probe :: inquire
|
||||
|= cuz=station
|
||||
|= cuz+station
|
||||
^+ ..sh-work
|
||||
~& [%probe cuz]
|
||||
..sh-work
|
||||
::
|
||||
++ eval :: run
|
||||
|= [txt=cord exe=twig]
|
||||
|= {txt+cord exe+twig}
|
||||
=> |.([(sell (slap (slop sh-twig-head seed) exe))]~)
|
||||
=+ tan=p:(mule .)
|
||||
(say [%fat tank/tan exp/txt] ~)
|
||||
::
|
||||
++ say :: publish
|
||||
|= sep=(list speech)
|
||||
|= sep+(list speech)
|
||||
^+ ..sh-work
|
||||
?~ sep ..sh-work
|
||||
=^ sir ..sh-work sh-uniq
|
||||
@ -1161,20 +1162,20 @@
|
||||
==
|
||||
::
|
||||
++ sh-sole :: apply edit
|
||||
|= act=sole-action
|
||||
|= act+sole-action
|
||||
^+ +>
|
||||
?- -.act
|
||||
%det (sh-stir +.act)
|
||||
%clr (sh-pact ~)
|
||||
%ret sh-done
|
||||
$det (sh-stir +.act)
|
||||
$clr (sh-pact ~)
|
||||
$ret sh-done
|
||||
==
|
||||
::
|
||||
++ sh-uniq
|
||||
^- [serial _.]
|
||||
^- [serial __(.)]
|
||||
[(shaf %serial eny.hid) .(eny.hid (shax eny.hid))]
|
||||
--
|
||||
++ ra-abed :: resolve core
|
||||
^- [(list move) _+>]
|
||||
^+ [*(list move) +>]
|
||||
:_ +>
|
||||
=+ ^= yop
|
||||
|- ^- (pair (list move) (list sole-effect))
|
||||
@ -1356,7 +1357,7 @@
|
||||
++ ra-console :: console subscribe
|
||||
|= [her=ship pax=path]
|
||||
^+ +>
|
||||
=+ man=`span`?~(pax (main her) ?>(?=(~ t.pax) i.pax))
|
||||
=+ man=`span`?~(pax (main her) ?>(?=($~ t.pax) i.pax))
|
||||
=+ ^= she ^- shell
|
||||
[her man 0 *sole-share ~ [[%& our.hid man] ~ ~] [~ ~] ~ *cabal ~]
|
||||
sh-abet:~(sh-peer sh ~ she)
|
||||
@ -1365,7 +1366,7 @@
|
||||
|= [her=ship pax=path]
|
||||
^+ +>
|
||||
:: ~& [%ra-subscribe ost.hid her pax]
|
||||
?: ?=(~ pax)
|
||||
?: ?=($~ pax)
|
||||
(ra-house(general (~(put in general) ost.hid)) ost.hid)
|
||||
?. ?=([@ @ *] pax)
|
||||
(ra-evil %talk-bad-path)
|
||||
@ -1647,7 +1648,7 @@
|
||||
==
|
||||
=+ gub=(~(get by remotes) tay)
|
||||
:: ~& [%pa-remind tay gub buk]
|
||||
?. |(?=(~ gub) !=(buk u.gub))
|
||||
?. |(?=($~ gub) !=(buk u.gub))
|
||||
+>.$
|
||||
=. remotes (~(put by remotes) tay buk)
|
||||
(pa-report-group groupers)
|
||||
@ -1918,7 +1919,7 @@
|
||||
=(p.p.pan our.hid)
|
||||
::
|
||||
=+ sot=(~(get by stories) q.p.pan)
|
||||
&(?=(^ sot) ?=(%brown p.cordon.shape.u.sot))
|
||||
&(?=(^ sot) ?=($brown p.cordon.shape.u.sot))
|
||||
==
|
||||
::
|
||||
++ te-pref :: audience glyph
|
||||
@ -2098,12 +2099,12 @@
|
||||
++ etch-friend ::
|
||||
|= [way=wire fun=$+([man=span cuz=station] [(list move) _+>])]
|
||||
=+ wer=(etch way)
|
||||
?>(?=(%friend -.wer) (fun p.wer q.wer))
|
||||
?>(?=($friend -.wer) (fun p.wer q.wer))
|
||||
::
|
||||
++ etch-repeat ::
|
||||
|= [way=wire fun=$+([num=@ud src=@p man=span] [(list move) _+>])]
|
||||
=+ wer=(etch way)
|
||||
?>(?=(%repeat -.wer) (fun p.wer q.wer r.wer))
|
||||
?>(?=($repeat -.wer) (fun p.wer q.wer r.wer))
|
||||
::
|
||||
++ reap-friend ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|
@ -4,15 +4,15 @@
|
||||
::
|
||||
=+ =~
|
||||
|%
|
||||
++ loca |*(a=_,* ,[p=@u q=a])
|
||||
++ loca |*(a+__(*) {p+@u q+a})
|
||||
++ stack (list (loca tops))
|
||||
--
|
||||
|%
|
||||
++ htm-enty :: XX belongs in zuse
|
||||
~+
|
||||
=- |= tub=nail ^- (like ,@t) %. tub :: export context
|
||||
=- |= tub+nail ^- (like @t) %. tub :: export context
|
||||
=+(poxa enty(ent mapping))
|
||||
^- mapping=(map span ,@tF)
|
||||
^- mapping+(map span @tF)
|
||||
=+ pax=/==5%%/html5-entities/json :: XX %%/
|
||||
=+ maf=%.(pax ;~(biff file (soft json) (om so):jo))
|
||||
?^ maf u.maf
|
||||
@ -40,7 +40,7 @@
|
||||
view-source webcal wtai wyciwyg xfire xri ymsgr
|
||||
'''
|
||||
::
|
||||
++ uri-skem (sear (flit |=(a=tape (~(has in skem-set) (cass a)))) skem-symb)
|
||||
++ uri-skem (sear (flit |=(a+tape (~(has in skem-set) (cass a)))) skem-symb)
|
||||
--
|
||||
::
|
||||
::::
|
||||
@ -49,32 +49,32 @@
|
||||
++ nal (just `@`10)
|
||||
++ end (full (easy ~))
|
||||
++ eol ;~(pose (cold ~ nal) end)
|
||||
::++ match |=(a=rege (curr scan (ra a)))
|
||||
::++ match |=(a+rege (curr scan (ra a)))
|
||||
::
|
||||
++ tab
|
||||
|= tub=nail
|
||||
^- (like cord)
|
||||
?. ?=([%9 *] q.tub)
|
||||
|= tub+nail
|
||||
^- (like cord)
|
||||
?. ?=({$9 *} q.tub)
|
||||
(fail tub)
|
||||
=+ sto=+((~(inv fe 1) (dec q.p.tub))) :: virt spaces produced
|
||||
=+ neu=(weld (reap sto ' ') t.q.tub)
|
||||
(next tub(q neu))
|
||||
::
|
||||
++ whif |*(a=rule ;~(sfix a (star ace)))
|
||||
++ ahed |*(a=rule ;~(simu a (easy ~)))
|
||||
++ opts |*(a=rule ;~((bend) (easy ~) a))
|
||||
++ lots |*([a=@u b=rule] ;~(pfix (stun [a a] b) (star b)))
|
||||
++ leas |*(a=rule ;~(pfix ;~(less (stun 4^4 ace) (stun 0^3 ace)) a))
|
||||
++ whif |*(a+rule ;~(sfix a (star ace)))
|
||||
++ ahed |*(a+rule ;~(simu a (easy ~)))
|
||||
++ opts |*(a+rule ;~((bend) (easy ~) a))
|
||||
++ lots |*({a+@u b+rule} ;~(pfix (stun [a a] b) (star b)))
|
||||
++ leas |*(a+rule ;~(pfix ;~(less (stun 4^4 ace) (stun 0^3 ace)) a))
|
||||
++ pech
|
||||
|* a=[rule rule]
|
||||
|* a+{rule rule}
|
||||
|= tub=nail
|
||||
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
|
||||
^- (like (each __((wonk (-.a))) __((wonk (+.a)))))
|
||||
%. tub
|
||||
;~(pose (stag %& -.a) (stag %| +.a))
|
||||
::
|
||||
++ lite :: literal matched
|
||||
|* a=rule
|
||||
|= tub=nail ^- (like tape)
|
||||
|* a+rule
|
||||
|= tub+nail ^- (like tape)
|
||||
=+ vex=(a tub)
|
||||
?~ q.vex vex
|
||||
=+ tap=q.q.u.q.vex
|
||||
@ -85,24 +85,24 @@
|
||||
[i.q.tub $(q.tub t.q.tub)]
|
||||
::
|
||||
++ enrule :: XX
|
||||
|* a=$+(tape *)
|
||||
|= tub=nail
|
||||
|* a+_+(tape *)
|
||||
|= tub+nail
|
||||
^- (like a)
|
||||
[[0 0] ~ (a q.tub) [0 0] ~]
|
||||
-- ==
|
||||
=~
|
||||
|%
|
||||
++ strip
|
||||
|= [a=$+(nail edge) b=tape]
|
||||
|= {a+_+(nail edge) b+tape}
|
||||
^- tape
|
||||
=+ q:(a 1^1 b)
|
||||
?~(- b q.q.u.-)
|
||||
::
|
||||
++ inli :: inline parsers
|
||||
=+ [bug=| rec="" nol=|]
|
||||
|_ ref=(map cord ,[p=tape q=(unit tape)])
|
||||
|_ ref+(map cord {p+tape q+(unit tape)})
|
||||
++ unesc
|
||||
|= a=tape
|
||||
|= a+tape
|
||||
(scan a (star ;~(pose nore(rec ~) nal))) :: XX
|
||||
::
|
||||
++ esc
|
||||
@ -114,26 +114,26 @@
|
||||
++ nore ~+ ;~(pose htm-enty norc)
|
||||
::
|
||||
++ trim-sp
|
||||
|= a=tape
|
||||
|= a+tape
|
||||
^- tape
|
||||
%+ strip (star gah)
|
||||
(flop (strip (star gah) (flop a)))
|
||||
::
|
||||
++ child
|
||||
=< |= tub=nail ^- (like inline) %. tub :: expose parsers
|
||||
%+ cook |=(a=inline ~?(bug a a))
|
||||
=< |= tub+nail ^- (like inline) %. tub :: expose parsers
|
||||
%+ cook |=(a+inline ~?(bug a a))
|
||||
;~(pose code line link blot:link htmt)
|
||||
|%
|
||||
++ fens
|
||||
|= a=tape
|
||||
|= a+tape
|
||||
%+ knee *tape |. ~+
|
||||
|= tub=nail ^- (like tape)
|
||||
|= tub+nail ^- (like tape)
|
||||
=+ vex=((plus tec) tub)
|
||||
?~ q.vex
|
||||
(plug (codc tub) ^^$)
|
||||
?: =(a p.u.q.vex)
|
||||
vex(p.u.q ~)
|
||||
=+ neu=|=(b=tape (weld `tape`p.u.q.vex b))
|
||||
=+ neu=|=(b+tape (weld `tape`p.u.q.vex b))
|
||||
((cook neu ^^$) q.u.q.vex)
|
||||
::
|
||||
++ codc ;~(pose (cold ' ' (plus gah)) prn)
|
||||
@ -141,16 +141,16 @@
|
||||
=- ;~(pose - (stag %$ (plus tec)))
|
||||
%+ stag %code
|
||||
%+ cook trim-sp
|
||||
|= tub=nail
|
||||
?. ?=([%'`' ^] q.tub)
|
||||
|= tub+nail
|
||||
?. ?=({$'`' ^} q.tub)
|
||||
(fail tub)
|
||||
=+ vex=((plus tec) tub)
|
||||
(pfix vex (fens (wonk vex)))
|
||||
::
|
||||
++ madn
|
||||
|= a=mane ^- ?
|
||||
=> |=(b=span ?=(^ (rush b ;~(plug alf (star aln)))))
|
||||
?@ a (. a)
|
||||
|= a+mane ^- ?
|
||||
=> |=(b+span ?=(^ (rush b ;~(plug alf (star aln)))))
|
||||
?@ a (. a)
|
||||
&((. -.a) (. +.a))
|
||||
::
|
||||
++ htmt
|
||||
@ -159,11 +159,11 @@
|
||||
%- sear :_
|
||||
;~(pose empt:poxa (pech [head tail]:poxa))
|
||||
%- flit
|
||||
|= a=$&([marx ~] $%([%& marx] [%| p=mane]))
|
||||
|= a+_&({marx $~} _%({$& marx} {$| p+mane}))
|
||||
?- -.a
|
||||
^ (madn n.a)
|
||||
& (madn n.a)
|
||||
| (madn p.a)
|
||||
^ (madn n.a)
|
||||
{$&} (madn n.a)
|
||||
{$|} (madn p.a)
|
||||
==
|
||||
::
|
||||
++ line
|
||||
@ -171,38 +171,38 @@
|
||||
;~(plug ;~(pose (lots 2 ace) bas) nal)
|
||||
::
|
||||
++ empty
|
||||
|= a=inline
|
||||
|= a+inline
|
||||
^- ?
|
||||
?& ?=(%$ -.a)
|
||||
?=(~ (strip (star ;~(pose ace nal)) p.a))
|
||||
?& ?=($$ -.a)
|
||||
?=($~ (strip (star ;~(pose ace nal)) p.a))
|
||||
==
|
||||
::
|
||||
++ link ::=+(blot=fail |=(nail (fail +<)))
|
||||
=< =- |=(tub=nail (pra tub)) :: expose parsers
|
||||
=< =- |=(tub+nail (pra tub)) :: expose parsers
|
||||
?: nol pra=auto ::;~(pose auto pexp)
|
||||
=- pra=;~(pose auto (cook - apex))
|
||||
|=([a=kids b=[tape (unit tape)]] [[%link b] a])
|
||||
|=({a+kids b+{tape (unit tape)}} [[%link b] a])
|
||||
|%
|
||||
++ apex
|
||||
=+ ^- rob=$+(nail (like ,[kids $|(cord [tape (unit tape)])]))
|
||||
=+ ^- rob+_+(nail (like {kids _|(cord {tape (unit tape)})}))
|
||||
;~(plug text(nol &) labe)
|
||||
::
|
||||
|= tub=nail
|
||||
^- (like (pair kids ,[tape (unit tape)]))
|
||||
|= tub+nail
|
||||
^- (like (pair kids {tape (unit tape)}))
|
||||
:: (fail tub)
|
||||
=+ vex=(rob tub)
|
||||
?~ q.vex
|
||||
vex
|
||||
=- ?~(rez vex(q ~) vex(+.p.u.q u.rez))
|
||||
^- rez=(unit ,[tape (unit tape)])
|
||||
^- rez+(unit {tape (unit tape)})
|
||||
=+ [~ atr]=(wonk vex)
|
||||
?^ atr
|
||||
`atr
|
||||
?. ?=(~ atr)
|
||||
?. ?=($~ atr)
|
||||
(~(get by ref) atr)
|
||||
=+ vux=(text:href tub)
|
||||
?~ q.vux ~
|
||||
(~(get by ref) (wonk vux))
|
||||
(~(get by ref) (wonk vux))
|
||||
::
|
||||
++ text
|
||||
=. rec ['[' ']' rec]
|
||||
@ -212,17 +212,17 @@
|
||||
++ labe
|
||||
=+ wra=[;~(plug pel .) ;~(plug . per)]:(star gah)
|
||||
;~ pose
|
||||
(ifix wra ;~(plug dest:href titl))
|
||||
(ifix wra ;~(plug dest:href titl))
|
||||
;~(pfix (star gah) text:href)
|
||||
(easy '')
|
||||
==
|
||||
::
|
||||
++ blot
|
||||
%- cook :_ ;~(pfix zap [.(rob ;~(plug text labe))]:apex)
|
||||
|=([a=kids b=[tape (unit tape)]] [[%blot b] a])
|
||||
|=({a+kids b+{tape (unit tape)}} [[%blot b] a])
|
||||
::
|
||||
++ mail
|
||||
%+ cook |=(_[a="" b='' c="" d=*wall] :(welp a b^c (zing d)))
|
||||
%+ cook |=(__([a="" b='' c="" d=*wall]) :(welp a b^c (zing d)))
|
||||
;~ plug
|
||||
(plus ;~(less (mask "\"\\ (),:;<>@[]") prn))
|
||||
pat
|
||||
@ -233,23 +233,23 @@
|
||||
++ auto
|
||||
%+ ifix gal^gar
|
||||
;~ pose
|
||||
(cook |=(a=tape [link/["mailto:{a}" ~] ~[`a]]) mail)
|
||||
(cook |=(a+tape [link/["mailto:{a}" ~] ~[`a]]) mail)
|
||||
::
|
||||
=+ cha=;~(pose htm-enty ;~(less (mask "<> ") prn))
|
||||
%+ cook
|
||||
|= a=_["" ""]
|
||||
|= a+__(["" ""])
|
||||
[link/[(weld a) ~] ~[`(weld a)]]
|
||||
;~(plug uri-skem col (star cha))
|
||||
==
|
||||
::
|
||||
++ pexp :: XX non-link nested
|
||||
%- cook :_ (ifix sel^ser many)
|
||||
|=(a=kids (reso:many "[" (welp a `"]" ~)))
|
||||
|=(a+kids (reso:many "[" (welp a `"]" ~)))
|
||||
--
|
||||
--
|
||||
::
|
||||
++ href
|
||||
=< |= tub=nail %. tub :: expose parsers
|
||||
=< |= tub+nail %. tub :: expose parsers
|
||||
;~ plug
|
||||
;~(sfix text col (star gah))
|
||||
(sear (flit |=(tape ?=(^ +<))) dest)
|
||||
@ -262,7 +262,7 @@
|
||||
(pexp nore(rec " "))
|
||||
==
|
||||
++ pexp
|
||||
|* cha=rule
|
||||
|* cha+rule
|
||||
=+ chu=;~(less pel per cha)
|
||||
|- :: XX Chesterton fence
|
||||
%+ knee *tape |. ~+
|
||||
@ -274,13 +274,13 @@
|
||||
++ text
|
||||
=- (ifix sel^ser (cook cass (star -)))
|
||||
;~ pose
|
||||
(cook |=(a=char (cat 3 '\\' a)) esc)
|
||||
(cook |=(a+char (cat 3 '\\' a)) esc)
|
||||
(cold ' ' (plus gah))
|
||||
;~(less sel ser prn)
|
||||
==
|
||||
++ titl
|
||||
%. ~[soq^soq doq^doq pel^per]
|
||||
|* a=(pole ,[rule rule])
|
||||
|* a+(pole {rule rule})
|
||||
?~ a fail
|
||||
;~ pose
|
||||
(ifix -.a (star ;~(pose esc htm-enty ;~(less ->.a prn))))
|
||||
@ -288,29 +288,29 @@
|
||||
==
|
||||
--
|
||||
++ consol
|
||||
|= a=kids
|
||||
|= a+kids
|
||||
^- kids
|
||||
?~ a ~
|
||||
?+ -.i.a [i.a $(a t.a)]
|
||||
%$
|
||||
$$
|
||||
?~ t.a a
|
||||
?: ?=(_-.i.a -.i.t.a)
|
||||
?: ?=(__(-.i.a) -.i.t.a)
|
||||
$(a t.a(p.i (weld p.i.a p.i.t.a)))
|
||||
[i.a $(a t.a)]
|
||||
==
|
||||
++ pars :: XX
|
||||
++ pars :: XX
|
||||
=> |%
|
||||
++ nufh ,[tape kids]
|
||||
++ fens ?(%'*' %'_')
|
||||
++ nuft ,[nufh ?(tape [tape ?(%| fens)])]
|
||||
++ nufh {tape kids}
|
||||
++ fens ?($'*' $'_')
|
||||
++ nuft {nufh ?(tape {tape ?($| fens)})}
|
||||
++ reso
|
||||
|= a=nufh
|
||||
|= a+nufh
|
||||
^- kids
|
||||
?~ -.a +.a
|
||||
[[%$ -.a] +.a]
|
||||
[[%$ -.a] +.a]
|
||||
::
|
||||
++ veld
|
||||
|= [a=$|(char inline) _[b c]=*nuft]
|
||||
|= {a+_|(char inline) __([b c]=*nuft)}
|
||||
^- nuft
|
||||
:_ c
|
||||
?@ a
|
||||
@ -320,22 +320,22 @@
|
||||
[~ a (reso b)]
|
||||
::
|
||||
++ rend
|
||||
|= nuf=nufh
|
||||
|= nuf+nufh
|
||||
%. (reso nuf)
|
||||
|= a=kids
|
||||
|= a+kids
|
||||
^- tape
|
||||
?~ a ~
|
||||
%- weld :_ $(a t.a)
|
||||
?@ -.i.a
|
||||
?+ -.i.a <i.a>
|
||||
~ p.i.a
|
||||
$~ p.i.a
|
||||
==
|
||||
=+ [p q]=i.a
|
||||
?+ -.p "[{(trip -.p)}]<{$(a q)}>"
|
||||
%emph "({$(a q)})"
|
||||
$emph "({$(a q)})"
|
||||
==
|
||||
--
|
||||
|= tap=tape ^- kids
|
||||
|= tap+tape ^- kids
|
||||
=. tap (trim-sp tap)
|
||||
=+ vex=(many 1^1 tap)
|
||||
?~ q.vex
|
||||
@ -344,15 +344,15 @@
|
||||
?~(b a (welp a [`b]~))
|
||||
::
|
||||
++ many
|
||||
=> pars :: XX
|
||||
=> pars :: XX
|
||||
|= tub=nail ^- (like kids)
|
||||
=- [[0 0] ~ (reso -<) [0 0] ;;(tape ->)] :: XX
|
||||
=+ [ins=`?(fens ~)`~ bof=| noz=|]
|
||||
=+ [ins=`?(fens $~)`~ bof=| noz=|]
|
||||
?~ q.tub [`~ ~]
|
||||
=+ [p=*char [i t]=[i t]:q.tub] :: prev current next
|
||||
=< ?<(&(?=([* @] +) !?=(~ +>)) .) :: XX do type stuff
|
||||
=< ?<(&(?=({* @} +) !?=($~ +>)) .) :: XX do type stuff
|
||||
|^ ^- nuft
|
||||
?: ?=(?(%'*' %'_') i)
|
||||
?: ?=(?($'*' $'_') i)
|
||||
dlim
|
||||
=+ elm=(;~(pose child ;~(pfix (star ace) nal) nore) [1 1] i t)
|
||||
?~ q.elm
|
||||
@ -363,7 +363,7 @@
|
||||
::
|
||||
++ next (push i)
|
||||
++ push :: continue with head
|
||||
|= a=$|(char inline)
|
||||
|= a+_|(char inline)
|
||||
^- nuft
|
||||
~? ?@(a | bug) fon/a
|
||||
?~ t (veld a done)
|
||||
@ -386,26 +386,26 @@
|
||||
$(+<+ t)
|
||||
::
|
||||
++ flome
|
||||
|= a=_+:*nuft
|
||||
^- [(unit ?(%| fens)) tape]
|
||||
?. ?=([* ?(%| fens)] a)
|
||||
|= a=__(+:*nuft)
|
||||
^- {(unit ?($| fens)) tape}
|
||||
?. ?=({* ?($| fens)} a)
|
||||
[~ a]
|
||||
[[~ +.a] -.a]
|
||||
::
|
||||
++ empa
|
||||
|= a=nufh
|
||||
|= a+nufh
|
||||
^- inline
|
||||
[[%emph |] (reso a)]
|
||||
::
|
||||
++ ends
|
||||
|= [a=tape b=tape]
|
||||
|= {a+tape b+tape}
|
||||
?: &(?=(^ b) =(i i.b))
|
||||
$(b t.b)
|
||||
?: &(?=(^ a) =(i i.a))
|
||||
$(a t.a)
|
||||
?> ?=(fens i) :: XX do type stuff
|
||||
?& |(?=(~ b) !=(' ' i.b))
|
||||
|(=('*' i) [?=(~ q)]:(aln 1^1 a))
|
||||
?& |(?=($~ b) !=(' ' i.b))
|
||||
|(=('*' i) [?=($~ q)]:(aln 1^1 a))
|
||||
==
|
||||
::
|
||||
++ dlim
|
||||
@ -422,7 +422,7 @@
|
||||
?. (ends [p]~ t)
|
||||
next
|
||||
=+ [a tak]=pull
|
||||
=> .(t `_""`t) :: XX do type stuff
|
||||
=> .(t `__("")`t) :: XX do type stuff
|
||||
=^ b t (flome tak)
|
||||
?~ b
|
||||
(push (empa a))
|
||||
@ -440,26 +440,26 @@
|
||||
::::
|
||||
::
|
||||
|%
|
||||
++ nesting $% [%bloq *] :: Used for fishing
|
||||
[%item *]
|
||||
[%list [%item ~]]
|
||||
++ nesting _% {$bloq *} :: Used for fishing
|
||||
{$item *}
|
||||
{$list {$item $~}}
|
||||
==
|
||||
++ accepting ?(%para %code)
|
||||
++ accepting ?($para $code)
|
||||
++ list-nest :: can add list item?
|
||||
=+ sam=[?>(?=(%list -.p..) p..)]:(tops [%list ~]~) :: XX do type stuff
|
||||
|= [a=_sam b=_sam] ^- ?
|
||||
=+ sam=[?>(?=($list -.p..) p..)]:(tops [%list ~]~) :: XX do type stuff
|
||||
|= {a+__(sam) b+__(sam)} ^- ?
|
||||
.= ?@(q.a q.a q.q.a) :: by checking delimiter characters
|
||||
?@(q.b q.b q.q.b)
|
||||
|
||||
::
|
||||
:: =- =((cha p.a) (cha p.b))
|
||||
:: ^= cha
|
||||
:: |= a=_sam
|
||||
:: ?@(q.a q.a q.q.a)
|
||||
::
|
||||
++ closes-code
|
||||
=+ sam=[?>(?=(%code -) p..)]:(node [%code ~]) :: XX do type stuff
|
||||
|= [a=_sam b=_sam]
|
||||
?~ a ?=(~ b)
|
||||
=+ sam=[?>(?=($code -) p..)]:(node [%code ~]) :: XX do type stuff
|
||||
|= {a+__(sam) b+__(sam)}
|
||||
?~ a ?=($~ b)
|
||||
?~ b |
|
||||
?^ r.u.b |
|
||||
?& =(p.u.a p.u.b)
|
||||
@ -467,18 +467,18 @@
|
||||
==
|
||||
::
|
||||
++ blank
|
||||
|= a=tape ^- ?
|
||||
|= a+tape ^- ?
|
||||
?~ a &
|
||||
&(=(' ' i.a) $(a t.a))
|
||||
::
|
||||
++ dehax :: strip trailing hax
|
||||
=+ nobas=;~(sfix (plus hax) ;~(pose ace end))
|
||||
|= a=tape
|
||||
|= a+tape
|
||||
%- flop
|
||||
:(strip nobas (star ace) (flop a))
|
||||
::
|
||||
++ scab
|
||||
|* [a=tape b=rule]
|
||||
|* {a+tape b+rule}
|
||||
(wonk (b [1 1] a))
|
||||
::
|
||||
++ donp
|
||||
@ -503,12 +503,13 @@
|
||||
==
|
||||
++ leaf (leas ;~(pose head hrul fcode)) :: any node
|
||||
++ head
|
||||
%+ cook |=(a=tape [%head (lent a) ~])
|
||||
%+ cook |=(a+tape [%head (lent a) ~])
|
||||
;~(sfix (stun 1^6 hax) ;~(pose ace (ahed eol)))
|
||||
::
|
||||
++ hrul
|
||||
%+ cold [%hrul ~]
|
||||
%. ~[tar hep cab] :: (vary "*-_")
|
||||
|* a=(pole rule)
|
||||
|* a+(pole rule)
|
||||
?~ a fail
|
||||
;~(pose ;~(plug (lots 3 (whif -.a)) (ahed eol)) $(a +.a))
|
||||
::
|
||||
@ -538,7 +539,7 @@
|
||||
++ icode (cold `node`[%code ~ ~] (stun 4^4 ace))
|
||||
++ fcode
|
||||
%. ~['`' '~'] :: (vary "`~")
|
||||
|* a=(pole char)
|
||||
|* a+(pole char)
|
||||
?~ a fail
|
||||
=- ;~(pose fel $(a +.a))
|
||||
^= fel
|
||||
@ -547,33 +548,33 @@
|
||||
(star ;~(less tec prn))
|
||||
(ahed eol)
|
||||
==
|
||||
|= [b=(list) c=tape ~]
|
||||
^+ [?>(?=(%code -) .)]:*node :: XX do type stuff
|
||||
|= {b+(list) c+tape $~}
|
||||
^+ [?>(?=($code -) .)]:*node :: XX do type stuff
|
||||
[%code `[-.a (add 3 (lent b)) c] ~]
|
||||
--
|
||||
::
|
||||
++ normalize
|
||||
|= a=down ^- down
|
||||
%+ turn a |= b=elem
|
||||
%+ turn a |= b+elem
|
||||
?^ -.b b(q (turn q.b ..$))
|
||||
=- ?+(-.b b %para b(p (- p.b)), %head b(q (- q.b)))
|
||||
=- ?+(-.b b $para b(p (- p.b)), $head b(q (- q.b)))
|
||||
|= c=kids ^- kids
|
||||
?~ c ~
|
||||
?: ?& ?=(^ t.c)
|
||||
?=(%$ -.i.c)
|
||||
?=(%$ -.i.t.c)
|
||||
?=($$ -.i.c)
|
||||
?=($$ -.i.t.c)
|
||||
==
|
||||
$(c t.c(p.i (weld p.i.c p.i.t.c)))
|
||||
=. i.c
|
||||
?.(?=(%$ -.i.c) i.c [%$ (trip (crip p.i.c))]) :: XX valid tapes
|
||||
?.(?=($$ -.i.c) i.c [%$ (trip (crip p.i.c))]) :: XX valid tapes
|
||||
:_ $(c t.c)
|
||||
?@ -.i.c i.c
|
||||
=* d q.i.c
|
||||
?~ d
|
||||
i.c
|
||||
?. ?& ?=([* ~] d)
|
||||
?=([%emph %|] -.i.c)
|
||||
?=([%emph %|] -.i.d)
|
||||
?. ?& ?=({* $~} d)
|
||||
?=({$emph $|} -.i.c)
|
||||
?=({$emph $|} -.i.d)
|
||||
==
|
||||
i.c(q $(c d))
|
||||
[[%emph %&] $(c q.i.d)]
|
||||
@ -581,18 +582,19 @@
|
||||
++ parseb =>(parse .(bug &))
|
||||
++ parse
|
||||
=+ [bug=| bugi=|]
|
||||
|= tub=nail
|
||||
|= tub+nail
|
||||
=. q.tub
|
||||
%+ scan q.tub :: tab hackery :: XX per line
|
||||
(star ;~(pose prn tab nal))
|
||||
=| $: $: top=down :: finished toplevel elements
|
||||
[sap=@u nod=node] :: spacing, currrent leaf block
|
||||
cur=stack :: stack of nested current blocks
|
||||
=| $^
|
||||
_: _: top+down :: finished toplevel elements
|
||||
{sap+@u nod+node} :: spacing currrent leaf block
|
||||
cur+stack :: stack of nested current blocks
|
||||
==
|
||||
[bun=_| hat=_|] :: prev blank? halt?
|
||||
ref=(map cord ,[p=tape q=(unit tape)]) :: link references
|
||||
{bun+__(|) hat+__(|)} :: prev blank? halt?
|
||||
ref+(map cord {p+tape q+(unit tape)}) :: link references
|
||||
==
|
||||
|^ ^- (like ,_top)
|
||||
|^ ^- (like __(top))
|
||||
?. hat
|
||||
$:eat-line
|
||||
?^ cur
|
||||
@ -608,33 +610,33 @@
|
||||
++ debu [&2 &2.-]:&2
|
||||
::
|
||||
++ proc-inline :: parse inline kids
|
||||
|= pac=_pars:inli :: cache
|
||||
|= a=elem
|
||||
|= pac+__(pars:inli) :: cache
|
||||
|= a+elem
|
||||
?^ -.a a(q (flop (turn q.a ..$)))
|
||||
?+ -.a a
|
||||
%code
|
||||
$code
|
||||
?~ p.a a
|
||||
a(r.u.p (unesc:inli r.u.p.a))
|
||||
%para
|
||||
?> ?=([[%$ *] ~] p.a) :: XX do type stuff
|
||||
$para
|
||||
?> ?=({{$$ *} $~} p.a) :: XX do type stuff
|
||||
a(p (pac p.i.p.a))
|
||||
%head
|
||||
$head
|
||||
?~ q.a a
|
||||
?> ?=([[%$ *] ~] q.a) :: XX do type stuff
|
||||
?> ?=({{$$ *} $~} q.a) :: XX do type stuff
|
||||
a(q (pac p.i.q.a))
|
||||
==
|
||||
::
|
||||
++ snack :: advance by parser
|
||||
|* a=rule
|
||||
^- [(unit ,_(wonk (a))) nail]
|
||||
|* a+rule
|
||||
^- {(unit __((wonk (a)))) nail}
|
||||
=+ vex=(a tub)
|
||||
?~ q.vex [~ tub]
|
||||
[`p q]:u.q.vex
|
||||
::
|
||||
++ snake :: advance with trace
|
||||
|* fel=rule
|
||||
|* fel+rule
|
||||
=- (snack (here - fel))
|
||||
|*([[[@ a=@u] [@ b=@u]] c=*] [p=(sub b a) q=c])
|
||||
|*({{{@ a+@u} {@ b+@u}} c+*} [p=(sub b a) q=c])
|
||||
::
|
||||
::
|
||||
++ pop :: resolve container
|
||||
@ -647,7 +649,7 @@
|
||||
^- hed=tops
|
||||
=+ cub=q.i.cur
|
||||
?+ -.p.cub cub
|
||||
%list
|
||||
$list
|
||||
%_ cub
|
||||
p.p
|
||||
p.p.cub :: XX set this upon parsing blank-headed block
|
||||
@ -660,13 +662,13 @@
|
||||
^+ self
|
||||
=^ nol nod
|
||||
[nod [%defn ~]]
|
||||
?: ?=(%defn -.nol) self
|
||||
?: ?=($defn -.nol) self
|
||||
~? > bug clod/[nol tub]
|
||||
?~ cur self(top [nol top])
|
||||
self(q.q.i.cur [nol q.q.i.cur])
|
||||
::
|
||||
++ pop-til :: unwind stack
|
||||
|= a=stack
|
||||
|= a+stack
|
||||
^+ self
|
||||
?~ cur self
|
||||
?: =(a cur) self
|
||||
@ -676,14 +678,14 @@
|
||||
=+ laz=cur
|
||||
|-
|
||||
?~ cur laz
|
||||
=. laz ?:(?=(%list -.p.q.i.cur) cur laz)
|
||||
=. laz ?:(?=($list -.p.q.i.cur) cur laz)
|
||||
$(cur t.cur)
|
||||
::
|
||||
++ top-bloq
|
||||
=+ laz=cur
|
||||
|-
|
||||
?~ cur laz
|
||||
=. laz ?:(?=(%bloq -.p.q.i.cur) cur laz)
|
||||
=. laz ?:(?=($bloq -.p.q.i.cur) cur laz)
|
||||
$(cur t.cur)
|
||||
--
|
||||
::
|
||||
@ -692,23 +694,23 @@
|
||||
^+ self
|
||||
=. sap 0
|
||||
?+ -.nod self
|
||||
%html
|
||||
$html
|
||||
self(p.nod (flop p.nod))
|
||||
%code
|
||||
$code
|
||||
=< self(q.nod (flop q.nod))
|
||||
|-
|
||||
?^ p.nod .
|
||||
?~ q.nod .
|
||||
?: (blank (trip i.q.nod)) $(q.nod t.q.nod)
|
||||
.
|
||||
%para
|
||||
$para
|
||||
?~ p.nod self(nod [%defn ~])
|
||||
=+ olt=tub
|
||||
=. q.tub
|
||||
=- (trip (role -))
|
||||
%+ turn
|
||||
;;((list ,[%$ p=tape]) (flop p.nod)) :: XX do type stuff
|
||||
|=([@ a=tape] (crip a))
|
||||
;;((list {$$ p+tape}) (flop p.nod)) :: XX do type stuff
|
||||
|=({@ a+tape} (crip a))
|
||||
|- ^+ self
|
||||
=^ ren tub (snack (leas href):inli)
|
||||
?^ ren
|
||||
@ -720,16 +722,16 @@
|
||||
==
|
||||
::
|
||||
++ push :: open block
|
||||
|= nit=(loca ,_p:*tops) ^+ +>
|
||||
|= nit+(loca __(p:*tops)) ^+ +>
|
||||
=. self cull
|
||||
=+ toz=[q.nit ~]
|
||||
?. ?=([%list ^] q.nit)
|
||||
?. ?=({$list ^} q.nit)
|
||||
(shove p.nit toz)
|
||||
=. self (shove p.nit toz)
|
||||
(shove p.nit [%item ~]~)
|
||||
::
|
||||
++ shove
|
||||
|= a=(loca tops) ^+ +>
|
||||
|= a+(loca tops) ^+ +>
|
||||
?~ cur +>(cur [a cur])
|
||||
:: =* cub q.i.cur
|
||||
?. ?=(nesting [-.p.q.i.cur -.q.a])
|
||||
@ -737,20 +739,20 @@
|
||||
+>(cur [a cur])
|
||||
::
|
||||
++ pump :: push leaf block
|
||||
|= a=$&([p=node q=@u] node)
|
||||
|= a+_&({p+node q+@u} node)
|
||||
^+ +>
|
||||
=+ nex=cull
|
||||
?@ -.a nex(nod a)
|
||||
nex(nod p.a, sap q.a)
|
||||
::
|
||||
++ match :: check top element
|
||||
|= a=elem ^- ?
|
||||
|= a+elem ^- ?
|
||||
?~ cur |
|
||||
=(-.a -.q.i.cur)
|
||||
::
|
||||
::
|
||||
++ collapse :: skim elems off top
|
||||
|= a=(list (pair ,@ tops)) ^+ +>
|
||||
|= a+(list (pair @ tops)) ^+ +>
|
||||
?~ a +>
|
||||
:: ?: ?=([[@ *] ~] a) +>
|
||||
~? bug yank/[i.a blos]
|
||||
@ -762,55 +764,55 @@
|
||||
++ offset
|
||||
^- @u
|
||||
?~ cur 0
|
||||
?: ?=(%bloq -.p.q.i.cur)
|
||||
?: ?=($bloq -.p.q.i.cur)
|
||||
p.i.cur
|
||||
offset(cur t.cur)
|
||||
::
|
||||
++ delist (pop-til top-list):bye
|
||||
++ debloq
|
||||
|= ruc=_(flop cur)
|
||||
|= ruc+__((flop cur))
|
||||
^+ self
|
||||
?~ ruc self
|
||||
?. ?=(%bloq -.p.q.i.ruc)
|
||||
?. ?=($bloq -.p.q.i.ruc)
|
||||
$(ruc t.ruc)
|
||||
(collapse (flop ruc))
|
||||
::
|
||||
++ nil-li
|
||||
?& ?=(%defn -.nod)
|
||||
?& ?=($defn -.nod)
|
||||
?=(^ cur)
|
||||
?=([[%item ~] ~] q.i.cur)
|
||||
?=({{$item $~} $~} q.i.cur)
|
||||
==
|
||||
++ widen ^+ cur :: list loosening
|
||||
=< ?~ cur ~
|
||||
?. ?=(%item -.p.q.i.cur)
|
||||
?. ?=($item -.p.q.i.cur)
|
||||
(. cur)
|
||||
[i.cur (. t.cur)]
|
||||
|= a=_cur ^+ a
|
||||
|= a=__(cur) ^+ a
|
||||
~? > bug naro/[debu nil-li a cur]
|
||||
?~ a a
|
||||
?: ?=([[%item ~] ~] q.i.a)
|
||||
?: ?=({{$item $~} $~} q.i.a)
|
||||
a
|
||||
?. ?=(%list -.p.q.i.a)
|
||||
?. ?=($list -.p.q.i.a)
|
||||
[i.a $(a t.a)]
|
||||
a(p.p.q.i |)
|
||||
::
|
||||
++ blos :: extract elem list
|
||||
(flop (turn cur |*([@ a=tops] a)))
|
||||
(flop (turn cur |*({@ a+tops} a)))
|
||||
::
|
||||
++ eat-line :: high-level line nom
|
||||
^+ .
|
||||
~? >> bug line/curlin
|
||||
:: => [bup=bun sepa:eat]
|
||||
:: ?: bun:+ + :: blank line nommed
|
||||
:: ?: bun:+ + :: blank line nommed
|
||||
:: =< .(bun |)
|
||||
:: =. bun bup
|
||||
~? bug line-stat/[debu cur]
|
||||
?: ?=(%html -.nod)
|
||||
?: ?=($html -.nod)
|
||||
=+ sep=(sepa:eat)
|
||||
?: bun.sep sep
|
||||
span:eat.+
|
||||
=> [ruc .]=olds:eat
|
||||
?: &(?=(~ ruc) ?=([%code ^ *] nod))
|
||||
?: &(?=($~ ruc) ?=({$code ^ *} nod))
|
||||
code:eat
|
||||
=+ sep=(sepa:eat ruc)
|
||||
?: bun.sep
|
||||
@ -831,8 +833,8 @@
|
||||
++ eat
|
||||
|%
|
||||
++ sepa :: consume blank line
|
||||
|= ruc=_(flop cur) ^+ self
|
||||
?: ?=([%code ^ *] nod) :: ignore in blocks
|
||||
|= ruc+__((flop cur)) ^+ self
|
||||
?: ?=({$code ^ *} nod) :: ignore in blocks
|
||||
self
|
||||
=^ buf tub (snack ;~(sfix (star ace) nal))
|
||||
?~ buf
|
||||
@ -844,9 +846,9 @@
|
||||
=. bun &
|
||||
(debloq ruc)
|
||||
?+ -.nod self
|
||||
%para cull
|
||||
%html cull
|
||||
%code =- self(q.nod -)
|
||||
$para cull
|
||||
$html cull
|
||||
$code =- self(q.nod -)
|
||||
?~ q.nod q.nod
|
||||
[(crip (slag 4 u.buf)) q.nod]
|
||||
==
|
||||
@ -865,20 +867,21 @@
|
||||
?~ ruc [ruc self]
|
||||
~? bug heat/[debu q.i.ruc cur]
|
||||
?- -.p.q.i.ruc
|
||||
%bloq
|
||||
$bloq
|
||||
=^ neu tub (snack blomar:donp)
|
||||
?^ neu $(ruc t.ruc, ovs p.i.ruc)
|
||||
[ruc self]
|
||||
%list
|
||||
::
|
||||
$list
|
||||
?~ t.ruc !!
|
||||
:: $(t.ruc [p.i.ruc [%item ~] ~]~) :: XX why this
|
||||
?> ?=(%item -.p.q.i.t.ruc)
|
||||
?> ?=($item -.p.q.i.t.ruc)
|
||||
~? bug leat/[p.i.t.ruc debu]
|
||||
=^ den tub (snack (stun [p p]:i.t.ruc ace))
|
||||
?^ den $(ruc t.t.ruc)
|
||||
?. =(self horz) [ruc self] :: XX efficiency
|
||||
?: ?=([%code ^ *] nod)
|
||||
[~ self] :: XX correct?
|
||||
?. =(self horz) [ruc self] :: XX efficiency
|
||||
?: ?=({$code ^ *} nod)
|
||||
[~ self] :: XX correct?
|
||||
=^ neu tub (snake limar:donp)
|
||||
?~ neu [ruc self]
|
||||
=> .(q.u.neu ^+(p.q.i.ruc q.u.neu)) :: XX do type stuff
|
||||
@ -887,17 +890,18 @@
|
||||
[~ (push u.neu)]
|
||||
=. self (collapse (flop t.ruc))
|
||||
[~ (push p.u.neu [%item ~])]
|
||||
%item
|
||||
::
|
||||
$item
|
||||
!!
|
||||
==
|
||||
::
|
||||
++ aces |=(a=@u ^+(tub +:(snack (stun 0^a ace)))) :: nom optional leading
|
||||
++ aces |=(a+@u ^+(tub +:(snack (stun 0^a ace)))) :: nom optional leading
|
||||
::
|
||||
++ lazy :: errant prev bloqs
|
||||
|= ruc=(list (pair ,@ tops))
|
||||
|= ruc+(list (pair @ tops))
|
||||
^+ self
|
||||
~? bug laze/[debu ruc]
|
||||
?. ?=(%para -.nod)
|
||||
?. ?=($para -.nod)
|
||||
(collapse (flop ruc))
|
||||
?: |([?=(^ -)]:lead [?=(^ -)]:(snack leaf:donp)) :: XX efficiency
|
||||
(collapse (flop ruc))
|
||||
@ -930,14 +934,14 @@
|
||||
^+ self
|
||||
~? bug neat/curlin
|
||||
::=. self ?.(bun self cull)
|
||||
?^ [q]:((leas htm-head):donp tub) :: XX efficiency
|
||||
(pump [%html ~])
|
||||
?^ [q]:((leas htm-head):donp tub) :: XX efficiency
|
||||
(pump [%html ~])
|
||||
=+ ^= hez
|
||||
%+ stag %heas
|
||||
?. ?=([%para [%$ *] ~] nod)
|
||||
?. ?=({$para {$$ *} $~} nod)
|
||||
fail
|
||||
;~(plug setext:donp (cold p.nod (ahed eol)))
|
||||
=+ ico=?:(?=(%para -.nod) fail icode:donp)
|
||||
=+ ico=?:(?=($para -.nod) fail icode:donp)
|
||||
=+ saf=q.p.+:(snack (star ace)) :: XX efficiency
|
||||
=^ neu tub
|
||||
(snack ;~(pose hez ico leaf:donp))
|
||||
@ -946,21 +950,21 @@
|
||||
?.(bun cur widen)
|
||||
?~ neu
|
||||
=. tub +:(snack (star ace))
|
||||
?. ?=(%para -.nod)
|
||||
?. ?=($para -.nod)
|
||||
cull
|
||||
self
|
||||
?+ -.u.neu (pump u.neu)
|
||||
%heas self(nod u.neu(- %head)) :: replace extant para
|
||||
%code ?^ p.u.neu
|
||||
$heas self(nod u.neu(- %head)) :: replace extant para
|
||||
$code ?^ p.u.neu
|
||||
(pump u.neu (dec saf))
|
||||
?: ?=([%code ~ *] nod)
|
||||
?: ?=({$code $~ *} nod)
|
||||
self
|
||||
(pump u.neu)
|
||||
==
|
||||
::
|
||||
++ code
|
||||
^+ self
|
||||
?> ?=([%code ^ *] nod) :: XX do type stuff
|
||||
?> ?=({$code ^ *} nod) :: XX do type stuff
|
||||
~? bug ceas/[sap]
|
||||
=. tub (aces sap)
|
||||
=+ [neu tup]=(snack ;~(sfix (leas fcode):donp eol))
|
||||
@ -983,15 +987,15 @@
|
||||
|-
|
||||
?~ u.lin
|
||||
?+ -.nod cull
|
||||
%code self
|
||||
%html self(p.nod ['' p.nod])
|
||||
$code self
|
||||
$html self(p.nod ['' p.nod])
|
||||
==
|
||||
?+ -.nod (pump para/~[`u.lin])
|
||||
%para self(p.nod :_(p.nod `u.lin))
|
||||
%head ?^ q.nod $(self cull)
|
||||
$para self(p.nod :_(p.nod `u.lin))
|
||||
$head ?^ q.nod $(self cull)
|
||||
self(q.nod [`(dehax u.lin)]~)
|
||||
%code self(q.nod :_(q.nod (crip u.lin)))
|
||||
%html self(p.nod :_(p.nod (crip u.lin)))
|
||||
$code self(q.nod :_(q.nod (crip u.lin)))
|
||||
$html self(p.nod :_(p.nod (crip u.lin)))
|
||||
==
|
||||
::
|
||||
--
|
||||
|
@ -4,46 +4,46 @@
|
||||
::
|
||||
|%
|
||||
++ into-inner
|
||||
|= [a=marl b=manx]
|
||||
|= {a+marl b+manx}
|
||||
?~ c.b b(c a)
|
||||
$(b i.c.b)
|
||||
::
|
||||
++ flat
|
||||
|= a=marl
|
||||
|= a+marl
|
||||
^- tape
|
||||
?~ a ~
|
||||
%- weld :_ $(a t.a)
|
||||
^- tape
|
||||
?~ n.g.i.a
|
||||
?>(?=(_:/(**) i.a) v.i.a.g.i.a)
|
||||
?>(?=(__(:/(**)) i.a) v.i.a.g.i.a)
|
||||
?+ n.g.i.a $(a c.i.a)
|
||||
%img
|
||||
$img
|
||||
%- zing ^- wall
|
||||
%+ murn a.g.i.a |= [a=mane b=tape]
|
||||
%+ murn a.g.i.a |= {a+mane b+tape}
|
||||
^- (unit tape)
|
||||
?+ a ~
|
||||
%alt [~ b]
|
||||
$alt [~ b]
|
||||
==
|
||||
==
|
||||
++ sanitize
|
||||
|= a=marl ^- tape
|
||||
|= a+marl ^- tape
|
||||
=- (zing `wall`(scan (flat a) fel))
|
||||
=< fel=;~(sfix (star ;~(plug (cold '-' -) (plus +))) (star next))
|
||||
[(star ;~(less aln prn)) ;~(pose nud low (cook |=(a=@ (add a ' ')) hig))]
|
||||
[(star ;~(less aln prn)) ;~(pose nud low (cook |=(a+@ (add a ' ')) hig))]
|
||||
::
|
||||
++ sang :: tight item children
|
||||
|= a=(list elem)
|
||||
|= a+(list elem)
|
||||
^- marl
|
||||
?~ a ~
|
||||
%- weld :_ $(a t.a)
|
||||
?. ?=(%para -.i.a)
|
||||
?. ?=($para -.i.a)
|
||||
(sing i.a ~)
|
||||
(sung p.i.a)
|
||||
::
|
||||
++ sing :: elem to manx
|
||||
=> |%
|
||||
++ first-word
|
||||
|= a=tape
|
||||
|= a+tape
|
||||
=. a (trip (crip a)) :: XX valid tapes
|
||||
^- (unit tape)
|
||||
=. a q.q:(need q:((star ace) [1 1] a))
|
||||
@ -52,7 +52,7 @@
|
||||
(some (wonk vex))
|
||||
--
|
||||
=+ [tig=| had=*(unit mane)]
|
||||
|= lum=(list elem)
|
||||
|= lum+(list elem)
|
||||
|^ ^- marl
|
||||
=+ a=apex
|
||||
?~ q.a
|
||||
@ -60,12 +60,12 @@
|
||||
(weld p.a $(lum q.a))
|
||||
::
|
||||
++ apex
|
||||
^- [p=marl q=_lum]
|
||||
^- {p+marl q+__(lum)}
|
||||
?~ lum
|
||||
?~ had [~ ~]
|
||||
(lose "unclosed {<u.had>}")
|
||||
=> [ele=i.lum .(lum t.lum)]
|
||||
?. ?=(%html -.ele)
|
||||
?. ?=($html -.ele)
|
||||
(push (reso ele) ~)
|
||||
:: begin reparsing of html that the spec jankily lets through ::
|
||||
=+ tex=(trip (role p.ele))
|
||||
@ -90,45 +90,45 @@
|
||||
(lose "close {<u.tal>}")
|
||||
:: end reparsing of html that the spec jankily lets through ::
|
||||
::
|
||||
++ lose |=(a=tape [[;lost:"{a}"]~ lum])
|
||||
++ lose |=(a+tape [[;lost:"{a}"]~ lum])
|
||||
++ chomp
|
||||
|* [tap=tape fel=rule]
|
||||
^- [(unit ,_(wonk *fel)) _lum]
|
||||
|* {tap+tape fel+rule}
|
||||
^- {(unit __((wonk *fel))) __(lum)}
|
||||
=+ vex=(fel 1^1 tap)
|
||||
?~ q.vex [~ lum]
|
||||
:- [~ (wonk vex)]
|
||||
?~(q.q.u.q.vex lum [[%html (lore (crip q.q.u.q.vex))] lum])
|
||||
::
|
||||
++ push
|
||||
|= a=marl
|
||||
|= a+marl
|
||||
^+ apex
|
||||
?~ a apex
|
||||
[[b p] q]:[b=i.a (push t.a)]
|
||||
::
|
||||
++ reso
|
||||
|= a=elem
|
||||
|= a+elem
|
||||
?^ -.a
|
||||
=. tig ?.(?=(%list -.p.a) tig p.p.a)
|
||||
?: &(tig ?=(%item -.p.a))
|
||||
=. tig ?.(?=($list -.p.a) tig p.p.a)
|
||||
?: &(tig ?=($item -.p.a))
|
||||
[/li (sang q.a)]
|
||||
%+ into-inner ^$(lum q.a)
|
||||
?- -.p.a
|
||||
%bloq ;blockquote;
|
||||
%item ;li;
|
||||
%list ?@ q.p.a ;ul;
|
||||
$bloq ;blockquote;
|
||||
$item ;li;
|
||||
$list ?@ q.p.a ;ul;
|
||||
?: =(1 p.q.p.a) ;ol;
|
||||
=+ num=(pojo (jone p.q.p.a))
|
||||
;ol(start num);
|
||||
==
|
||||
?- -.a :: :/("unimplemented {<p.a>}")
|
||||
%html !! :: handled earlier XX do type stuff
|
||||
%para [/p (sung p.a)]
|
||||
%head
|
||||
$html !! :: handled earlier XX do type stuff
|
||||
$para [/p (sung p.a)]
|
||||
$head
|
||||
=+ [hed=(add %h0 (lsh 3 1 p.a)) kid=(sung q.a)]
|
||||
[[hed id/(sanitize kid) ~] kid]
|
||||
::
|
||||
%hrul ;hr;
|
||||
%meta =+ jon=`json`o/(~(run by p.a) |=(cord s/+<))
|
||||
$hrul ;hr;
|
||||
$meta =+ jon=`json`o/(~(run by p.a) |=(cord s/+<))
|
||||
;meta(value "{(pojo jon)}", name "frontmatter", urb_front "");
|
||||
:: %html
|
||||
::=+ tex=(role (turn p.a crip))
|
||||
@ -138,17 +138,17 @@
|
||||
::?^ - :/(~)
|
||||
::;lost: {<p.a>}
|
||||
:: :/([(role (turn p.a crip))]~) :: XX haaaaaaack
|
||||
%defn :/(~)
|
||||
%code =+ lan=?~(p.a ~ (first-word r.u.p.a))
|
||||
$defn :/(~)
|
||||
$code =+ lan=?~(p.a ~ (first-word r.u.p.a))
|
||||
=+ tex=(trip (role q.a))
|
||||
?~ lan ;pre:code:"{tex}"
|
||||
;pre:code(class "language-{u.lan}"):"{tex}"
|
||||
|
||||
==
|
||||
--
|
||||
::
|
||||
::
|
||||
++ sung
|
||||
|= lim=kids
|
||||
|= lim+kids
|
||||
=+ had=*(unit mane)
|
||||
|^ ^- marl
|
||||
=+ a=apex
|
||||
@ -157,14 +157,14 @@
|
||||
(weld p.a $(lim q.a))
|
||||
::
|
||||
++ apex
|
||||
^- [p=marl q=_lim]
|
||||
^- {p+marl q+__(lim)}
|
||||
?~ lim
|
||||
?~ had [~ ~]
|
||||
(lose "unclosed {<u.had>}")
|
||||
=> [ele=i.lim .(lim t.lim)]
|
||||
?. ?=(%htmt -.ele)
|
||||
?: &(?=(%$ -.ele) ?=([[%$ *] *] lim))
|
||||
apex(p.i.lim (weld p.ele p.i.lim))
|
||||
?. ?=($htmt -.ele)
|
||||
?: &(?=($$ -.ele) ?=({{$$ *} *} lim))
|
||||
apex(p.i.lim (weld p.ele p.i.lim))
|
||||
(push (reso ele) ~)
|
||||
=+ tex=(trip p.ele)
|
||||
=^ emo lim (chomp tex empt:poxa)
|
||||
@ -185,25 +185,25 @@
|
||||
(lose "unclosed {<u.had>}")
|
||||
(lose "unopened {<u.tal>}")
|
||||
::
|
||||
++ lose |=(a=tape [[;lost:"{a}"]~ lim])
|
||||
++ lose |=(a+tape [[;lost:"{a}"]~ lim])
|
||||
++ chomp
|
||||
|* [tap=tape fel=rule]
|
||||
^- [(unit ,_(wonk *fel)) _lim]
|
||||
|* {tap+tape fel+rule}
|
||||
^- {(unit __((wonk *fel))) __(lim)}
|
||||
=+ vex=(fel 1^1 tap)
|
||||
?~ q.vex [~ lim]
|
||||
:- [~ (wonk vex)]
|
||||
?~(q.q.u.q.vex lim [[%htmt (crip q.q.u.q.vex)] lim])
|
||||
::
|
||||
++ push
|
||||
|= a=marl
|
||||
|= a+marl
|
||||
^+ apex
|
||||
?~ a apex
|
||||
[[b p] q]:[b=i.a (push t.a)]
|
||||
::
|
||||
++ urly
|
||||
|= a=tape ^- tape
|
||||
|= a+tape ^- tape
|
||||
?~ a ~
|
||||
:: ?: (gth i.a 0xff) "XX" :: XX
|
||||
:: ?: (gth i.a 0xff) "XX" :: XX
|
||||
?: ?| [?=(^ q)]:(alp 1^1 a)
|
||||
(~(has in (sa "!*'();:@&=+$,/?#%.~_")) i.a) :: XX reparse
|
||||
==
|
||||
@ -211,16 +211,16 @@
|
||||
(weld (urle (trip i.a)) $(a t.a))
|
||||
::
|
||||
++ reso
|
||||
|= b=inline
|
||||
|= b+inline
|
||||
^- manx
|
||||
?@ -.b
|
||||
?- -.b
|
||||
%$ :/(p.b)
|
||||
%line ;br;
|
||||
%code ;code:"{p.b}"
|
||||
%htmt !! ::p.b :: handled earlier :: XX do type stuff
|
||||
$$ :/(p.b)
|
||||
$line ;br;
|
||||
$code ;code:"{p.b}"
|
||||
$htmt !! ::p.b :: handled earlier :: XX do type stuff
|
||||
==
|
||||
?: ?=(%blot -.p.b)
|
||||
?: ?=($blot -.p.b)
|
||||
=+ res=`manx`;img(src (urly p.p.b), alt (flat (turn q.b ..$)));
|
||||
:: ;img@"{p.p.b}";
|
||||
?~ q.p.b res
|
||||
@ -228,12 +228,12 @@
|
||||
=+ kid=(sung q.b)
|
||||
%+ into-inner kid
|
||||
?- p.b
|
||||
[%emph ?] ?.(p.p.b ;em; ;strong;)
|
||||
[%delt ~] ;del;
|
||||
[%link ^] =+ url=(urly p.p.b)
|
||||
=. url ?^(url url "#{(sanitize kid)}")
|
||||
?~ q.p.b ;a/"{url}";
|
||||
;a/"{url}"(title u.q.p.b);
|
||||
{$emph ?} ?.(p.p.b ;em; ;strong;)
|
||||
{$delt $~} ;del;
|
||||
{$link ^} =+ url=(urly p.p.b)
|
||||
=. url ?^(url url "#{(sanitize kid)}")
|
||||
?~ q.p.b ;a/"{url}";
|
||||
;a/"{url}"(title u.q.p.b);
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -20,7 +20,7 @@
|
||||
(rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: with bitmasks
|
||||
-- ::
|
||||
++ go :: play from
|
||||
|_ [src=ship game] ::
|
||||
|_ {src+ship game} ::
|
||||
++ at |_ point :: per point
|
||||
++ g `game`+>+<+ :: game
|
||||
++ k &(!|(x o) ept) :: legal move
|
||||
@ -45,7 +45,7 @@
|
||||
++ res ?. |(~(win bo box) ~(win bo boo)) :: possible result
|
||||
?: =(511 (con boo box)) ::
|
||||
`"tie :-(" ~ `"{<nam>} wins" ::
|
||||
++ row |= y=@ :- (add y '1') %- zing :: print row
|
||||
++ row |= y+@ :- (add y '1') %- zing :: print row
|
||||
(turn (gulf 0 3) |=(@ ~[' ' ~(v at y +<)])) ::
|
||||
++ str =+ [own ~[(icon who)]] ^- tape :: print player
|
||||
?~(-< -> (scow %p u.-<)) ::
|
||||
|
@ -119,12 +119,12 @@
|
||||
", "
|
||||
=- (pojo (jobe (turn a.g.src -)))
|
||||
|= {a+mane b+tape}
|
||||
=. a ?+(a a %class 'className')
|
||||
=. a ?+(a a $class 'className')
|
||||
?^(a !! [a (jape b)])
|
||||
", "
|
||||
=< ~(ram re %rose [", " "[" "]"] (turn c.src .))
|
||||
|= a+manx
|
||||
?: ?=(_:/(**) a)
|
||||
?: ?=(__(:/(**)) a)
|
||||
leaf/(pojo (jape v.i.a.g.a))
|
||||
leaf/^$(src a)
|
||||
")"
|
||||
|
@ -4,11 +4,11 @@
|
||||
::
|
||||
/? 310
|
||||
!:
|
||||
|_ cod=cord
|
||||
|_ cod+cord
|
||||
::
|
||||
++ grab :: converter arm
|
||||
|%
|
||||
++ noun ,@t :: clam from noun
|
||||
++ noun @t :: clam from noun
|
||||
++ json (cork (ot authcode/so platform/so ~):jo need) :: (need (so:jo jon))
|
||||
--
|
||||
--
|
||||
|
@ -1,9 +1,9 @@
|
||||
!:
|
||||
|_ cod=cord
|
||||
|_ cod+cord
|
||||
::
|
||||
++ grab :: converter am
|
||||
|%
|
||||
++ noun ,@t :: clam from noun
|
||||
++ json (cork (ot secret/so platform/so ~):jo need) :: (need (so:jo jon))
|
||||
++ noun @t :: clam from noun
|
||||
++ json (cork (ot secret/so platform/so ~):jo need)
|
||||
--
|
||||
--
|
||||
|
@ -18,7 +18,7 @@
|
||||
%. jon => jo %- ot
|
||||
:~ mod/(cu ^sa (ar (su (perk ~[%ctrl %shift %alt %meta]))))
|
||||
:- %key
|
||||
%+ cu |*(a=$%([%str @t] [%act @]) ?+(-.a a %str +.a))
|
||||
%+ cu |*(a+_%({$str @t} {$act @}) ?+(-.a a $str +.a))
|
||||
=- (of str/so act/(su (perk -)) ~)
|
||||
:~ %ctrl %shift %alt %meta %entr %esc %caps %uncap
|
||||
%pgup %pgdn %home %end %baxp %del %ins
|
||||
@ -39,19 +39,19 @@
|
||||
=+ cha=(tuba (trip q.kev))
|
||||
?> ?=({@ $~} cha) :: of a single character
|
||||
?+ mod !! :: modified by one buckykey
|
||||
{$ctrl ~ ~} [%ctl i.cha]
|
||||
{$alt ~ ~} [%met i.cha]
|
||||
{$ctrl $~ $~} [%ctl i.cha]
|
||||
{$alt $~ $~} [%met i.cha]
|
||||
==
|
||||
?@ q.kev
|
||||
[%txt (tuba (trip q.kev))]
|
||||
?+ +.q.kev !!
|
||||
%del [%del ~]
|
||||
%baxp [%bac ~]
|
||||
%entr [%ret ~]
|
||||
%up [%aro %u]
|
||||
%down [%aro %d]
|
||||
%left [%aro %l]
|
||||
%right [%aro %r]
|
||||
$del [%del ~]
|
||||
$baxp [%bac ~]
|
||||
$entr [%ret ~]
|
||||
$up [%aro %u]
|
||||
$down [%aro %d]
|
||||
$left [%aro %l]
|
||||
$right [%aro %r]
|
||||
== :: %yow, %rez?
|
||||
::
|
||||
++ noun dill-belt :: clam from %noun
|
||||
|
@ -5,7 +5,7 @@
|
||||
!:
|
||||
::::
|
||||
::
|
||||
=+ point=,[x=@ y=@]
|
||||
=+ point={x+@ y+@}
|
||||
|_ point
|
||||
::
|
||||
++ grab :: convert from
|
||||
|
@ -17,12 +17,12 @@
|
||||
|%
|
||||
++ json ^- ^json :: to %json
|
||||
~! +>-<
|
||||
?: ?=(| +>-<)
|
||||
?: ?=($| +>-<)
|
||||
~! +>-<
|
||||
~! p
|
||||
s/(crip p)
|
||||
=+ she=|=(ship s/(scot %p +<))
|
||||
=+ hes=|=([ship *] (she +<-))
|
||||
=+ hes=|=({ship *} (she +<-))
|
||||
%- jobe
|
||||
:~ who/s/?:(who.p %x %o)
|
||||
plx/?~(p.sag.p ~ (she u.p.sag.p))
|
||||
|
@ -10,7 +10,7 @@
|
||||
|= {tym+@da ite+cord} ^- manx
|
||||
;li: ;{b "{<tym>}"}: {(trip ite)}
|
||||
++ sorted-list
|
||||
(sort (~(tap by dat)) |=([[l=@ @] [r=@ @]] (lth l r)))
|
||||
(sort (~(tap by dat)) |=({{l+@ @} {r+@ @}} (lth l r)))
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
|
@ -40,7 +40,7 @@
|
||||
%- cu :_ (ar a)
|
||||
~(gas in *(set __((need *a))))
|
||||
::
|
||||
++ lake |*(a+__(*) $+(json (unit a)))
|
||||
++ lake |*(a+__(*) _+(json (unit a)))
|
||||
++ peach
|
||||
|* a+{rule rule}
|
||||
|= tub+nail
|
||||
@ -57,7 +57,7 @@
|
||||
::
|
||||
::
|
||||
++ thot
|
||||
^- $+(json (unit thought))
|
||||
^- _+(json (unit thought))
|
||||
%- ot :~
|
||||
serial/(ci (slat %uv) so)
|
||||
audience/audi
|
||||
@ -107,7 +107,7 @@
|
||||
==
|
||||
::
|
||||
++ conf
|
||||
^- $+(json (unit config))
|
||||
^- _+(json (unit config))
|
||||
%- ot :~
|
||||
sources/(as (su parn))
|
||||
caption/so
|
||||
|
@ -75,7 +75,7 @@
|
||||
{$&} (stat p.a)
|
||||
{$|} %- crip
|
||||
?- -.p.a
|
||||
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
|
||||
$twitter "{(trip -.p.a)}/{(trip p.p.a)}"
|
||||
==
|
||||
==
|
||||
::
|
||||
|
@ -23,7 +23,7 @@
|
||||
?+ b ~
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
|= {c+term d+fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - (some >[c (turn (~(tap by p.b)) head)]<)
|
||||
=+ (d u)
|
||||
@ -36,8 +36,8 @@
|
||||
%. ((of:jo a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= {c+term d+fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
@ -141,7 +141,7 @@
|
||||
%. ((of:jo a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= {c+term d+fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
@ -171,7 +171,7 @@
|
||||
=- ~! gar ~! (need -) -
|
||||
((sef) jon)
|
||||
::
|
||||
++ lake |*(a=__(*) $+(json (unit a)))
|
||||
++ lake |*(a=__(*) _+(json (unit a)))
|
||||
++ head-rush
|
||||
|* a+rule
|
||||
|* {b+cord c+*}
|
||||
@ -238,23 +238,23 @@
|
||||
(jobe ship/(jope p) thought/(thot q) ~)
|
||||
::
|
||||
++ jove
|
||||
|= [a=envelope b=delivery]
|
||||
|= {a+envelope b+delivery}
|
||||
%- jobe :~
|
||||
envelope/(jobe visible/[%b p.a] sender/?~(q.a ~ s/(parn u.q.a)) ~)
|
||||
delivery/[%s b]
|
||||
==
|
||||
::
|
||||
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
|
||||
++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))])
|
||||
++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
|
||||
++ jope |=(a+ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
|
||||
++ joke |=(a+tank [%s (role (turn (wash 0^80 a) crip))])
|
||||
++ jode |=(a+time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
|
||||
++ jome :: stringify keys
|
||||
|* [a=_cord b=_json]
|
||||
|= c=(map ,_+<.a ,_+<.b)
|
||||
|* {a+__(cord) b+__(json)}
|
||||
|= c=(map __(+<.a) __(+<.b))
|
||||
(jobe (turn (~(tap by c)) (both a b)))
|
||||
::
|
||||
++ both :: cons two gates
|
||||
|* [a=_,* b=_,*]
|
||||
|=(c=_[+<.a +<.b] [(a -.c) (b +.c)])
|
||||
|* {a+__(*) b+__(*)}
|
||||
|=(c+__([+<.a +<.b]) [(a -.c) (b +.c)])
|
||||
::
|
||||
++ thot
|
||||
|= thought
|
||||
@ -262,7 +262,7 @@
|
||||
::
|
||||
++ audi (jome parn jove)
|
||||
++ bouq
|
||||
|= a=bouquet
|
||||
|= a+bouquet
|
||||
a/(turn (~(tap in a)) |=(b=path a/(turn b |=(c=span s/c))))
|
||||
::
|
||||
++ parn
|
||||
@ -271,7 +271,7 @@
|
||||
{$&} (stat p.a)
|
||||
{$|} %- crip
|
||||
?- -.p.a
|
||||
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
|
||||
$twitter "{(trip -.p.a)}/{(trip p.p.a)}"
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -284,7 +284,7 @@
|
||||
(jobe date/(jode p) bouquet/(bouq q) speech/(spec r) ~)
|
||||
::
|
||||
++ spec
|
||||
|= a=speech
|
||||
|= a+speech
|
||||
%+ joba -.a
|
||||
?+ -.a ~|(stub/-.a !!)
|
||||
$lin (jobe txt/[%s q.a] say/[%b p.a] ~)
|
||||
|
@ -4,7 +4,7 @@
|
||||
/? 314
|
||||
/- users
|
||||
!:
|
||||
|_ use=users
|
||||
|_ use+users
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
@ -18,8 +18,7 @@
|
||||
:- %a
|
||||
%+ turn
|
||||
use
|
||||
|=
|
||||
[p=@p q=@t]
|
||||
|= {p+@p q+@t}
|
||||
%- jobe
|
||||
~[[%ship (jape <p>)] [%name [%s q]]]
|
||||
++ mime
|
||||
|
@ -6,27 +6,27 @@
|
||||
::::
|
||||
::
|
||||
[work .]
|
||||
|_ mad=command
|
||||
|_ mad+command
|
||||
++ grab
|
||||
|% ++ noun command
|
||||
++ json
|
||||
=> [jo ..command]
|
||||
=< (corl need (cu |=(a=command a) coma))
|
||||
=< (corl need (cu |=(a+command a) coma))
|
||||
|%
|
||||
++ as
|
||||
:: |*(a=fist (cu sa (ar a))) :: XX types
|
||||
|* a=fist
|
||||
%- cu :_ (ar a)
|
||||
~(gas in *(set ,_(need *a)))
|
||||
~(gas in *(set __((need *a))))
|
||||
++ ot
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
|* a+(pole {@tas fist})
|
||||
|= b+json
|
||||
%. ((^ot a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= {c+term d+fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - (some >[c (turn (~(tap by p.b)) head)]<)
|
||||
=+ (d u)
|
||||
@ -34,14 +34,14 @@
|
||||
~
|
||||
==
|
||||
++ of
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
|* a+(pole {@tas fist})
|
||||
|= b+json
|
||||
%. ((of:jo a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= {c+term d+fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
=+ (d u)
|
||||
|
@ -9,11 +9,11 @@
|
||||
|_ client
|
||||
++ grow
|
||||
|% ++ json
|
||||
=+ jope=|=(a=ship [%s (rsh 3 1 (scot %p a))])
|
||||
=+ jope=|=(a+ship [%s (rsh 3 1 (scot %p a))])
|
||||
%- jobe :~
|
||||
sort/[%a (turn sort |=(a=@uv [%s (scot %uv a)]))]
|
||||
=< tasks/(jobe (turn (~(tap by tasks)) .))
|
||||
|= [@ client-task]
|
||||
|= {@ client-task}
|
||||
=+ tax
|
||||
:- (scot %uv id)
|
||||
%- jobe :~ id/[%s (scot %uv id)]
|
||||
|
@ -2,9 +2,9 @@
|
||||
::
|
||||
:::: /hoon/kyev/sur
|
||||
::
|
||||
=- ,[p=(set ?(%ctrl %shift %alt %meta)) q=$|(cord [%act speck])]
|
||||
=- {p+(set ?($ctrl $shift $alt $meta)) q=_|(cord {$act speck})}
|
||||
^= speck
|
||||
$? %ctrl %shift %alt %meta %entr %esc %caps %uncap
|
||||
%pgup %pgdn %home %end %baxp %del %ins
|
||||
%up %down %left %right
|
||||
_? $ctrl $shift $alt $meta $entr $esc $caps $uncap
|
||||
$pgup $pgdn $home $end $baxp $del $ins
|
||||
$up $down $left $right
|
||||
==
|
||||
|
@ -1,40 +1,39 @@
|
||||
|%
|
||||
|%
|
||||
++ down (list elem)
|
||||
++ kids (list inline)
|
||||
++ inline
|
||||
=+ ^= inlik
|
||||
$% [%emph p=?] :: strong?
|
||||
[%delt ~] :: strikethrough
|
||||
[%link p=tape q=(unit tape)]
|
||||
[%blot p=tape q=(unit tape)] :: image
|
||||
_% {$emph p+?} :: strong?
|
||||
{$delt $~} :: strikethrough
|
||||
{$link p+tape q+(unit tape)}
|
||||
{$blot p+tape q+(unit tape)} :: image
|
||||
==
|
||||
=+ ^= inlin
|
||||
$% [%$ p=tape]
|
||||
[%line ~]
|
||||
[%code p=tape]
|
||||
[%htmt p=cord] :: XX (each marx mane)
|
||||
_% {$$ p+tape}
|
||||
{$line $~}
|
||||
{$code p+tape}
|
||||
{$htmt p+cord} :: XX (each marx mane)
|
||||
==
|
||||
$&([p=inlik q=kids] inlin)
|
||||
_&({p+inlik q+kids} inlin)
|
||||
::
|
||||
::
|
||||
++ elem $&(tops node)
|
||||
++ elem _&(tops node)
|
||||
++ tops :: childful block
|
||||
$: $= p
|
||||
$% [%bloq ~]
|
||||
[%list p=? q=$|(char [p=@u q=char])] :: tight, ordered?
|
||||
[%item ~]
|
||||
_: _= p
|
||||
_% {$bloq $~}
|
||||
{$list p+? q+_|(char {p+@u q+char})} :: tight ordered?
|
||||
{$item $~}
|
||||
==
|
||||
q=down
|
||||
q+down
|
||||
==
|
||||
:: ++ mist |*(a=_,* ,[i=a t=$|(~ (mist a))]) :: .=(%mist +(%list))
|
||||
++ node :: childless block
|
||||
$% [%para p=kids]
|
||||
[%meta p=(map cord cord)] :: front matter
|
||||
[%hrul ~]
|
||||
[%head p=@u q=kids]
|
||||
[%code p=(unit ,[p=char q=@u r=tape]) q=wain] :: info, contents
|
||||
[%html p=wain]
|
||||
[%defn ~] :: empty para
|
||||
_% {$para p+kids}
|
||||
{$meta p+(map cord cord)} :: front matter
|
||||
{$hrul $~}
|
||||
{$head p+@u q+kids}
|
||||
{$code p+(unit {p+char q+@u r+tape}) q+wain} :: info contents
|
||||
{$html p+wain}
|
||||
{$defn $~} :: empty para
|
||||
==
|
||||
--
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
$% [%do p=@t]
|
||||
[%exp p=@t q=tank]
|
||||
[%say p=@t]
|
||||
_% {$do p+@t}
|
||||
{$exp p+@t q+tank}
|
||||
{$say p+@t}
|
||||
==
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct4/sur :::::: dependencies
|
||||
:::: /hoon/oct4/sur :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 ::
|
||||
:: :: ::
|
||||
:::: :::::: semantics
|
||||
:: :: ::
|
||||
|% ::
|
||||
++ board ,@ :: one-player bitfield
|
||||
++ point ,[x=@ y=@] :: coordinate
|
||||
++ board @ :: one-player bitfield
|
||||
++ point {x+@ y+@} :: coordinate
|
||||
++ stage (pair (unit ship) (unit ship)) :: players
|
||||
++ play (each game tape) :: update
|
||||
++ game :: game state
|
||||
$: who=? :: whose turn
|
||||
_: who=? :: whose turn
|
||||
sag=stage :: who's playing
|
||||
aud=(map ship ,@ud) :: who's watching
|
||||
aud=(map ship @ud) :: who's watching
|
||||
box=board :: X board
|
||||
boo=board :: O board
|
||||
== ::
|
||||
|
@ -1 +1 @@
|
||||
(list ,[p=@p q=@t])
|
||||
(list {p+@p q+@t})
|
||||
|
Loading…
Reference in New Issue
Block a user