mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
Merge branch 'master' into klay
Conflicts: urb/urbit.pill
This commit is contained in:
commit
c1a4aa7886
@ -1,4 +1,4 @@
|
||||
::
|
||||
!:
|
||||
:: batz (4b), shell
|
||||
::
|
||||
!:
|
||||
@ -75,6 +75,7 @@
|
||||
[%mess p=hasp q=ship r=cage] ::
|
||||
[%nuke p=hasp q=ship] ::
|
||||
[%show p=hasp q=ship r=path] ::
|
||||
[%wipe p=hasp] ::
|
||||
== == == ::
|
||||
++ rave :: see %clay
|
||||
$% [& p=mood] :: single request
|
||||
|
@ -407,26 +407,16 @@
|
||||
(flaw cof [%leaf "syntax error: {<p.p.vex>} {<q.p.vex>}"] ~)
|
||||
(fine cof p.u.q.vex)
|
||||
::
|
||||
++ fame :: naked structure
|
||||
++ fang :: protocol door
|
||||
|= [cof=cafe for=mark bek=beak]
|
||||
^- (bolt vase)
|
||||
=+ pax=/gate/[for]/str
|
||||
=+ pax=/core/[for]/pro
|
||||
=+ ^= bem ^- beam
|
||||
:_ pax
|
||||
?: =(p.bek our) bek
|
||||
=+ oak=[our %main %da now]
|
||||
?. =(~ (ska %cy (tope [oak pax]))) oak
|
||||
bek
|
||||
%+ cope (fade cof bem)
|
||||
|= [cof=cafe hyd=hood]
|
||||
%+ cope (ably:(meow bem ~) cof for hyd)
|
||||
|= [cof=cafe gen=twig]
|
||||
(maim cof pit gen)
|
||||
::
|
||||
++ fang :: protocol door
|
||||
|= [cof=cafe for=mark bek=beak]
|
||||
^- (bolt vase)
|
||||
=+ bem=`beam`[bek /core/[for]/pro]
|
||||
(cope (fade cof bem) abut:(meow bem ~))
|
||||
::
|
||||
++ fair :: hood parsing rule
|
||||
@ -640,18 +630,18 @@
|
||||
?. (slab %grab p.tux)
|
||||
(flaw cof [%leaf "ford: no grab: {<[for bek]>}"]~)
|
||||
=+ gab=(slap tux [%cnzy %grab])
|
||||
?. (slab %noun p.tux)
|
||||
?. (slab %noun p.gab)
|
||||
(flaw cof [%leaf "ford: no noun: {<[for bek]>}"]~)
|
||||
%+ cope (maul cof (slap gab [%cnzy %noun]) [%noun q.sam])
|
||||
|= [cof=cafe pro=vase]
|
||||
?: =(+<.q.pro q.sam)
|
||||
(flaw cof [%leaf "ford: invalid content: {<[for bek]>}"]~)
|
||||
(fine cof (slot 6 pro))
|
||||
(fine cof (slot 6 pro))
|
||||
(flaw cof [%leaf "ford: invalid content: {<[for bek]>}"]~)
|
||||
::
|
||||
++ lave :: validate
|
||||
|= [cof=cafe for=mark his=ship som=*]
|
||||
^- (bolt vase)
|
||||
((lake for [his %main [%da now]]) cof [%noun som])
|
||||
((lake for [our %main [%da now]]) cof [%noun som])
|
||||
::
|
||||
++ lane :: type infer
|
||||
|= [cof=cafe typ=type gen=twig]
|
||||
|
@ -27,6 +27,7 @@
|
||||
[%nuke p=hasp q=ship] :: clear duct
|
||||
[%rote p=sack q=term r=*] :: remote request
|
||||
[%roth p=sack q=term r=*] :: remote response
|
||||
[%wipe p=hasp] :: forget app
|
||||
== ::
|
||||
++ knob :: pending action
|
||||
$% [%boot ~] :: begin boot
|
||||
@ -204,6 +205,11 @@
|
||||
(gawk hen p.q.hic q.q.hic ((hard ,[@ud rook]) r.q.hic))
|
||||
?: ?=(%roth -.q.hic)
|
||||
(gawd hen p.q.hic q.q.hic ((hard ,[@ud roon]) r.q.hic))
|
||||
?: ?=(%wipe -.q.hic)
|
||||
=+ mat=(~(got by pol.all) p.p.q.hic)
|
||||
=. bum.mat (~(del by bum.mat) q.p.q.hic)
|
||||
=. pol.all (~(put by pol.all) p.p.q.hic mat)
|
||||
[p=~ q=..^$]
|
||||
|- ^- [p=(list move) q=_..^^$]
|
||||
=+ =| law=(unit cuff)
|
||||
|- ^- $: law=(unit cuff)
|
||||
@ -784,6 +790,7 @@
|
||||
%= +>.$
|
||||
sup.sat (~(del by sup.sat) ost)
|
||||
pus.sat (~(del ju pus.sat) pax ost)
|
||||
peq.sat (~(del by peq.sat) ost)
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -941,6 +948,7 @@
|
||||
qic.sat ~
|
||||
sup.sat (~(del by sup.sat) ost)
|
||||
pus.sat (~(del ju pus.sat) pax ost)
|
||||
peq.sat (~(del by peq.sat) ost)
|
||||
==
|
||||
::
|
||||
%mess
|
||||
|
@ -28,7 +28,7 @@
|
||||
; xhr.onload = function() { mess++; }
|
||||
; xhr.open("PUT", "/tim/" + [user, port, mess].join("/"));
|
||||
; xhr.setRequestHeader("content-type", "text/json");
|
||||
; xhr.send(JSON.stringify({oryx: oryx, xyro: {appl: appl}}));
|
||||
; xhr.send(JSON.stringify({oryx: oryx, xyro: {ship: ship, appl: appl, data: {}}}));
|
||||
; }
|
||||
==
|
||||
==
|
||||
|
@ -4,6 +4,7 @@
|
||||
=> %= .
|
||||
+
|
||||
=> +
|
||||
=* sed .
|
||||
=> ^/===/lib/pony
|
||||
=+ ^= flag
|
||||
$? %leet
|
||||
@ -78,7 +79,7 @@
|
||||
^- (unit ,[p=@t q=tank])
|
||||
=+ hun=(rush a wide:vast)
|
||||
?~ hun ~
|
||||
?~(a ~ [~ a (sell (slap seed u.hun))])
|
||||
?~(a ~ [~ a (sell (slap !>(sed) u.hun))])
|
||||
::
|
||||
++ mess
|
||||
%+ cook |=(a=^mess a)
|
||||
|
11
main/bin/wipe.hoon
Normal file
11
main/bin/wipe.hoon
Normal file
@ -0,0 +1,11 @@
|
||||
!:
|
||||
:: /=main=/bin/wipe/hoon
|
||||
::
|
||||
=* our -<
|
||||
|= *
|
||||
|= gon=[term (pole term)]
|
||||
:_ ~
|
||||
%+ turn `(list term)`gon
|
||||
|= app=term
|
||||
^- gift
|
||||
[%xy /g %wipe [our app]]
|
@ -2,28 +2,11 @@
|
||||
:::: /hoon/core/down/pro
|
||||
::
|
||||
/? 314
|
||||
/- maud
|
||||
!:
|
||||
:::: describe
|
||||
::
|
||||
=>
|
||||
|%
|
||||
++ down
|
||||
$& [p=down q=down]
|
||||
$% [%$ p=tape]
|
||||
[%code p=tape]
|
||||
[%inco p=tape]
|
||||
[%head p=@ud q=down]
|
||||
[%link p=tape q=tape r=(unit tape)]
|
||||
[%lord p=(list down)]
|
||||
[%lund p=(list down)]
|
||||
[%parg p=down]
|
||||
[%quot p=down]
|
||||
[%rong p=down]
|
||||
[%emph p=down]
|
||||
[%hrul ~]
|
||||
[%html p=tape]
|
||||
==
|
||||
--
|
||||
=+ maud
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
@ -34,325 +17,268 @@
|
||||
|= src=@t
|
||||
=< (mark (trip src))
|
||||
|%
|
||||
++ cott
|
||||
;~ pose
|
||||
(shim 0 8)
|
||||
(shim 11 37)
|
||||
(shim 39 59)
|
||||
(just `@`61)
|
||||
(shim 63 95)
|
||||
(shim 97 255)
|
||||
==
|
||||
++ copt
|
||||
;~ pose
|
||||
(shim 0 9)
|
||||
(shim 11 37)
|
||||
(shim 39 39)
|
||||
(shim 43 59)
|
||||
(just `@`61)
|
||||
(shim 63 90)
|
||||
(shim 94 94)
|
||||
(shim 97 255)
|
||||
==
|
||||
++ urlc ;~(pose (shim 0 9) (shim 11 31) (shim 33 39) (shim 42 255))
|
||||
++ uctt ;~(pose (shim 0 9) (shim 11 91) (shim 94 255))
|
||||
++ uctc ;~(pose (shim 0 9) (shim 11 33) (shim 35 39) (shim 42 255))
|
||||
++ htmc ;~(pose (shim 0 9) (shim 11 255))
|
||||
++ escp (mask "\\`*_\{}[]()#+-.!")
|
||||
++ escd ;~(pfix bas escp)
|
||||
++ whit (mask (tape 9 32 ~))
|
||||
++ dent ;~(pose (jest ' ') (just `@`9))
|
||||
++ blan (cold ~ ;~(plug (star whit) (just `@`10)))
|
||||
++ mcat (bend |=([a=tape b=tape] (some (weld a b))))
|
||||
++ wcat |*(a=_rule (cook |=([a=tape b=tape] (weld a b)) a))
|
||||
++ codt
|
||||
%+ knee *tape |. ~+
|
||||
;~ pose
|
||||
(wcat ;~(plug (plus cott) codt))
|
||||
(cook |=(a=tape (weld "<" a)) ;~(pfix gal ;~(pose codt (easy ~))))
|
||||
(cook |=(a=tape (weld ">" a)) ;~(pfix gar ;~(pose codt (easy ~))))
|
||||
(cook |=(a=tape (weld "&" a)) ;~(pfix pam ;~(pose codt (easy ~))))
|
||||
(plus cott)
|
||||
==
|
||||
++ inlt
|
||||
%+ knee *tape |. ~+
|
||||
;~ pose
|
||||
;~(mcat (plus copt) inlt)
|
||||
;~(mcat (plus escd) inlt)
|
||||
;~ mcat
|
||||
%- wcat
|
||||
;~ plug
|
||||
;~(plug gal (cook trip inle))
|
||||
;~(sfix (wcat ;~(plug (star copt) (easy ">"))) gar)
|
||||
==
|
||||
inlt
|
||||
==
|
||||
;~ mcat
|
||||
%- wcat
|
||||
;~ plug
|
||||
;~(plug gal fas (cook trip inle))
|
||||
;~(sfix (wcat ;~(plug (star copt) (easy ">"))) gar)
|
||||
==
|
||||
inlt
|
||||
==
|
||||
;~ mcat
|
||||
(wcat ;~(plug ;~(plug pam hax ;~(sfix (plus nud) sem)) (easy ";")))
|
||||
inlt
|
||||
==
|
||||
;~ mcat
|
||||
(wcat ;~(plug ;~(plug pam ;~(sfix (plus alf) sem)) (easy ";")))
|
||||
inlt
|
||||
==
|
||||
(cook |=(a=tape (weld "<" a)) ;~(pfix gal ;~(pose inlt (easy ~))))
|
||||
(cook |=(a=tape (weld ">" a)) ;~(pfix gar ;~(pose inlt (easy ~))))
|
||||
(cook |=(a=tape (weld "&" a)) ;~(pfix pam ;~(pose inlt (easy ~))))
|
||||
==
|
||||
++ kite
|
||||
|= bud=(list ,@t)
|
||||
|= tub=nail
|
||||
|- ^- (like ,@t)
|
||||
?@ bud
|
||||
(fail tub)
|
||||
=+ foo=((jest i.bud) tub)
|
||||
?~ q.foo
|
||||
$(bud t.bud)
|
||||
foo
|
||||
++ bloc
|
||||
%+ knee *@t |. ~+
|
||||
%- kite
|
||||
:~ '<address>' '<article>' '<aside>' '<audio>' '<blockquote>'
|
||||
'<canvas>' '<dd>' '<div>' '<dl>' '<fieldset>' '<figcaption>'
|
||||
'<figure>' '<footer>' '<form>' '<h1>' '<h2>' '<h3>' '<h4>'
|
||||
'<h5>' '<h6>' '<header>' '<hgroup>' '<hr>' '<noscript>'
|
||||
'<ol>' '<output>' '<p>' '<pre>' '<section>' '<table>'
|
||||
'<tfoot>' '<ul>' '<video>' '<style>'
|
||||
==
|
||||
++ inle
|
||||
%+ knee *@t |. ~+
|
||||
%- kite
|
||||
:~ 'b' 'big' 'i' 'small' 'tt' 'abbr' 'acronym'
|
||||
'cite' 'code' 'dfn' 'em' 'kbd' 'strong' 'samp'
|
||||
'var' 'a' 'bdo' 'br' 'img' 'map' 'object' 'q'
|
||||
'script' 'span' 'sub' 'sup' 'button' 'input'
|
||||
'label' 'select' 'textarea' 'link'
|
||||
==
|
||||
++ htmb
|
||||
%+ knee *tape |. ~+
|
||||
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
|
||||
(plus (cook |=(a=tape (weld a "\0a")) ;~(sfix (plus htmc) (just '\0a'))))
|
||||
++ blok
|
||||
%+ knee *tape |. ~+
|
||||
%+ cook |=(a=[tape tape] (weld a))
|
||||
;~(plug (cook trip bloc) ;~(plug (just '\0a') htmb))
|
||||
++ intt
|
||||
%+ knee *down |. ~+
|
||||
;~ pose
|
||||
(ifix [(jest '**') (jest '**')] (stag %rong intt))
|
||||
(ifix [(jest '__') (jest '__')] (stag %rong intt))
|
||||
(ifix [tar tar] (stag %emph intt))
|
||||
(ifix [cab cab] (stag %emph intt))
|
||||
(ifix [tec tec] (stag %inco codt))
|
||||
(stag %$ inlt)
|
||||
link
|
||||
(stag %$ ;~(plug tar (easy ~)))
|
||||
(stag %$ ;~(plug cab (easy ~)))
|
||||
(stag %$ ;~(plug pel (easy ~)))
|
||||
(stag %$ ;~(plug per (easy ~)))
|
||||
(stag %$ ;~(plug sel (easy ~)))
|
||||
(stag %$ ;~(plug ser (easy ~)))
|
||||
==
|
||||
++ inli
|
||||
|= tub=nail
|
||||
^- (like down)
|
||||
?~ q.tub
|
||||
(fail tub)
|
||||
?: |(=(i.q.tub 10) =(i.q.tub '>'))
|
||||
(fail tub)
|
||||
=+ ^= foo
|
||||
;~ pose
|
||||
dent
|
||||
;~(plug (mask "+*-") (plus whit))
|
||||
;~(plug dim:ag dot (plus whit))
|
||||
==
|
||||
=+ bar=(foo tub)
|
||||
?~ q.bar
|
||||
%-
|
||||
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
|
||||
;~(sfix (plus intt) (just `@`10))
|
||||
tub
|
||||
(fail tub)
|
||||
++ parg
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
;~ plug
|
||||
inli
|
||||
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
|
||||
(plus ;~(plug (easy [%$ "\0a"]) (colk a b inli)))
|
||||
==
|
||||
++ link
|
||||
%+ knee *down |. ~+
|
||||
%+ stag %link
|
||||
;~ plug
|
||||
(ifix [sel ser] (plus ;~(pose uctt escd)))
|
||||
;~(pfix pel (star ;~(pose urlc escd)))
|
||||
;~ pose
|
||||
%+ cook |=(a=tape (some a))
|
||||
(ifix [ace per] (ifix [doq doq] (plus ;~(pose uctc escd))))
|
||||
(cold ~ per)
|
||||
==
|
||||
==
|
||||
++ barg
|
||||
|= a=@
|
||||
%+ knee _@ud |. ~+
|
||||
;~ pfix (stun [a a] (jest '> '))
|
||||
;~ pose
|
||||
(cold 1 ;~(plug (plus tis) (star whit) (just `@`10)))
|
||||
(cold 2 ;~(plug (plus hep) (star whit) (just `@`10)))
|
||||
==
|
||||
==
|
||||
++ neck
|
||||
%+ knee [_@ud *down] |. ~+
|
||||
;~ pose
|
||||
;~(pfix (jest '######') (stag 6 ;~(pfix (star whit) inli)))
|
||||
;~(pfix (jest '#####') (stag 5 ;~(pfix (star whit) inli)))
|
||||
;~(pfix (jest '####') (stag 4 ;~(pfix (star whit) inli)))
|
||||
;~(pfix (jest '###') (stag 3 ;~(pfix (star whit) inli)))
|
||||
;~(pfix (jest '##') (stag 2 ;~(pfix (star whit) inli)))
|
||||
;~(pfix (jest '#') (stag 1 ;~(pfix (star whit) inli)))
|
||||
==
|
||||
++ mark
|
||||
|= p=tape
|
||||
(scan p park)
|
||||
++ hrul
|
||||
%+ knee *down |. ~+
|
||||
%+ sear
|
||||
|=(a=(list tape) ?:((gte (lent (zing a)) 3) (some [%hrul ~]) ~))
|
||||
;~ sfix
|
||||
(more (star whit) ;~(pose (plus cab) (plus tar) (plus hep)))
|
||||
(just `@`10)
|
||||
==
|
||||
++ colk
|
||||
|* [a=@ b=@ fel=_rule]
|
||||
;~(pfix (stun [a a] (jest '> ')) (stun [b b] dent) fel)
|
||||
++ code
|
||||
|= [a=@ b=@]
|
||||
%+ knee *tape |. ~+
|
||||
%+ cook welp
|
||||
;~ plug
|
||||
(ifix [dent (just '\0a')] codt)
|
||||
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
|
||||
%- star
|
||||
;~(plug (easy '\0a') (colk a b (ifix [dent (just '\0a')] codt)))
|
||||
==
|
||||
++ lelm
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
;~ pose
|
||||
inli
|
||||
hrul
|
||||
;~(pfix (just `@`10) (lmel a b))
|
||||
==
|
||||
++ lmel
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
;~ pose
|
||||
;~((bend) (stag %lund (plus (lulm a b))) (lmel a b))
|
||||
;~((bend) (stag %lord (plus (lolm a b))) (lmel a b))
|
||||
;~((bend) (stag %code (colk a b (code a b))) (lmel a b))
|
||||
;~((bend) (stag %head (colk a b neck)) (lmel a b))
|
||||
;~((bend) (stag %parg (colk a b (parg a b))) (lmel a b))
|
||||
(colk a b inli)
|
||||
(colk a b hrul)
|
||||
;~(pfix (plus (colk a b blan)) (lmel a b))
|
||||
==
|
||||
++ lulm
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
(colk a b ;~(pfix (mask "+*-") (plus whit) (lelm a +(b))))
|
||||
++ lolm
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
(colk a b ;~(pfix dim:ag dot (plus whit) (lelm a +(b))))
|
||||
++ bark
|
||||
|= a=@
|
||||
%+ knee *down |. ~+
|
||||
;~ pose
|
||||
(stag %html blok)
|
||||
(stag %lund (plus (lulm a 0)))
|
||||
(stag %lord (plus (lolm a 0)))
|
||||
(stag %code (colk a 0 (code a 0)))
|
||||
(stag %head (colk a 0 neck))
|
||||
%+ cook |=([a=down b=@ud] [%head b a])
|
||||
(colk a 0 ;~(plug inli (barg a)))
|
||||
(colk a 0 hrul)
|
||||
(stag %parg (colk a 0 (parg a 0)))
|
||||
(colk a 0 inli)
|
||||
(cold [%$ ""] (colk a 0 (plus blan)))
|
||||
==
|
||||
++ dark
|
||||
|= a=@
|
||||
%+ knee *down |. ~+
|
||||
(scan p apex)
|
||||
++ apex :: markdown parser
|
||||
|= tub=nail
|
||||
^- (like down)
|
||||
=+ vex=((cook lent (star (jest '> '))) tub)
|
||||
?~ q.vex
|
||||
vex
|
||||
?: (lth p.u.q.vex a)
|
||||
(fail tub)
|
||||
?: (gth p.u.q.vex a)
|
||||
(;~((bend) (stag %quot (dark +(a))) (dark a)) tub)
|
||||
(;~((bend) (bark a) (dark a)) tub)
|
||||
++ park
|
||||
%+ knee *down |. ~+
|
||||
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
|
||||
;~(sfix (plus (dark 0)) (star blan))
|
||||
++ appd
|
||||
|= [p=@ q=@]
|
||||
^- @
|
||||
(cat 3 p q)
|
||||
++ wtag
|
||||
|= [a=@ b=@]
|
||||
^- @
|
||||
:(appd '<' a '>' b '</' a '>')
|
||||
++ sett
|
||||
|= [a=@ b=tape]
|
||||
^- @
|
||||
:(appd a '="' (rap 3 b) '"')
|
||||
++ hark
|
||||
|= a=down
|
||||
^- @
|
||||
?- a
|
||||
[%$ *] (rap 3 p.a)
|
||||
[%code *] (wtag 'pre' (wtag 'code' (rap 3 p.a)))
|
||||
[%inco *] (wtag 'code' (rap 3 p.a))
|
||||
[%head *] (wtag (cat 3 'h' (add '0' p.a)) (hark q.a))
|
||||
[%link *]
|
||||
?~ r.a
|
||||
:(appd '<a ' (sett 'href' q.a) '>' (rap 3 p.a) '</a>')
|
||||
;: appd
|
||||
'<a '
|
||||
(sett 'href' q.a)
|
||||
' '
|
||||
(sett 'title' u.r.a)
|
||||
'>'
|
||||
(rap 3 p.a)
|
||||
'</a>'
|
||||
==
|
||||
::
|
||||
[%lord *]
|
||||
(wtag 'ol' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
|
||||
::
|
||||
[%lund *]
|
||||
(wtag 'ul' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
|
||||
::
|
||||
[%parg *] (wtag 'p' (hark p.a))
|
||||
[%quot *] (wtag 'blockquote' (hark p.a))
|
||||
[%rong *] (wtag 'strong' (hark p.a))
|
||||
[%emph *] (wtag 'em' (hark p.a))
|
||||
[%hrul *] '<hr>'
|
||||
[%html *] (rap 3 p.a)
|
||||
^ (cat 3 (hark p.a) (hark q.a))
|
||||
=+ sep=(sepa tub)
|
||||
?~ q.sep [p.sep ~]
|
||||
:- p.sep
|
||||
%- some :_ [p.sep ~]
|
||||
(turn p.u.q.sep |=(a=tape (scan a blos)))
|
||||
::
|
||||
++ base %+ stag %para
|
||||
;~ plug
|
||||
(stag %text (plus ;~(pose prn eol)))
|
||||
(easy ~)
|
||||
==
|
||||
::
|
||||
++ blos :: block element
|
||||
%+ knee *bloc |. ~+
|
||||
;~ pose
|
||||
head quot lasd horz
|
||||
code codf html para base
|
||||
==
|
||||
::
|
||||
++ brek (stag %brek (cold ~ ;~(plug fas fas))) :: line break
|
||||
++ chrd ;~(pose escp prn (cold ' ' eol)) :: span character data
|
||||
++ code :: code block
|
||||
%+ stag %code
|
||||
%- full
|
||||
%- plus
|
||||
;~ pfix (stun [4 4] ace)
|
||||
;~ pose
|
||||
%+ cook welp
|
||||
;~(plug (plus prn) (cold "\0a" eol))
|
||||
(full (plus prn))
|
||||
==
|
||||
==
|
||||
::
|
||||
++ codf :: fenced code block
|
||||
%+ stag %code
|
||||
%- full
|
||||
%+ ifix
|
||||
[;~(plug tec tec tec eol) ;~(plug tec tec tec)]
|
||||
%- plus
|
||||
;~ pose
|
||||
%+ cook welp
|
||||
;~(plug (plus prn) (cold "\0a" eol))
|
||||
(full (plus ;~(less ;~(plug tec tec tec) prn)))
|
||||
==
|
||||
::
|
||||
++ cods :: code span
|
||||
%+ stag %cods
|
||||
=+ chx=;~(pose (cold ' ' eol) prn)
|
||||
;~ pose
|
||||
%+ ifix [(jest '```') (jest '```')]
|
||||
(plus ;~(less (jest '```') chx))
|
||||
%+ ifix [(jest '``') (jest '``')]
|
||||
(plus ;~(less (jest '``') chx))
|
||||
(ifix [tec tec] (plus ;~(less tec chx)))
|
||||
==
|
||||
::
|
||||
++ dont :: control chars
|
||||
;~ pose tar tec cab sel
|
||||
;~(plug sig sig)
|
||||
;~(plug fas fas)
|
||||
==
|
||||
++ spas :: all span elements
|
||||
|* res=_rule
|
||||
%- plus
|
||||
;~ pose emph stri link
|
||||
brek cods (text res)
|
||||
==
|
||||
::
|
||||
++ eol (just `@`10) :: newline
|
||||
++ emph :: emphasis
|
||||
%+ knee *span |. ~+
|
||||
%+ stag %emph
|
||||
=+ inn=(plus ;~(pose cods stri link (text fail)))
|
||||
;~ pose
|
||||
(ifix [(jest '***') (jest '***')] (stag %both inn))
|
||||
(ifix [(jest '**_') (jest '_**')] (stag %both inn))
|
||||
(ifix [(jest '*__') (jest '__*')] (stag %both inn))
|
||||
(ifix [(jest '_**') (jest '**_')] (stag %both inn))
|
||||
(ifix [(jest '__*') (jest '*__')] (stag %both inn))
|
||||
(ifix [(jest '___') (jest '___')] (stag %both inn))
|
||||
(ifix [(jest '**') (jest '**')] (stag %bold inn))
|
||||
(ifix [(jest '__') (jest '__')] (stag %bold inn))
|
||||
(ifix [tar tar] (stag %ital inn))
|
||||
(ifix [cab cab] (stag %ital inn))
|
||||
==
|
||||
::
|
||||
++ escp :: escapable chars
|
||||
;~ pose
|
||||
(cold '`' (jest '\\`'))
|
||||
(cold '*' (jest '\\*'))
|
||||
(cold '#' (jest '\\#'))
|
||||
(cold '-' (jest '\\-'))
|
||||
(cold '.' (jest '\\.'))
|
||||
(cold '{' (jest '\\{'))
|
||||
(cold '}' (jest '\\}'))
|
||||
(cold '[' (jest '\\['))
|
||||
(cold ']' (jest '\\]'))
|
||||
(cold '\\' (jest '\\\\'))
|
||||
==
|
||||
::
|
||||
++ head :: header
|
||||
%+ stag %head
|
||||
=+ ^= hed
|
||||
;~ pose
|
||||
;~ plug
|
||||
;~(pfix wits (spas hax))
|
||||
(cook some (ifix [;~(plug (star hax) sel hax) ser] (plus alp)))
|
||||
==
|
||||
(ifix [wits (star hax)] ;~(plug (spas hax) (easy ~)))
|
||||
==
|
||||
=+ ^= sed
|
||||
;~ pose
|
||||
;~ plug
|
||||
(spas ;~(pose eol sel))
|
||||
(cook some (ifix [;~(plug sel hax) ser] (plus alp)))
|
||||
==
|
||||
;~(plug (spas eol) (easy ~))
|
||||
==
|
||||
%- full
|
||||
;~ pose
|
||||
;~ pfix (jest '######') (stag 6 hed) ==
|
||||
;~ pfix (jest '#####') (stag 5 hed) ==
|
||||
;~ pfix (jest '####') (stag 4 hed) ==
|
||||
;~ pfix (jest '###') (stag 3 hed) ==
|
||||
;~ pfix (jest '##') (stag 2 hed) ==
|
||||
;~ pfix (jest '#') (stag 1 hed) ==
|
||||
(stag 1 (ifix [wits ;~(plug eol (plus tis))] sed))
|
||||
(stag 2 (ifix [wits ;~(plug eol (plus hep))] sed))
|
||||
==
|
||||
::
|
||||
++ horz :: horizontal rule
|
||||
%+ stag %horz
|
||||
%+ cold ~
|
||||
%- full
|
||||
;~ pose
|
||||
;~(plug (stun [0 3] ace) hep wits hep wits hep (star ;~(pose hep wite)))
|
||||
;~(plug (stun [0 3] ace) tar wits tar wits tar (star ;~(pose tar wite)))
|
||||
;~(plug (stun [0 3] ace) cab wits cab wits cab (star ;~(pose cab wite)))
|
||||
==
|
||||
::
|
||||
++ html (stag %html apex:xmlp) :: html bloc
|
||||
++ lasd :: top level list
|
||||
%+ stag %list
|
||||
%- full
|
||||
;~ pose
|
||||
(stag & (lisd ;~(plug (star nud) dot)))
|
||||
(stag | (lisd hep))
|
||||
(stag | (lisd tar))
|
||||
(stag | (lisd lus))
|
||||
==
|
||||
::
|
||||
++ lisd :: list funk
|
||||
|* bus=_rule
|
||||
|= tub=nail
|
||||
^- (like down)
|
||||
=+ chx=;~(plug (plus prn) (cold "\0a" eol))
|
||||
=- ?~ q.pre pre
|
||||
:- p.pre %- some
|
||||
[(turn `wall`p.u.q.pre |=(a=tape [%lise (scan a apex)])) [p.pre ~]]
|
||||
^= pre %. tub
|
||||
%+ most ;~(pose ;~(plug wits eol) (easy ~))
|
||||
%+ cook |=(a=wall `tape`(zing a)) :: XX core dump w/o cast
|
||||
;~ plug
|
||||
%+ cook zing
|
||||
;~ pose
|
||||
(full ;~(pfix bus ace ;~(plug (plus prn) (easy ~))))
|
||||
;~(pfix bus ace ;~(plug (plus prn) (cold "\0a" eol) (easy ~)))
|
||||
==
|
||||
%- star
|
||||
;~ pose
|
||||
;~(plug ;~(sfix eol ace ace) (cook welp chx))
|
||||
;~(pfix ace ace (cook welp chx))
|
||||
(full ;~(pfix ace ace (plus prn)))
|
||||
==
|
||||
==
|
||||
::
|
||||
++ link :: link element
|
||||
%+ knee *span |. ~+
|
||||
%+ stag %link
|
||||
;~ plug
|
||||
(ifix [sel ser] (plus ;~(pose emph stri cods (text ser))))
|
||||
;~ pose
|
||||
%+ ifix [pel per]
|
||||
;~ plug
|
||||
;~(sfix (cook zing (most eol (plus ;~(less ace prn)))) ace)
|
||||
(cook some (ifix [doq doq] (plus ;~(less doq ;~(pose prn eol)))))
|
||||
==
|
||||
%+ ifix [pel per]
|
||||
;~(plug (cook zing (most eol (plus ;~(less per prn)))) (easy ~))
|
||||
==
|
||||
==
|
||||
::
|
||||
++ para (stag %para (full (spas fail))) :: paragraph
|
||||
++ quot :: blockquotes
|
||||
%+ stag %quot
|
||||
%- full
|
||||
|= tub=nail
|
||||
^- (like down)
|
||||
=- ?~ q.pre
|
||||
[p.pre ~]
|
||||
(apex [[1 1] (welp p.u.q.pre q.q.u.q.pre)])
|
||||
^= pre %. tub
|
||||
%+ cook |=(a=wall `tape`(zing a))
|
||||
%- plus
|
||||
;~ pfix ;~(pose ;~(plug gar ace) gar)
|
||||
;~ pose
|
||||
(cook welp ;~(plug (star prn) (cold "\0a" eol)))
|
||||
(full (star prn))
|
||||
==
|
||||
==
|
||||
::
|
||||
++ sepa :: separate blocs
|
||||
%+ knee *wall |. ~+
|
||||
=+ lin=;~(plug eol wits eol)
|
||||
%+ ifix [(star whit) (star whit)]
|
||||
%+ more ;~(plug eol wits (more wits eol))
|
||||
;~ pose
|
||||
(sepl (cold "-" hep))
|
||||
(sepl (cold "*" tar))
|
||||
(sepl (cold "+" lus))
|
||||
(sepl (cook welp ;~(plug (star nud) (cold "." dot))))
|
||||
(plus ;~(less lin ;~(pose prn ;~(simu ;~(plug eol prn) eol))))
|
||||
==
|
||||
::
|
||||
++ sepl :: separate list
|
||||
|* bus=_rule
|
||||
%+ cook zing
|
||||
%+ most ;~(pose ;~(plug wits eol) (easy ~))
|
||||
%+ cook |=(a=wall `tape`(zing a))
|
||||
;~ plug
|
||||
%+ cook |=(a=wall `tape`(zing a))
|
||||
;~ pose
|
||||
;~(plug bus (cold " " ace) (plus prn) (cold "\0a" eol) (easy ~))
|
||||
(full ;~(plug bus (cold " " ace) (plus prn) (easy ~)))
|
||||
==
|
||||
%- star
|
||||
;~ pose
|
||||
;~ pfix wits
|
||||
;~ plug eol ace ace
|
||||
(cook welp ;~(plug (plus prn) (cold "\0a" eol)))
|
||||
==
|
||||
==
|
||||
;~(plug ace ace (cook welp ;~(plug (plus prn) (cold "\0a" eol))))
|
||||
(full ;~(plug ace ace (plus prn)))
|
||||
==
|
||||
==
|
||||
::
|
||||
++ stri :: strikethrough text
|
||||
%+ stag %stri
|
||||
%+ ifix [(jest '~~') (jest '~~')]
|
||||
(plus ;~(pose emph cods link (text fail)))
|
||||
::
|
||||
++ text |*(res=_rule (stag %text (plus ;~(less ;~(pose res dont) chrd))))
|
||||
++ whit (mask ~[`@`0x20 `@`0x9 `@`0xa]) :: whitespace w/nl
|
||||
++ wite (mask ~[`@`0x20 `@`0x9]) :: whitespace
|
||||
++ wits (star wite)
|
||||
--
|
||||
::
|
||||
++ noun :: convert from %noun
|
||||
@ -364,58 +290,49 @@
|
||||
++ grow :: convert into
|
||||
|%
|
||||
++ html :: convert into %html
|
||||
=< :(appd '<html><body>' (hark don) '</body></html>')
|
||||
=< :(appd '<html><body>' (abet don) '</body></html>')
|
||||
|%
|
||||
++ abet
|
||||
|=(don=down (crip (xmll | (apex don) ~)))
|
||||
++ appd
|
||||
|= [p=@ q=@]
|
||||
^- @
|
||||
(cat 3 p q)
|
||||
::
|
||||
++ hark
|
||||
|= a=down
|
||||
^- @
|
||||
?- a
|
||||
[%$ *] (rap 3 p.a)
|
||||
[%code *] (wtag 'pre' (wtag 'code' (rap 3 p.a)))
|
||||
[%inco *] (wtag 'code' (rap 3 p.a))
|
||||
[%head *] (wtag (cat 3 'h' (add '0' p.a)) (hark q.a))
|
||||
[%link *]
|
||||
?~ r.a
|
||||
:(appd '<a ' (sett 'href' q.a) '>' (rap 3 p.a) '</a>')
|
||||
;: appd
|
||||
'<a '
|
||||
(sett 'href' q.a)
|
||||
' '
|
||||
(sett 'title' u.r.a)
|
||||
'>'
|
||||
(rap 3 p.a)
|
||||
'</a>'
|
||||
==
|
||||
::
|
||||
[%lord *]
|
||||
(wtag 'ol' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
|
||||
::
|
||||
[%lund *]
|
||||
(wtag 'ul' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
|
||||
::
|
||||
[%parg *] (wtag 'p' (hark p.a))
|
||||
[%quot *] (wtag 'blockquote' (hark p.a))
|
||||
[%rong *] (wtag 'strong' (hark p.a))
|
||||
[%emph *] (wtag 'em' (hark p.a))
|
||||
[%hrul *] '<hr>'
|
||||
[%html *] (rap 3 p.a)
|
||||
^ (cat 3 (hark p.a) (hark q.a))
|
||||
++ apex |=(don=down (turn don |=(bol=bloc (blok bol))))
|
||||
++ blok
|
||||
|= bol=bloc
|
||||
^- manx
|
||||
?- bol
|
||||
[%head *]
|
||||
:_ (turn q.bol sank)
|
||||
[(cat 3 'h' (scot %ud p.bol)) ?~(r.bol ~ [[%id u.r.bol] ~])]
|
||||
[%para *] [[%p ~] (turn p.bol sank)]
|
||||
[%horz *] [[%hr ~] ~]
|
||||
[%code *] [[%pre ~] ~[[[%$ [[%$ (zing p.bol)] ~]] ~]]]
|
||||
[%quot *] [[%blockquote ~] (apex p.bol)]
|
||||
[%lise *] [[%li ~] (apex p.bol)]
|
||||
[%list *] ?: =(& p.bol) [[%ol ~] (apex q.bol)]
|
||||
[[%ul ~] (apex q.bol)]
|
||||
[%html *] p.bol
|
||||
==
|
||||
::
|
||||
++ wtag
|
||||
|= [a=@ b=@]
|
||||
^- @
|
||||
:(appd '<' a '>' b '</' a '>')
|
||||
::
|
||||
++ sett
|
||||
|= [a=@ b=tape]
|
||||
^- @
|
||||
:(appd a '="' (rap 3 b) '"')
|
||||
++ sank
|
||||
|= san=span
|
||||
^- manx
|
||||
?- san
|
||||
[%text *] [[%$ [[%$ p.san] ~]] ~]
|
||||
[%brek *] [[%br ~] ~]
|
||||
[%stri *] [[%del ~] (turn p.san ..$)]
|
||||
[%cods *] [[%code ~] ~[[[%$ [[%$ p.san] ~]] ~]]]
|
||||
[%emph *]
|
||||
?: =(%ital p.san) [[%em ~] (turn q.san ..$)]
|
||||
?: =(%bold p.san) [[%strong ~] (turn q.san ..$)]
|
||||
[[%em ~] ~[[[%strong ~] (turn q.san ..$)]]]
|
||||
[%link *]
|
||||
?~ r.san [[%a ~[[%href q.san]]] (turn p.san ..$)]
|
||||
[[%a ~[[%href q.san] [%title u.r.san]]] (turn p.san ..$)]
|
||||
==
|
||||
--
|
||||
--
|
||||
--
|
||||
|
15
main/pro/user/core.hoon
Normal file
15
main/pro/user/core.hoon
Normal file
@ -0,0 +1,15 @@
|
||||
::
|
||||
:::: /hoon/core/user/pro
|
||||
::
|
||||
/? 314
|
||||
/- user
|
||||
|_ use=user
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun :: convert from %noun
|
||||
|= src=*
|
||||
^+ +>+
|
||||
+>+(use (user src))
|
||||
--
|
||||
--
|
15
main/pro/users/core.hoon
Normal file
15
main/pro/users/core.hoon
Normal file
@ -0,0 +1,15 @@
|
||||
::
|
||||
:::: /hoon/core/users/pro
|
||||
::
|
||||
/? 314
|
||||
/- users
|
||||
|_ use=users
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun :: convert from %noun
|
||||
|= src=*
|
||||
^+ +>+
|
||||
+>+(use (users src))
|
||||
--
|
||||
--
|
15
main/pro/zing/core.hoon
Normal file
15
main/pro/zing/core.hoon
Normal file
@ -0,0 +1,15 @@
|
||||
::
|
||||
:::: /hoon/core/zing/pro
|
||||
::
|
||||
/? 314
|
||||
/- zing
|
||||
|_ zig=zing
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun :: convert from %noun
|
||||
|= src=*
|
||||
^+ +>+
|
||||
+>+(zig (zing src))
|
||||
--
|
||||
--
|
15
main/pro/zongs/core.hoon
Normal file
15
main/pro/zongs/core.hoon
Normal file
@ -0,0 +1,15 @@
|
||||
::
|
||||
:::: /hoon/core/zing/pro
|
||||
::
|
||||
/? 314
|
||||
/- zong
|
||||
|_ zog=(list zong)
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun :: convert from %noun
|
||||
|= src=*
|
||||
^+ +>+
|
||||
+>+(zog ((list zong) src))
|
||||
--
|
||||
--
|
22
main/str/maud/gate.hoon
Normal file
22
main/str/maud/gate.hoon
Normal file
@ -0,0 +1,22 @@
|
||||
|%
|
||||
++ down (list bloc) :: markdown model
|
||||
++ bloc :: block elements
|
||||
$% [%head p=@ud q=(list span) r=(unit tape)]
|
||||
[%para p=(list span)]
|
||||
[%lise p=down]
|
||||
[%list p=? q=down]
|
||||
[%quot p=down]
|
||||
[%horz ~]
|
||||
[%code p=wall]
|
||||
[%html p=manx]
|
||||
==
|
||||
::
|
||||
++ span :: span elements
|
||||
$% [%text p=tape]
|
||||
[%emph p=term q=(list span)]
|
||||
[%stri p=(list span)]
|
||||
[%brek ~]
|
||||
[%link p=(list span) q=tape r=(unit tape)]
|
||||
[%cods p=tape]
|
||||
==
|
||||
--
|
3
main/str/user/gate.hoon
Normal file
3
main/str/user/gate.hoon
Normal file
@ -0,0 +1,3 @@
|
||||
$% [%in p=[p=@p q=@t]]
|
||||
[%out q=[p=@p q=@t]]
|
||||
==
|
1
main/str/users/gate.hoon
Normal file
1
main/str/users/gate.hoon
Normal file
@ -0,0 +1 @@
|
||||
(list ,[p=@p q=@t])
|
8
main/str/zing/gate.hoon
Normal file
8
main/str/zing/gate.hoon
Normal file
@ -0,0 +1,8 @@
|
||||
$% [%backlog p=path q=?(%da %dr %ud) r=@]
|
||||
[%hola p=path]
|
||||
$: %mess p=path
|
||||
$= q
|
||||
$% [%do p=@t]
|
||||
[%exp p=@t q=tank]
|
||||
[%say p=@t]
|
||||
== == ==
|
@ -1,11 +1,6 @@
|
||||
=< zong
|
||||
|%
|
||||
++ mess :: message
|
||||
$% [%do p=@t] :: act
|
||||
[%exp p=@t q=tank] :: code
|
||||
[%say p=@t] :: speak
|
||||
==
|
||||
++ zong
|
||||
$% [%mess p=@da q=ship r=mess]
|
||||
==
|
||||
--
|
||||
$% $: %mess p=@da q=ship
|
||||
$= r
|
||||
$% [%do p=@t]
|
||||
[%exp p=@t q=tank]
|
||||
[%say p=@t]
|
||||
== == ==
|
||||
|
Loading…
Reference in New Issue
Block a user