Merge branch 'master' into radio

This commit is contained in:
C. Guy Yarvin 2014-12-10 10:44:07 -08:00
commit 6db859f940
6 changed files with 18 additions and 229 deletions

View File

@ -778,11 +778,11 @@
?. ?=(%0 -.q.rof) [rof +>.$]
?~ q.q.rof
[[p.rof [%0 p.q.rof ~]] +>.$]
=^ orf +>.$ (apse cof i.q.q.rof)
=^ orf +>.$ (apse p.rof i.q.q.rof)
?. ?=(%0 -.q.orf)
[orf +>.$]
?~ q.q.orf
$(cof p.orf, q.q.rof t.q.q.rof)
$(p.rof p.orf, q.q.rof t.q.q.rof)
[[p.orf [%0 (grom p.q.rof p.q.orf) q.q.orf]] +>.$]
::
++ apse

View File

@ -12,10 +12,11 @@
;html
;head
;title: Hi
;script(src "/gen/main/lib/urb.js");
;script(src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script(src "//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.js");
;script(src "//use.typekit.net/fkv0sjk.js");
;script: window.urb = window.urb || \{};
;script@"/gen/main/lib/urb.js";
;script@"//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js";
;script@"//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.js";
;script@"//use.typekit.net/fkv0sjk.js";
;script:'try{Typekit.load();}catch(e){}'
:: ;script: urb.appl = "terminal"; urb.term = \{pax: "/"}
;+ styl

View File

@ -38,8 +38,8 @@
== == == ::
++ test :: test template
$_ ^? |% ::
++ poke |+([bone ship] [_(list move) +>]) :: start test
++ pour |+([bone path *] [_(list move) +>]) :: system response
++ poke |+([bone ship] [*(list move) +>]) :: start test
++ pour |+([bone path *] [*(list move) +>]) :: system response
-- ::
-- ::
!:

View File

@ -10,6 +10,7 @@
:::: content
::
^- manx
=- ~! - -
;html
;head
;title: Tests

View File

@ -1,5 +1,5 @@
:: Core markdown parser, exposed as ++parse
!:
::
::::
::
=+ =~
@ -98,220 +98,6 @@
::
-- ==
=~
::
::::
::
!: |%
::
++ into-inner
|= [a=marl b=manx]
?~ c.b b(c a)
$(b i.c.b)
::
++ flat
|= a=marl
^- tape
?~ a ~
%- weld :_ $(a t.a)
^- tape
?~ n.g.i.a
?>(?=(_:/(**) i.a) v.i.a.g.i.a)
?+ n.g.i.a $(a c.i.a)
%img
%- zing ^- wall
%+ murn a.g.i.a |= [a=mane b=tape]
^- (unit tape)
?+ a ~
%alt [~ b]
==
==
::
++ sang :: tight item children
|= a=down
^- marl
?~ a ~
%- weld :_ $(a t.a)
?. ?=(%para -.i.a)
(sing i.a ~)
(sung p.i.a)
::
++ sing :: elem to manx
=> |%
++ first-word
|= a=tape
=. a (trip (crip a)) :: XX valid tapes
^- (unit tape)
=. a q.q:(need q:((star ace) [1 1] a))
=+ vex=((plus ;~(less ace prn)) [1 1] a)
?~ q.vex ~
(some (wonk vex))
--
=+ [tig=| had=*(unit mane)]
|= lum=down
|^ ^- marl
=+ a=apex
?~ q.a
p.a
(weld p.a $(lum q.a))
::
++ apex
^- [p=marl q=_lum]
?~ lum
?~ had [~ ~]
(lose "unclosed {<u.had>}")
=> [ele=i.lum .(lum t.lum)]
?. ?=(%html -.ele)
(push (reso ele) ~)
=+ tex=(trip (role p.ele))
=^ mar tex [p q.q]:(need q:(many:poxa 1^1 tex))
?^ mar
(push mar)
=^ hed lum (chomp tex head:poxa)
?^ hed
=+ max=`marx`u.hed
(push(lum q) [max p] ~):[apex(had `n.max) .]
=^ tal lum (chomp tex tail:poxa)
?~ tal
(push ;lost:"{tex}" ~)
?: =(had tal)
[~ lum]
?^ had
=. lum [ele lum]
(lose "unclosed {<u.had>}")
(lose "close {<u.tal>}")
::
++ lose |=(a=tape [[;lost:"{a}"]~ lum])
++ chomp
|* [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 (crip q.q.u.q.vex) ~] lum])
::
++ push
|= a=marl
^+ apex
?~ a apex
[[b p] q]:[b=i.a (push t.a)]
::
++ reso
|= a=elem
?^ -.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;
?: =(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 [/(add %h0 (lsh 3 1 p.a)) (sung q.a)]
%hrul ;hr;
:: %html
::=+ tex=(role (turn p.a crip))
::=+ (poxa tex)
::?^ - u.-
::=+ (rush tex (star ;~(pose gah comt:poxa)))
::?^ - :/(~)
::;lost: {<p.a>}
:: :/([(role (turn p.a crip))]~) :: XX haaaaaaack
%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
=+ had=*(unit mane)
|^ ^- marl
=+ a=apex
?~ q.a
p.a
(weld p.a $(lim q.a))
::
++ apex
^- [p=marl q=_lim]
?~ lim
?~ had [~ ~]
(lose "unclosed {<u.had>}")
=> [ele=i.lim .(lim t.lim)]
?. ?=(%htmt -.ele)
(push (reso ele) ~)
=+ tex=(trip p.ele)
=^ emo lim (chomp tex empt:poxa)
?^ emo
=+ man=`manx`u.emo
(push man ~)
=^ hed lim (chomp tex head:poxa)
?^ hed
=+ max=`marx`u.hed
(push(lim q) [max p] ~):[apex(had `n.max) .]
=^ tal lim (chomp tex tail:poxa)
?~ tal
(push ;lost:"{tex}" ~)
?: =(had tal)
[~ lim]
?^ had
=. lim [ele lim]
(lose "unclosed {<u.had>}")
(lose "close {<u.tal>}")
::
++ lose |=(a=tape [[;lost:"{a}"]~ lim])
++ chomp
|* [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
^+ apex
?~ a apex
[[b p] q]:[b=i.a (push t.a)]
::
++ reso
|= b=inline
^- manx
?@ -.b
?- -.b
%$ =.(p.b (trip (crip p.b)) :/(p.b)) :: XX valid tapes
%line ;br;
%code ;code:"{p.b}"
%htmt !! ::p.b :: handled earlier :: XX do type stuff
==
?: ?=(%blot -.p.b)
=+ res=`manx`;img(src p.p.b, alt (flat (turn q.b ..$)));
:: ;img@"{p.p.b}";
?~ q.p.b res
res(a.g (welp a.g.res title/u.q.p.b ~))
?: ?=([[%emph ?] [[%emph ?] *] ~] b)
[/strong (sung q.i.q.b)]
%+ into-inner (sung q.b)
?- p.b
[%emph ?] ?.(p.p.b ;em; ;strong;)
[%delt ~] ;del;
[%link ^] ?~ q.p.b ;a/"{p.p.b}";
;a/"{p.p.b}"(title u.q.p.b);
==
--
--
::
::::
::
|%
++ strip
|= [a=$+(nail edge) b=tape]
@ -341,7 +127,7 @@
(flop (strip (star gah) (flop a)))
::
++ child
=< |= tub=nail ^- (like inline) %. tub :: expose parsers
=< |= tub=nail ^- (like inline) %. tub :: expose parsers
%+ cook |=(a=inline ~?(bug a a))
;~(pose code line link blot:link htmt)
|%
@ -785,6 +571,8 @@
?=(%$ -.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
:_ $(c t.c)
?@ -.i.c i.c
=* d q.i.c
@ -797,7 +585,6 @@
i.c(q $(c d))
[[%emph %&] $(c q.i.d)]
::
++ test |=(a=cord =-([- (sing -)] (rash a parseb)))
++ parseb =>(parse .(bug &))
++ parse
=+ [bug=| bugi=|]
@ -809,7 +596,7 @@
[sap=@u nod=node] :: spacing, currrent leaf block
cur=stack :: stack of nested current blocks
==
[bun=_| hat=_|] :: prev blank? halt?
[bun=_| hat=_|] :: prev blank? halt?
ref=(map cord ,[p=tape q=(unit tape)]) :: link references
==
|^ ^- (like ,_top)

View File

@ -148,8 +148,8 @@
(lose "unclosed {<u.had>}")
=> [ele=i.lim .(lim t.lim)]
?. ?=(%htmt -.ele)
:: ?: &(?=(%$ -.ele) ?=([[%$ *] *] lim))
:: apex(p.i.lim (weld p.ele p.i.lim))
?: &(?=(%$ -.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)
@ -200,7 +200,7 @@
^- manx
?@ -.b
?- -.b
%$ =.(p.b (trip (crip p.b)) :/(p.b)) :: XX valid tapes
%$ :/(p.b)
%line ;br;
%code ;code:"{p.b}"
%htmt !! ::p.b :: handled earlier :: XX do type stuff