diff --git a/main/mar/down/door.hook b/main/mar/down/door.hook index 00f57d9891..1ecb7a110b 100644 --- a/main/mar/down/door.hook +++ b/main/mar/down/door.hook @@ -1,11 +1,13 @@ :: :::: /hoon/core/down/mar :: -/? 314 -/- *markdown +/? 314 +/- *markdown :: :::: :: +// /%%/parse :: inli donp parse +// /%%/rend :: sing sung sang flat into-inner :: ~% %utyl +>+>+> ~ |_ don=down ++ grab :: convert from @@ -18,242 +20,23 @@ ++ mark ~/ %dawn |= p=@t - *down + (rash p parse) -- ++ noun down :: clam from %noun -- :: ++ grow :: convert into - =< |% - ++ hymn :: convert to %hymn - ;html - ;head:title:"Untitled" - ;body - ;* (sing don) - == - == - ++ psal :: convert to %psal - ;div + |% + ++ hymn :: convert to %hymn + ;html + ;head:title:"Untitled" + ;body ;* (sing don) == - -- - !: |% - :: - ++ 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] == + ++ psal :: convert to %psal + ;div + ;* (sing don) == - :: - ++ sang :: tight item children - |= a=(list elem) - ^- 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=(list elem) - |^ ^- marl - =+ a=apex - ?~ q.a - p.a - (weld p.a $(lum q.a)) - :: - ++ apex - ^- [p=marl q=_lum] - ?~ lum - ?~ had [~ ~] - (lose "unclosed {}") - => [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 {}") - (lose "close {}") - :: - ++ 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 {}") - %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: {} - :: :/([(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 {}") - => [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 {}") - (lose "close {}") - :: - ++ 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)] - :: - ++ urly - |= a=tape ^- tape - ?~ a ~ - :: ?: (gth i.a 0xff) "XX" :: XX - ?: ?| [?=(^ q)]:(alp 1^1 a) - (~(has in (sa "!*'();:@&=+$,/?#%.~_")) i.a) :: XX reparse - == - [i.a $(a t.a)] - (weld (urle (trip i.a)) $(a 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 (urly 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 ^] =+ url=(urly p.p.b) - ?~ q.p.b ;a/"{url}"; - ;a/"{url}"(title u.q.p.b); - == - -- -- -- diff --git a/main/mar/down/html5-entities.json b/main/mar/down/html5-entities.json new file mode 100644 index 0000000000..e681d1bc83 --- /dev/null +++ b/main/mar/down/html5-entities.json @@ -0,0 +1 @@ +{"AAacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=","bnequiv":"≡","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"f","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩","gvnE":"≩","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨","lvnE":"≨","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠","nap":"≉","napE":"⩰","napid":"≋","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎","nbumpe":"≏","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧","nge":"≱","ngeq":"≱","ngeqq":"≧","ngeqslant":"⩾","nges":"⩾","nGg":"⋙","ngsim":"≵","nGt":"≫","ngt":"≯","ngtr":"≯","nGtv":"≫","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦","nleqslant":"⩽","nles":"⩽","nless":"≮","nLl":"⋘","nlsim":"≴","nLt":"≪","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧","NotGreaterGreater":"≫","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾","NotGreaterTilde":"≵","NotHumpDownHump":"≎","NotHumpEqual":"≏","notin":"∉","notindot":"⋵","notinE":"⋹","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪","NotLessSlantEqual":"⩽","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢","NotNestedLessLess":"⪡","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐","NotSquareSupersetEqual":"⋣","NotSubset":"⊂","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿","NotSuperset":"⊃","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽","npart":"∂","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯","npre":"⪯","nrarrc":"⤳","nrarr":"↛","nrArr":"⇏","nrarrw":"↝","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅","nsube":"⊈","nsubset":"⊂","nsubseteq":"⊈","nsubseteqq":"⫅","nsucc":"⊁","nsucceq":"⪰","nsup":"⊅","nsupE":"⫆","nsupe":"⊉","nsupset":"⊃","nsupseteq":"⊉","nsupseteqq":"⫆","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥","nvgt":">","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤","nvlt":">","nvltrie":"⊴","nvrArr":"⤃","nvrtrie":"⊵","nvsim":"∼","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\"","QUOT":"\"","rAarr":"⇛","race":"∽","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓","sqcup":"⊔","sqcups":"⊔","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊","varsubsetneqq":"⫋","varsupsetneq":"⊋","varsupsetneqq":"⫌","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂","vnsup":"⊃","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋","vsubne":"⊊","vsupnE":"⫌","vsupne":"⊋","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"} \ No newline at end of file diff --git a/main/mar/down/parse.hoon b/main/mar/down/parse.hoon new file mode 100644 index 0000000000..0ee44b8ced --- /dev/null +++ b/main/mar/down/parse.hoon @@ -0,0 +1,1195 @@ +:: Core markdown parser, exposed as ++parse +!: +:::: + :: +=+ =~ +|% +++ loca |*(a=_,* ,[p=@u q=a]) +++ stack (list (loca tops)) +-- +|% +++ htm-enty :: XX belongs in zuse + ~+ + =- |= tub=nail ^- (like ,@t) %. tub :: export context + =+(poxa enty(ent mapping)) + ^- mapping=(map span ,@tF) + =+ pax=/==18%%/html5-entities/json :: XX %%/ + =+ maf=%.(pax ;~(biff file (soft ,@) poja (om so):jo)) + ?^ maf u.maf + ~& no-enty/pax + (mo amp/'&' quot/'"' apos/'\'' lt/'<' gt/'>' ~) :: fallback +:: +++ skem-symb (star ;~(pose dot alp)) +++ skem-set ~+ ^- (set cord) :: URI schemes + :: (sa `wain`/http/https/javascript) + =- (sa `wain`(rash - (more gah (cook crip skem-symb)))) + ''' + coap doi javascript aaa aaas about acap cap cid crid data dav dict dns file + ftp geo go gopher h323 http https iax icap im imap info ipp iris iris.beep + iris.xpc iris.xpcs iris.lwz ldap mailto mid msrp msrps mtqp mupdate news nfs + ni nih nntp opaquelocktoken pop pres rtsp service session shttp sieve sip sips + sms snmp soap.beep soap.beeps tag tel telnet tftp thismessage tn3270 tip tv + urn vemmi ws wss xcon xcon-userid xmlrpc.beep xmlrpc.beeps xmpp z39.50r + z39.50s adiumxtra afp afs aim apt attachment aw beshare bitcoin bolo callto + chrome chrome-extension content cvs com-eventbrite-attendee dlna-playsingle + dlna-playcontainer dtn dvb ed2k facetime feed finger fish gg git gizmoproject + gtalk hcp icon ipn irc irc6 ircs itms jar jms keyparc lastfm ldaps magnet maps + market message mms ms-help msnim mumble mvn notes oid palm paparazzi platform + proxy psyc query res resource rmi rsync rtmp secondlife sftp sgn skype smb + soldat spotify ssh steam svn teamspeak things udp unreal ut2004 ventrilo + view-source webcal wtai wyciwyg xfire xri ymsgr + ''' +:: +++ uri-skem (sear (flit |=(a=tape (~(has in skem-set) (cass a)))) skem-symb) +-- +:: +:::: + :: +!: |% +++ nal (just `@`10) +++ end (full (easy ~)) +++ eol ;~(pose (cold ~ nal) end) +::++ match |=(a=rege (curr scan (ra a))) +:: +++ tab + |= 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)) +++ pech + |* a=_[rule rule] + |= tub=nail + ^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a)))) + %. tub + ;~(pose (stag %& -.a) (stag %| +.a)) +:: +++ lite :: literal matched + |* a=_rule + |= tub=nail ^- (like tape) + =+ vex=(a tub) + ?~ q.vex vex + =+ tap=q.q.u.q.vex + =- vex(p.u.q -) + |- ^+ "" + ?: =(tap q.tub) ~ + ?~ q.tub !! + [i.q.tub $(q.tub t.q.tub)] +:: +++ enrule :: XX + |* a=$+(tape *) + |= tub=nail + ^- (like a) + [[0 0] ~ (a q.tub) [0 0] ~] +:: ++ vary :: XX types +:: |= a=tape +:: ?~ a !! :: XX cast to _(b) +:: |* b=_|=(_rule rule) +:: ?~ t.a (b (just i.a)) +:: ;~(pose (b (just i.a)) $(a t.a)) +:: +-- == + =~ +:: +:::: + :: +!: |% +:: +++ 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=(list elem) + ^- 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=(list elem) + |^ ^- marl + =+ a=apex + ?~ q.a + p.a + (weld p.a $(lum q.a)) + :: + ++ apex + ^- [p=marl q=_lum] + ?~ lum + ?~ had [~ ~] + (lose "unclosed {}") + => [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 {}") + (lose "close {}") + :: + ++ 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 {}") + %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: {} + :: :/([(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 {}") + => [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 {}") + (lose "close {}") + :: + ++ 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] + ^- tape + =+ q:(a 1^1 b) + ?~(- b q.q.u.-) +:: +++ inli :: inline parsers + =+ [bug=| rec="" nol=|] + |_ ref=(map cord ,[p=tape q=(unit tape)]) + ++ unesc + |= a=tape + (scan a (star ;~(pose nore(rec ~) nal))) :: XX + :: + ++ esc + ;~ pfix bas + (mask "!\"#$%&'()*+,-./:;<=>?@[\\]^_`\{|}~") + == + ++ spec (mask rec) + ++ norc ~+ ;~(pose esc ;~(less spec prn)) + ++ nore ~+ ;~(pose htm-enty norc) + :: + ++ trim-sp + |= 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)) + ;~(pose code line link blot:link htmt) + |% + ++ fens + |= a=tape + %+ knee *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)) + ((cook neu ^^$) q.u.q.vex) + :: + ++ codc ;~(pose (cold ' ' (plus gah)) prn) + ++ code + =- ;~(pose - (stag %$ (plus tec))) + %+ stag %code + %+ cook trim-sp + |= 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) (. +.a)) + :: + ++ htmt + %+ stag %htmt + =- (cook crip (lite -)) :: XX + %- sear :_ + ;~(pose empt:poxa (pech [head tail]:poxa)) + %- flit + |= a=$&([marx ~] $%([%& marx] [%| p=mane])) + ?- -.a + ^ (madn n.a) + & (madn n.a) + | (madn p.a) + == + :: + ++ line + %+ cold [%line ~] + ;~(plug ;~(pose (lots 2 ace) bas) nal) + :: + ++ empty + |= a=inline + ^- ? + ?& ?=(%$ -.a) + ?=(~ (strip (star ;~(pose ace nal)) p.a)) + == + :: + ++ link ::=+(blot=fail |=(nail (fail +<))) + =< =- |=(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]) + |% + ++ apex + =+ ^- rob=$+(nail (like ,[kids $|(cord [tape (unit tape)])])) + ;~(plug text(nol &) labe) + :: + |= 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)]) + =+ [~ atr]=(wonk vex) + ?^ atr + `atr + ?. ?=(~ atr) + (~(get by ref) atr) + =+ vux=(text:href tub) + ?~ q.vux ~ + (~(get by ref) (wonk vux)) + :: + ++ text + =. rec ['[' ']' rec] + (ifix sel^ser many) + :: + ++ titl (opts ;~(pfix (plus gah) titl:href)) + ++ labe + =+ wra=[;~(plug pel .) ;~(plug . per)]:(star gah) + ;~ pose + (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]) + :: + ++ mail + %+ cook |=(_[a="" b='' c="" d=*wall] :(welp a b^c (zing d))) + ;~ plug + (plus ;~(less (mask "\"\\ (),:;<>@[]") prn)) + pat + (plus alp) + (star ;~(plug dot (plus alp))) + == + :: + ++ auto + %+ ifix gal^gar + ;~ pose + (cook |=(a=tape [link/["mailto:{a}" ~] ~[`a]]) mail) + :: + =+ cha=;~(pose htm-enty ;~(less (mask "<> ") prn)) + %+ cook + |= 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 `"]" ~))) + -- + -- + :: + ++ href + =< |= tub=nail %. tub :: expose parsers + ;~ plug + ;~(sfix text col (star gah)) + (sear (flit |=(tape ?=(^ +<))) dest) + ;~(sfix (opts ;~(pfix (plus gah) titl)) (star ace) eol) + == + |% + ++ dest + ;~ pose + (ifix gal^gar (star ;~(pose esc nore(rec "<>")))) + (pexp nore(rec " ")) + == + ++ pexp + |* cha=_rule + =+ chu=;~(less pel per cha) + |- :: XX Chesterton fence + %+ knee *tape |. ~+ + ;~ pose + ;~(plug chu ^$) + ;~(plug pel (cook welp ;~(plug (star chu) per ^$))) + (easy ~) + == + ++ text + =- (ifix sel^ser (cook cass (star -))) + ;~ pose + (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 fail + ;~ pose + (ifix -.a (star ;~(pose esc htm-enty ;~(less ->.a prn)))) + $(a +.a) + == + -- + ++ consol + |= a=kids + ^- kids + ?~ a ~ + ?+ -.i.a [i.a $(a t.a)] + %$ + ?~ t.a 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 + => |% + ++ nufh ,[tape kids] + ++ fens ?(%'*' %'_') + ++ nuft ,[nufh ?(tape [tape ?(%| fens)])] + ++ reso + |= a=nufh + ^- kids + ?~ -.a +.a + [[%$ -.a] +.a] + :: + ++ veld + |= [a=$|(char inline) _[b c]=*nuft] + ^- nuft + :_ c + ?@ a + [[a -.b] +.b] + ?~ -.a + [(weld p.a -.b) +.b] + [~ a (reso b)] + :: + ++ rend + |= nuf=nufh + %. (reso nuf) + |= a=kids + ^- tape + ?~ a ~ + %- weld :_ $(a t.a) + ?@ -.i.a + ?+ -.i.a + ~ p.i.a + == + =+ [p q]=i.a + ?+ -.p "[{(trip -.p)}]<{$(a q)}>" + %emph "({$(a q)})" + == + -- + |= tap=tape ^- kids + =. tap (trim-sp tap) + =+ vex=(many 1^1 tap) + ?~ q.vex + ~ + =+ [a ~ b]=u.q.vex + ?~(b a (welp a [`b]~)) + :: + ++ many + => pars :: XX + |= tub=nail ^- (like kids) + =- [[0 0] ~ (reso -<) [0 0] ;;(tape ->)] :: XX + =+ [ins=`?(fens ~)`~ bof=| noz=|] + ?~ q.tub [`~ ~] + =+ [p=*char [i t]=[i t]:q.tub] :: prev current next + =< ?<(&(?=([* @] +) !?=(~ +>)) .) :: XX do type stuff + |^ ^- nuft + ?: ?=(?(%'*' %'_') i) + dlim + =+ elm=(;~(pose child ;~(pfix (star ace) nal) nore) [1 1] i t) + ?~ q.elm + done(t [i t]) :: XX next? + =+ [a ~ b]=u.q.elm + ~? bug [a b] + (push(t b) a) + :: + ++ next (push i) + ++ push :: continue with head + |= a=$|(char inline) + ^- nuft + ~? ?@(a | bug) fon/a + ?~ t (veld a done) + =: noz & + i i ::?+(i i fens p) + == + (veld a ^$(+< [i t])) + :: + ++ done [[~ ~] ?~(ins t [t %|])] + :: + ++ pull :: consume chunk + ^- nuft + ?> ?=(fens i) :: XX do type stuff + =: bof ?~(ins | |(bof !=(ins i))) + ins i + noz | + == + ?~ t + (veld i done) + $(+<+ t) + :: + ++ flome + |= a=_+:*nuft + ^- [(unit ?(%| fens)) tape] + ?. ?=([* ?(%| fens)] a) + [~ a] + [[~ +.a] -.a] + :: + ++ empa + |= a=nufh + ^- inline + [[%emph |] (reso a)] + :: + ++ ends + |= [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)) + == + :: + ++ dlim + ^- nuft + ~? bug [&3 &2] + =+ clo=&(noz !=(~ ins) (ends t p ~)) :: can close delim + ?: &(clo =(ins i)) :: correct close + [`~ t] + ?: &(bof !=(ins i)) :: outer close + ?> ?=(fens i) :: XX do type stuff + [`~ t i] + ?~ t + (veld i done) + ?. (ends [p]~ t) + next + =+ [a tak]=pull + => .(t `_""`t) :: XX do type stuff + =^ b t (flome tak) + ?~ b + (push (empa a)) + ~? > bug clot/[a i t] + ?: =(i u.b) + (push (empa a)) + ?~ ins :: outermost + [a(- [i -.a]) t] ::(veld i a t) + [a(- [i -.a]) t u.b] ::(veld i a t u.b) + -- + :: + -- +-- +:: +:::: + :: +!: |% +++ nesting $% [%bloq *] :: Used for fishing + [%item *] + [%list [%item ~]] + == +++ accepting ?(%para %code) +++ list-nest :: can add list item? + =+ 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) + ?~ b | + ?^ r.u.b | + ?& =(p.u.a p.u.b) + (gte q.u.b q.u.a) + == +:: +++ blank + |= a=tape ^- ? + ?~ a & + &(=(' ' i.a) $(a t.a)) +:: +++ dehax :: strip trailing hax + =+ nobas=;~(sfix (plus hax) ;~(pose ace end)) + |= a=tape + %- flop + :(strip nobas (star ace) (flop a)) +:: +++ scab + |* [a=tape b=_rule] + (wonk (b [1 1] a)) +:: +++ donp + |% + ++ blok + :~ %article %aside %blockquote %body %button %canvas %caption %col + %colgroup %dd %div %dl %dt %embed %fieldset %figcaption %figure + %footer %footer %form %h1 %h2 %h3 %h4 %h5 %h6 %header %hgroup + %hr %iframe %li %map %object %ol %output %p %pre %progress + %script %section %style %table %tbody %td %textarea %tfoot + %th %thead %tr %ul %video + == + ++ htm-head =+ blu=(flit ~(has in (sa `wain`blok))) + =+ blo=(sear blu (cook cass (star aln))) + %+ stag %html + ;~ plug gal + ;~ pose + ;~(plug blo ;~(pose fas gar gah)) + ;~(plug fas blo ;~(pose gar gah)) + (mask "?!") + == + == + ++ leaf (leas ;~(pose head hrul fcode)) :: any node + ++ head + %+ 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 fail + ;~(pose ;~(plug (lots 3 (whif -.a)) (ahed eol)) $(a +.a)) + :: + ++ limar :: list marker + %+ stag %list + %- leas + %+ stag & + =- ;~(sfix - ;~(pose (ahed eol) ;~(sfix ace ;~(pose (leas) (easy))))) + ;~ pose + (mask "*+-") + ;~(plug dem (mask ".)")) + == + :: + ++ line + ;~(sfix (star prn) eol) + :: + ++ blomar + %+ cold [%bloq ~] + %- leas + ;~ pose + ;~(plug gar ace) + gar + == + ++ setext + %- leas + ;~(sfix ;~(pose (cold 2 (plus hep)) (cold 1 (plus tis))) (star ace)) + ++ icode (cold `node`[%code ~ ~] (stun 4^4 ace)) + ++ fcode + %. ~['`' '~'] :: (vary "`~") + |* a=(pole char) + ?~ a fail + =- ;~(pose fel $(a +.a)) + ^= fel + %- cook :_ ;~ plug + (lots 3 (just -.a)) + (star ;~(less tec prn)) + (ahed eol) + == + |= [b=(list) c=tape ~] + ^+ [?>(?=(%code -) .)]:*node :: XX do type stuff + [%code `[-.a (add 3 (lent b)) c] ~] + -- +:: +++ test |=(a=cord =-([- (sing -)] (rash a parseb))) +++ parseb =>(parse .(bug &)) +++ parse + =+ [bug=| bugi=|] + |= tub=nail + =. q.tub + %+ scan q.tub :: tab hackery :: XX per line + (star ;~(pose prn tab nal)) + =| $: $: top=(list elem) :: 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 + == + |^ ^- (like ,_top) + ?. hat + $:eat-line + ?^ cur + $:pop + => cull + =- [p.tub `[- tub]] + (flop (turn top (proc-inline [-(bug bugi)]:[~(pars inli ref) .]))) + :: + ++ self . + :: + ++ halt .(hat &) + :: + ++ debu [&2 &2.-]:&2 + :: + ++ proc-inline :: parse inline kids + |= pac=_pars:inli :: cache + |= a=elem + ?^ -.a a(q (flop (turn q.a ..$))) + ?+ -.a a + %code + ?~ p.a a + a(r.u.p (unesc:inli r.u.p.a)) + %para + ?> ?=([[%$ *] ~] p.a) :: XX do type stuff + a(p (pac p.i.p.a)) + %head + ?~ q.a a + ?> ?=([[%$ *] ~] q.a) :: XX do type stuff + a(q (pac p.i.q.a)) + == + :: + ++ snack :: advance by parser + |* a=_rule + ^- [(unit ,_(wonk (a))) nail] + =+ vex=(a tub) + ?~ q.vex [~ tub] + [`p q]:u.q.vex + :: + ++ snake :: advance with trace + |* fel=_rule + =- (snack (here - fel)) + |*([[[@ a=@u] [@ b=@u]] c=*] [p=(sub b a) q=c]) + :: + :: + ++ pop :: resolve container + ^+ self + => cull + ?~ cur self + =- => .(cur t.cur, q.p.tub p.i.cur) + ?~ cur self(top [hed top]) + self(q.q.i.cur [hed q.q.i.cur]) + ^- hed=tops + =+ cub=q.i.cur + ?+ -.p.cub cub + %list + %_ cub + p.p + p.p.cub :: XX set this upon parsing blank-headed block + == + == + :: + ++ bye :: resolution arms + |% + ++ leaf :: resolve node + ^+ self + =^ nol nod + [nod [%defn ~]] + ?: ?=(%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 + ^+ self + ?~ cur self + ?: =(a cur) self + $(self pop) + :: + ++ top-list + =+ laz=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) + $(cur t.cur) + -- + :: + ++ cull :: resolve node block + =< leaf:bye + ^+ self + =. sap 0 + ?+ -.nod self + %html + self(p.nod (flop p.nod)) + %code + =< self(q.nod (flop q.nod)) + |- + ?^ p.nod . + ?~ q.nod . + ?: (blank (trip i.q.nod)) $(q.nod t.q.nod) + . + %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)) + |- ^+ self + =^ ren tub (snack (leas href):inli) + ?^ ren + ?: (~(has by ref) -.u.ren) $ + $(ref (~(put by ref) u.ren)) + =. q.tub (strip (star gah) q.tub) + ?~ q.tub self(nod [%defn ~], tub olt) + self(nod [%para [%$ q.tub]~], tub olt) + == + :: + ++ push :: open block + |= nit=(loca ,_p:*tops) ^+ +> + =. self cull + =+ toz=[q.nit ~] + ?. ?=([%list ^] q.nit) + (shove p.nit toz) + =. self (shove p.nit toz) + (shove p.nit [%item ~]~) + :: + ++ shove + |= a=(loca tops) ^+ +> + ?~ cur +>(cur [a cur]) + :: =* cub q.i.cur + ?. ?=(nesting [-.p.q.i.cur -.q.a]) + $(+> pop) + +>(cur [a cur]) + :: + ++ pump :: push leaf block + |= 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 ^- ? + ?~ cur | + =(-.a -.q.i.cur) + :: + :: + ++ collapse :: skim elems off top + |= a=(list (pair ,@ tops)) ^+ +> + ?~ a +> + :: ?: ?=([[@ *] ~] a) +> + ~? bug yank/[i.a blos] + ?> (match q.i.a) + :: ~& [%no-match a cur] + :: !! + $(a t.a, +> pop) + :: + ++ offset + ^- @u + ?~ cur 0 + ?: ?=(%bloq -.p.q.i.cur) + p.i.cur + offset(cur t.cur) + :: + ++ delist (pop-til top-list):bye + ++ debloq + |= ruc=_(flop cur) + ^+ self + ?~ ruc self + ?. ?=(%bloq -.p.q.i.ruc) + $(ruc t.ruc) + (collapse (flop ruc)) + :: + ++ nil-li + ?& ?=(%defn -.nod) + ?=(^ cur) + ?=([[%item ~] ~] q.i.cur) + == + ++ widen ^+ cur :: list loosening + =< ?~ cur ~ + ?. ?=(%item -.p.q.i.cur) + (. cur) + [i.cur (. t.cur)] + |= a=_cur ^+ a + ~? > bug naro/[debu nil-li a cur] + ?~ a a + ?: ?=([[%item ~] ~] q.i.a) + 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))) + :: + ++ eat-line :: high-level line nom + ^+ . + ~? >> bug line/curlin + :: => [bup=bun sepa:eat] + :: ?: bun:+ + :: blank line nommed + :: =< .(bun |) + :: =. bun bup + ~? bug line-stat/[debu cur] + ?: ?=(%html -.nod) + =+ sep=(sepa:eat) + ?: bun.sep sep + span:eat.+ + => [ruc .]=olds:eat + ?: &(?=(~ ruc) ?=([%code ^ *] nod)) + code:eat + =+ sep=(sepa:eat ruc) + ?: bun.sep + ~? bug nilli/[debu nil-li nod cur]:sep + =. bun.sep + ?^(ruc & ?^(cur | !nil-li:sep)) :: XX Chesterton fence + sep + =< .(bun |) + =~ [ruc=ruc sep(bun bun)] + (lazy:eat ruc) + news:eat + node:eat + span:eat + :: ~? bug seated/[nod blos] . + == + :: + ++ curlin (scab q.tub (star prn)) + ++ eat + |% + ++ sepa :: consume blank line + |= ruc=_(flop cur) ^+ self + ?: ?=([%code ^ *] nod) :: ignore in blocks + self + =^ buf tub (snack ;~(sfix (star ace) nal)) + ?~ buf + self(bun |) + ~? bug seat/cur + =. self + ?: bun + delist + =. bun & + (debloq ruc) + ?+ -.nod self + %para cull + %html cull + %code =- self(q.nod -) + ?~ q.nod q.nod + [(crip (slag 4 u.buf)) q.nod] + == + :: + ++ horz :: horizontal rule + ^+ self + =^ neu tub (snack (leas hrul:donp)) + ?~ neu self + (pump u.neu) + :: + ++ olds :: previous nest levels + =+ [ruc=(flop cur) ovs=0] + |- ^+ [ruc self] + ?: =(~ q.tub) + [~ halt] + ?~ ruc [ruc self] + ~? bug heat/[debu q.i.ruc cur] + ?- -.p.q.i.ruc + %bloq + =^ neu tub (snack blomar:donp) + ?^ neu $(ruc t.ruc, ovs p.i.ruc) + [ruc self] + %list + ?~ t.ruc !! + :: $(t.ruc [p.i.ruc [%item ~] ~]~) :: XX why this + ?> ?=(%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? + =^ neu tub (snake limar:donp) + ?~ neu [ruc self] + => .(q.u.neu ^+(p.q.i.ruc q.u.neu)) :: XX do type stuff + ?. (list-nest p.q.i.ruc q.u.neu) + =. self (collapse (flop ruc)) + [~ (push u.neu)] + =. self (collapse (flop t.ruc)) + [~ (push p.u.neu [%item ~])] + %item + !! + == + :: + ++ aces |=(a=@u ^+(tub +:(snack (stun 0^a ace)))) :: nom optional leading + :: + ++ lazy :: errant prev bloqs + |= ruc=(list (pair ,@ tops)) + ^+ self + ~? bug laze/[debu ruc] + ?. ?=(%para -.nod) + (collapse (flop ruc)) + ?: |([?=(^ -)]:lead [?=(^ -)]:(snack leaf:donp)) :: XX efficiency + (collapse (flop ruc)) + :: =. tub +:(snack (star ace)) + self + ::self(tub (aces p.i.cur)) :: XX correct? + :: =< (collapse (flop ruc)) + :: |- ^+ . + :: ?~ ruc ..$ + :: ?. ?=([%bloq ~] -.q.i.ruc) + :: ..$ + :: $(ruc t.ruc) + :: + ++ lead :: enter into tops + %- snake + => donp + ;~(plug ;~(pose blomar limar)) + :: + ++ news :: enter nest levels + |- ^+ self + ?. =(self horz) self :: XX efficiency + =^ neu tub + lead + ?~ neu + self + =. bun | :: don't wide new lists + $(self (push u.neu)) + :: + ++ node :: consume leaf node + ^+ self + ~? bug neat/curlin + ::=. self ?.(bun self cull) + ?^ [q]:((leas htm-head):donp tub) :: XX efficiency + (pump [%html ~]) + =+ ^= hez + %+ stag %heas + ?. ?=([%para [%$ *] ~] nod) + fail + ;~(plug setext:donp (cold p.nod (ahed eol))) + =+ ico=?:(?=(%para -.nod) fail icode:donp) + =+ saf=q.p.+:(snack (star ace)) :: XX efficiency + =^ neu tub + (snack ;~(pose hez ico leaf:donp)) + ~? bug feat/[bun saf blos neu] + =. cur + ?.(|(bun ?=([~ [%heas ^]] neu)) cur widen) + ?~ neu + =. tub +:(snack (star ace)) + ?. ?=(%para -.nod) + cull + self + ?+ -.u.neu (pump u.neu) + %heas self(nod u.neu(- %head)) :: replace extant para + %code ?^ p.u.neu + (pump u.neu (dec saf)) + ?: ?=([%code ~ *] nod) + self + (pump u.neu) + == + :: + ++ code + ^+ self + ?> ?=([%code ^ *] nod) :: XX do type stuff + ~? bug ceas/[sap] + =. tub (aces sap) + =+ [neu tup]=(snack ;~(sfix (leas fcode):donp eol)) + ?: &(?=(^ neu) (closes-code p.nod p.u.neu)) + =. q.nod q.nod + cull(tub tup) + =^ buf tub (snack ;~(sfix (star ace) nal)) + ?^ buf + self(q.nod [(crip u.buf) q.nod]) + span + :: + ++ span :: raw text + ^+ self + ?: =(~ q.tub) halt + =^ lin tub + (snack line:donp) + ?~ lin + halt + ~? bug adva/u.lin + |- + ?~ u.lin + ?+ -.nod cull + %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) + self(q.nod [`(dehax u.lin)]~) + %code self(q.nod :_(q.nod (crip u.lin))) + %html self(p.nod :_(p.nod (crip u.lin))) + == + :: + -- +-- -- + == diff --git a/main/mar/down/rend.hoon b/main/mar/down/rend.hoon new file mode 100644 index 0000000000..0566508b38 --- /dev/null +++ b/main/mar/down/rend.hoon @@ -0,0 +1,222 @@ +:: ++down rendering arms +:: +:::: + :: +|% +++ 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=(list elem) + ^- 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=(list elem) + |^ ^- marl + =+ a=apex + ?~ q.a + p.a + (weld p.a $(lum q.a)) + :: + ++ apex + ^- [p=marl q=_lum] + ?~ lum + ?~ had [~ ~] + (lose "unclosed {}") + => [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 {}") + (lose "close {}") + :: + ++ 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 {}") + %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: {} + :: :/([(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 {}") + => [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 {}") + (lose "close {}") + :: + ++ 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)] + :: + ++ urly + |= a=tape ^- tape + ?~ a ~ + :: ?: (gth i.a 0xff) "XX" :: XX + ?: ?| [?=(^ q)]:(alp 1^1 a) + (~(has in (sa "!*'();:@&=+$,/?#%.~_")) i.a) :: XX reparse + == + [i.a $(a t.a)] + (weld (urle (trip i.a)) $(a 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 (urly 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 ^] =+ url=(urly p.p.b) + ?~ q.p.b ;a/"{url}"; + ;a/"{url}"(title u.q.p.b); + == + -- +--