9Literal rendering engine
11A door that contains arms that operate on the sample coin `lot`.
33 { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
34 <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
38------------------------------------------------------------------------
42Prepend & render as tape
44Renders a coin `lot` as a tape prepended to the sample tape `rom`.
59 ++ rear |=(rom/tape =>(.(rex rom) rend))
64 > (~(rear co %$ %ux 200) "--ha")
67------------------------------------------------------------------------
73Renders a coin `lot` as a span.
86 ++ rent `@ta`(rap 3 rend)
91 > ~(rent co %$ %ux 200)
93 > `@t`~(rent co %$ %ux 200)
96------------------------------------------------------------------------
102Renders a coin `lot` as a tape.
118 ['~' '0' ((v-co 1) (jam p.lot))]
124 ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
125 =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
127 ?+ yed (z-co q.p.lot)
128 $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
130 ?+ hay (z-co q.p.lot)
132 =+ yod=(yore q.p.lot)
133 => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
137 ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
139 => .(rep ['.' (y-co s.t.yod)])
140 => .(rep ['.' (y-co m.t.yod)])
141 ['.' '.' (y-co h.t.yod)]
143 => .(rep ['.' (a-co d.t.yod)])
144 => .(rep ['.' (a-co m.yod)])
145 => .(rep ?:(a.yod rep ['-' rep]))
149 =+ yug=(yell q.p.lot)
150 => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
152 ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
154 => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
155 => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
156 => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
157 => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
164 ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
168 ?+ hay (z-co q.p.lot)
169 $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
170 $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
174 =+ dyx=(met 3 q.p.lot)
177 (weld (trip (tod:po q.p.lot)) rep)
180 (trip (tos:po (end 3 1 q.p.lot)))
181 (trip (tod:po (rsh 3 1 q.p.lot)))
184 =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
192 q.p.lot (rsh 5 1 q.p.lot)
194 =+ syb=(wren:un (end 5 1 q.p.lot))
195 =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
197 (trip (tos:po (end 3 1 p.cog)))
198 (trip (tod:po (rsh 3 1 p.cog)))
200 (trip (tos:po (end 3 1 q.cog)))
201 (trip (tod:po (rsh 3 1 q.cog)))
202 `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
208 ?+ hay (z-co q.p.lot)
209 $d ['.' '~' (r-co (rlyd q.p.lot))]
210 $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
211 $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
212 $s ['.' (r-co (rlys q.p.lot))]
217 %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
218 (c-co (enc:fa q.p.lot))
219 =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
220 ^= gam ^- {p/tape q/tape}
221 ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
222 $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
223 $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
224 $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
225 $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
226 $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
231 ?:((syn:si q.p.lot) "--" "-")
232 $(yed 'u', q.p.lot (abs:si q.p.lot))
236 ?: =('s' (cut 3 [2 1] p.p.lot))
237 (weld (rip 3 q.p.lot) rep)
238 ['~' '.' (weld (rip 3 q.p.lot) rep)]
239 ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
246 > ~(rend co ~ %ux 200)
248 > ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
250 > ~(rend co ~ %p 32.819)
252 > ~(rend co ~ %ux 18)
254 > ~(rend co [~ p=[p=%if q=0x7f00.0001]])
258 > ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
260 > ~(rend co %blob [1 1])
274Parse alphabetic characters, both upper and lowercase.
279 ++ alf ;~(pose low hig) :: alphabetic
288 > (scan "AaBbCc" (star alf))
296Alphanumeric characters
298Parse alphanumeric characters - both alphabetic characters and numbers.
303 ++ aln ;~(pose low hig nud) :: alphanumeric
310 > (scan "alf42" (star aln))
312 > (scan "0123456789abcdef" (star aln))
322Parse alphanumeric strings and hep, "-".
327 ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
336 > (scan "123abc-" (star alp))
347Parse the hep and lus axis syntax.
352 ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
369Parse a tape of binary (0s and 1s) and produce its atomic representation.
374 ++ bin (bass 2 (most gon but)) :: binary to atom
385 > (scan "100000001111" bin)
395Parse a single binary digit.
400 ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
413 > (scan "01" (star but))
423Parse a single octal digit.
428 ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
441 > (scan "60" (star cit))
451Parse a decimal number to an atom.
456 ++ dem (bass 10 (most gon dit)) :: decimal to atom
465 > (scan "150000000" dem)
477Parse a single decimal digit.
482 ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
489 > (scan "42" (star dit))
491 > (scan "26000" (star dit))
501Dot followed by an optional gap, used with numbers.
506 ++ dog ;~(plug dot gay) ::
514 > (scan "a. " ;~(pfix alf dog))
524Phonetic base phrase separator
529 ++ doh ;~(plug ;~(plug hep hep) gay) ::
534 /> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
535 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
536 /> ~nopfel-botduc-nilnev-dolfyn--
537 haspub-natlun-lodmur-holtyd
538 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
551Parse phep, `--`, to null, `~`.
556 ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
564 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
574Parse stet, `==`, to null `~`.
579 ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
586 > (duz [[1 1] "== |=..."])
587 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
597Whitespace component, either newline or space.
602 ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
607 /> ^- * :: show spaces
613 [32 32 32 45 10 32 45 10 32 32 45 0]
618 [32 32 32 10 32 10 32 32 0]
620 %- scan :_ (star gah)
624 ~[32 32 32 10 32 10 32 32]
638 ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
647Two spaces, a newline, or comment.
652 ++ gaq ;~ pose :: end of line
654 ;~(plug gah ;~(pose gah vul))
671 ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
685 ++ gay ;~(pose gap (easy ~)) ::
694Parse long numbers - Numbers which wrap around the shell with the line
699break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
703characters bas and fas.
707 > (gon [[1 1] "\\/"])
708 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
715Axis syntax `<` or `>`
717Parse the axis gal and gar axis syntax.
722 ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
739Parse any hexadecimal number to an atom.
744 ++ hex (bass 16 (most gon hit)) :: hex to atom
759 > (scan "1EE7F7" hex)
761 > `@ux`(scan "1EE7F7" hex)
770Parse a single uppercase letter.
775 ++ hig (shim 'A' 'Z') :: uppercase
782 > `cord`(scan "G" hig)
784 > (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
785 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
787 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
796Parse a single hexadecimal digit.
801 ++ hit ;~ pose :: hex digits
803 (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
804 (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
815 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
816 > (scan "2A" (star hit))
825Apply `++rule` to indented block starting at current column number, omitting
826the leading whitespace.
841 ++ inde |* sef/rule :: indentation block
843 =+ [har tap]=[p q]:+<
844 =+ lev=(fil 3 (dec q.har) ' ')
846 =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
847 ;~(simu ;~(plug eol eol) eol)
849 =+ vex=(sef har(q 1) p.u.q.roq)
850 =+ fur=p.vex(q (add (dec q.har) q.p.vex))
854 &4.vex(q.p (add (dec q.har) q.p.&4.vex))
857 ?. =(10 -.res) [-.res $(res +.res)]
858 (welp [`@t`10 (trip lev)] $(res +.res))
864 > (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
866 > (scan "abc" (star ;~(pose prn (just `@`10))))
868 > (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
871 > (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
874 > (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
885Parse a single lowercase letter.
890 ++ low (shim 'a' 'z') :: lowercase
897 > `cord`(scan "g" low)
899 > (scan "abcdefghijklmnopqrstuvwxyz" (star low))
900 "abcdefghijklmnopqrstuvwxyz"
902 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
916 ++ mes %+ cook :: hexbyte
917 |=({a/@ b/@} (add (mul 16 a) b))
926 [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
937Parse Letters and `-`.
942 ++ nix (boss 256 (star ;~(pose aln cab))) ::
949 > `@t`(scan "as_me" nix)
960Parse a numeric character - A number.
965 ++ nud (shim '0' '9') :: numeric
975 [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
976 > (scan "0123456789" (star nud))
985Parse any printable character.
990 ++ prn ;~(less (just `@`127) (shim 32 256))
1010Parse an individual character to its cord atom representation.
1015 ++ qit ;~ pose :: chars in a cord
1016 ;~(less bas soq prn)
1017 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1025 > `@t`(scan "%" qit)
1035 > `@ux`(scan "\\0a" qit)
1037 > (scan "cord" (star qit))
1047Parse an individual character to its cord atom representation.
1052 ++ qit ;~ pose :: chars in a cord
1053 ;~(less bas soq prn)
1054 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1062 > `@t`(scan "%" qit)
1072 > `@ux`(scan "\\0a" qit)
1074 > (scan "cord" (star qit))
1085Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
1086quote (aka triple-soq) cord, between which must be in an indented block.
1091 ++ qut ;~ pose :: cord
1093 (ifix [soq soq] (boss 256 (more gon qit)))
1097 ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
1099 ;~(plug (just '\0a') soqs)
1100 (boss 256 (star qat))
1107 > (scan "'cord'" qut)
1114 Heredoc isn't prohibited from containing quotes
1116 'Heredoc isn't prohibited from containing quotes'
1125Parse a triple-single quote, used for multiline strings.
1130 ++ soz ;~(plug soq soq soq) :: delimiting '''
1136 [~~~27. ~~~27. ~~~27.]
1148A term: a letter(lowercase), followed by letters, numbers, or `-`.
1155 |=(a=tape (rap 3 ^-((list ,@) a)))
1156 ;~(plug low (star ;~(pose nud low hep)))
1162 > (scan "sam-2" sym)
1164 > `@t`(scan "sam-2" sym)
1181 ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
1186 =+ vex=?:(hom (bet tub) (gul tub))
1189 =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
1191 [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
1197 ~zod/arvo=/hoon/hoon> (scan "->+" ven)
1199 ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
1201 ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
1203 ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
1213Parse a standard base64 digit.
1218 ++ vit :: base64 digit
1220 (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
1221 (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
1222 (cook |=(a/@ (add a 4)) (shim '0' '9'))
1223 (cold 62 (just '-'))
1224 (cold 63 (just '+'))
1230 ~zod/arvo=/hoon/hoon> (scan "C" vit)
1232 ~zod/arvo=/hoon/hoon> (scan "c" vit)
1234 ~zod/arvo=/hoon/hoon> (scan "2" vit)
1236 ~zod/arvo=/hoon/hoon> (scan "-" vit)
1248 ++ vul %+ cold ~ :: comments
1254Parse comments and produce a null. Note that a comment must be ended
1255with a newline character.
1260 > (scan "::this is a comment \0a" vul)
1262 > (scan "::this is a comment " vul)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list