on 140ac0e help sign in
1263 lines 22 kB history raw
1# 4k: atom printing
2### `++co`
4Literal rendering engine
6A door that contains arms that operate on the sample coin `lot`.
8Accepts
9-------
11Produces
12--------
14`lot` is a `++coin`.
16Source
17------
19 ++ co !.
20 ~% %co ..co ~
21 =< |_ lot/coin
24Examples
25--------
27 > < 3.nta
28 { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
29 <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
30 }
31 >
33------------------------------------------------------------------------
35### `++rear`
37Prepend & render as tape
39Renders a coin `lot` as a tape prepended to the sample tape `rom`.
41Accepts
42-------
44Produces
45--------
47`rom` is a `pe`
49`lot` is a `++coin`.
51Source
52------
54 ++ rear |=(rom/tape =>(.(rex rom) rend))
56Examples
57--------
59 > (~(rear co %$ %ux 200) "--ha")
60 "0xc8--ha"
62------------------------------------------------------------------------
64### `++rent`
66Render as span
68Renders a coin `lot` as a span.
70Accepts
71-------
73Produces
74--------
76`lot` is a `++coin`.
78Source
79------
81 ++ rent `@ta`(rap 3 rend)
83Examples
84--------
86 > ~(rent co %$ %ux 200)
87 ~.0xc8
88 > `@t`~(rent co %$ %ux 200)
89 '0xc8'
91------------------------------------------------------------------------
93### `++rend`
95Render as tape
97Renders a coin `lot` as a tape.
99Accepts
100-------
102Produces
103--------
105`lot` is a `++coin`.
107Source
108------
110 ++ rend
111 ^- tape
112 ?: ?=($blob -.lot)
113 ['~' '0' ((v-co 1) (jam p.lot))]
114 ?: ?=($many -.lot)
115 :- '.'
116 |- ^- tape
117 ?~ p.lot
118 ['_' '_' rep]
119 ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
120 =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
121 |- ^- tape
122 ?+ yed (z-co q.p.lot)
123 $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
124 $d
125 ?+ hay (z-co q.p.lot)
126 $a
127 =+ yod=(yore q.p.lot)
128 => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
129 => ^+ .
130 %= .
131 rep
132 ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
133 rep
134 => .(rep ['.' (y-co s.t.yod)])
135 => .(rep ['.' (y-co m.t.yod)])
136 ['.' '.' (y-co h.t.yod)]
137 ==
138 => .(rep ['.' (a-co d.t.yod)])
139 => .(rep ['.' (a-co m.yod)])
140 => .(rep ?:(a.yod rep ['-' rep]))
141 ['~' (a-co y.yod)]
142 ::
143 $r
144 =+ yug=(yell q.p.lot)
145 => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
146 :- '~'
147 ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
148 ['s' '0' rep]
149 => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
150 => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
151 => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
152 => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
153 +.rep
154 ==
155 ::
156 $f
157 ?: =(& q.p.lot)
158 ['.' 'y' rep]
159 ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
160 ::
161 $n ['~' rep]
162 $i
163 ?+ hay (z-co q.p.lot)
164 $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
165 $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
166 ==
167 ::
168 $p
169 =+ dyx=(met 3 q.p.lot)
170 :- '~'
171 ?: (lte dyx 1)
172 (weld (trip (tod:po q.p.lot)) rep)
173 ?: =(2 dyx)
174 ;: weld
175 (trip (tos:po (end 3 1 q.p.lot)))
176 (trip (tod:po (rsh 3 1 q.p.lot)))
177 rep
178 ==
179 =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
180 |- ^- tape
181 ?: =(0 dyz)
182 rep
183 %= $
184 fin &
185 dub !dub
186 dyz (dec dyz)
187 q.p.lot (rsh 5 1 q.p.lot)
188 rep
189 =+ syb=(wren:un (end 5 1 q.p.lot))
190 =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
191 ;: weld
192 (trip (tos:po (end 3 1 p.cog)))
193 (trip (tod:po (rsh 3 1 p.cog)))
194 `tape`['-' ~]
195 (trip (tos:po (end 3 1 q.cog)))
196 (trip (tod:po (rsh 3 1 q.cog)))
197 `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
198 rep
199 ==
200 ==
201 ::
202 $r
203 ?+ hay (z-co q.p.lot)
204 $d ['.' '~' (r-co (rlyd q.p.lot))]
205 $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
206 $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
207 $s ['.' (r-co (rlys q.p.lot))]
208 ==
209 ::
210 $u
211 ?: ?=($c hay)
212 %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
213 (c-co (enc:fa q.p.lot))
214 =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
215 ^= gam ^- {p/tape q/tape}
216 ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
217 $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
218 $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
219 $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
220 $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
221 $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
222 ==
223 ::
224 $s
225 %+ weld
226 ?:((syn:si q.p.lot) "--" "-")
227 $(yed 'u', q.p.lot (abs:si q.p.lot))
228 ::
229 $t
230 ?: =('a' hay)
231 ?: =('s' (cut 3 [2 1] p.p.lot))
232 (weld (rip 3 q.p.lot) rep)
233 ['~' '.' (weld (rip 3 q.p.lot) rep)]
234 ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
235 ==
236 --
238Examples
239--------
241 > ~(rend co ~ %ux 200)
242 "0xc8"
243 > ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
244 "._0xc8_~~tem__"
245 > ~(rend co ~ %p 32.819)
246 "~pillyt"
247 > ~(rend co ~ %ux 18)
248 "0x12"
249 > ~(rend co [~ p=[p=%if q=0x7f00.0001]])
250 ".127.0.0.1"
251 > `@ux`.127.0.0.1
252 2.130.706.433
253 > ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
254 "._20_0w25_sam__"
255 > ~(rend co %blob [1 1])
256 "~0ph"
257 > ~0ph
258 [1 1]
259 > `@uv`(jam [1 1])
260 0vph
264***
265### `++alf`
267Alphabetic characters
269Parse alphabetic characters, both upper and lowercase.
271Source
272------
274 ++ alf ;~(pose low hig) :: alphabetic
276Examples
277--------
279 > (scan "a" alf)
280 ~~a
281 > (scan "A" alf)
282 ~~~41.
283 > (scan "AaBbCc" (star alf))
284 "AaBbCc"
288***
289### `++aln`
291Alphanumeric characters
293Parse alphanumeric characters - both alphabetic characters and numbers.
295Source
296------
298 ++ aln ;~(pose low hig nud) :: alphanumeric
300Examples
301--------
303 > (scan "0" aln)
304 ~~0
305 > (scan "alf42" (star aln))
306 "alf42"
307 > (scan "0123456789abcdef" (star aln))
308 "0123456789abcdef"
312***
313### `++alp`
315Alphanumeric and `-`
317Parse alphanumeric strings and hep, "-".
319Source
320------
322 ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
324Examples
325--------
327 > (scan "7" alp)
328 ~~7
329 > (scan "s" alp)
330 ~~s
331 > (scan "123abc-" (star alp))
332 "123abc-"
336***
338### `++bet`
340Axis syntax `-`, `+`
342Parse the hep and lus axis syntax.
344Source
345------
347 ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
349Examples
350--------
352 > (scan "-" bet)
353 2
354 > (scan "+" bet)
355 3
359***
360### `++bin`
362Binary to atom
364Parse a tape of binary (0s and 1s) and produce its atomic representation.
366Source
367------
369 ++ bin (bass 2 (most gon but)) :: binary to atom
371Examples
372--------
374 > (scan "0000" bin)
375 0
376 > (scan "0001" bin)
377 1
378 > (scan "0010" bin)
379 2
380 > (scan "100000001111" bin)
381 2.063
385***
386### `++but`
388Binary digit
390Parse a single binary digit.
392Source
393------
395 ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
397Examples
398--------
400 > (scan "0" but)
401 0
402 > (scan "1" but)
403 1
404 > (scan "01" but)
405 ! {1 2}
406 ! 'syntax-error'
407 ! exit
408 > (scan "01" (star but))
409 ~[0 1]
413***
414### `++cit`
416Octal digit
418Parse a single octal digit.
420Source
421------
423 ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
425Examples
426--------
428 > (scan "1" cit)
429 1
430 > (scan "7" cit)
431 7
432 > (scan "8" cit)
433 ! {1 1}
434 ! 'syntax-error'
435 ! exit
436 > (scan "60" (star cit))
437 ~[6 0]
441***
442### `++dem`
444Decimal to atom
446Parse a decimal number to an atom.
448Source
449------
451 ++ dem (bass 10 (most gon dit)) :: decimal to atom
453Examples
454--------
456 > (scan "7" dem)
457 7
458 > (scan "42" dem)
459 42
460 > (scan "150000000" dem)
461 150.000.000
462 > (scan "12456" dem)
463 12.456
467***
468### `++dit`
470Decimal digit
472Parse a single decimal digit.
474Source
475------
477 ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
479Examples
480--------
482 > (scan "7" dit)
483 7
484 > (scan "42" (star dit))
485 ~[4 2]
486 > (scan "26000" (star dit))
487 ~[2 6 0 0 0]
491***
492### `++dog`
494`.` optional gap
496Dot followed by an optional gap, used with numbers.
498Source
499------
501 ++ dog ;~(plug dot gay) ::
503Examples
504--------
506 /> 1.234.
507 703
508 1.234.703
509 > (scan "a. " ;~(pfix alf dog))
510 [~~~. ~]
514***
515### `++doh`
517`@p` separator
519Phonetic base phrase separator
521Source
522------
524 ++ doh ;~(plug ;~(plug hep hep) gay) ::
526Examples
527--------
529 /> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
530 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
531 /> ~nopfel-botduc-nilnev-dolfyn--
532 haspub-natlun-lodmur-holtyd
533 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
534 > (scan "--" doh)
535 [[~~- ~~-] ~]
536 > (scan "-- " doh)
537 [[~~- ~~-] ~]
541***
542### `++dun`
544`--` to `~`
546Parse phep, `--`, to null, `~`.
548Source
549------
551 ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
553Examples
554--------
556 > (scan "--" dun)
557 ~
558 > (dun [[1 1] "--"])
559 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
563***
565### `++duz`
567`==` to `~`
569Parse stet, `==`, to null `~`.
571Source
572------
574 ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
576Examples
577--------
579 > (scan "==" duz)
580 ~
581 > (duz [[1 1] "== |=..."])
582 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
586***
588### `++gah`
590Newline or ' '
592Whitespace component, either newline or space.
594Source
595------
597 ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
599Examples
600--------
602 /> ^- * :: show spaces
603 """
604 -
605 -
606 -
607 """
608 [32 32 32 45 10 32 45 10 32 32 45 0]
609 /> ^- *
610 """
612 """
613 [32 32 32 10 32 10 32 32 0]
614 /> ^- (list ,@)
615 %- scan :_ (star gah)
616 """
618 """
619 ~[32 32 32 10 32 10 32 32]
623***
624### `++gap`
626Plural whitespace
628Separates tall runes
630Source
631------
633 ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
637***
638### `++gaq`
640End of line
642Two spaces, a newline, or comment.
644Source
645------
647 ++ gaq ;~ pose :: end of line
648 (just `@`10)
649 ;~(plug gah ;~(pose gah vul))
650 vul
651 ==
656***
657### `++gaw`
659Classic whitespace
661Terran whitespace.
663Source
664------
666 ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
670***
671### `++gay`
673Optional gap
675Optional gap.
677Source
678------
680 ++ gay ;~(pose gap (easy ~)) ::
684***
685### `++gon`
687Long numbers
689Parse long numbers - Numbers which wrap around the shell with the line
691Source
692------
694break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
696Examples
697--------
698characters bas and fas.
700 > (scan "\\/" gon)
701 [~~~5c. ~ ~~~2f.]
702 > (gon [[1 1] "\\/"])
703 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
707***
708### `++gul`
710Axis syntax `<` or `>`
712Parse the axis gal and gar axis syntax.
714Source
715------
717 ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
719Examples
720--------
722 > (scan "<" gul)
723 2
724 > (scan ">" gul)
725 3
729***
730### `++hex`
732Hex to atom
734Parse any hexadecimal number to an atom.
736Source
737------
739 ++ hex (bass 16 (most gon hit)) :: hex to atom
741Examples
742--------
744 > (scan "a" hex)
745 10
746 > (scan "A" hex)
747 10
748 > (scan "2A" hex)
749 42
750 > (scan "1ee7" hex)
751 7.911
752 > (scan "1EE7" hex)
753 7.911
754 > (scan "1EE7F7" hex)
755 2.025.463
756 > `@ux`(scan "1EE7F7" hex)
757 0x1e.e7f7
760***
761### `++hig`
763Uppercase
765Parse a single uppercase letter.
767Source
768------
770 ++ hig (shim 'A' 'Z') :: uppercase
772Examples
773--------
775 > (scan "G" hig)
776 ~~~47.
777 > `cord`(scan "G" hig)
778 'G'
779 > (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
780 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
781 > (hig [[1 1] "G"])
782 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
786***
787### `++hit`
789Hex digits
791Parse a single hexadecimal digit.
793Source
794------
796 ++ hit ;~ pose :: hex digits
797 dit
798 (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
799 (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
800 ==
802Examples
803--------
805 > (scan "a" hit)
806 10
807 > (scan "A" hit)
808 10
809 > (hit [[1 1] "a"])
810 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
811 > (scan "2A" (star hit))
812 ~[2 10]
815***
816### `++iny`
818Indentation block
820Apply `++rule` to indented block starting at current column number, omitting
821the leading whitespace.
823Accepts
824-------
826`sef` is a `++rule`
828Produces
829--------
831A `++rule`.
833Source
834------
836 ++ inde |* sef/rule :: indentation block
837 |= nail ^+ (sef)
838 =+ [har tap]=[p q]:+<
839 =+ lev=(fil 3 (dec q.har) ' ')
840 =+ eol=(just `@t`10)
841 =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
842 ;~(simu ;~(plug eol eol) eol)
843 ?~ q.roq roq
844 =+ vex=(sef har(q 1) p.u.q.roq)
845 =+ fur=p.vex(q (add (dec q.har) q.p.vex))
846 ?~ q.vex vex(p fur)
847 =- vex(p fur, u.q -)
848 :+ &3.vex
849 &4.vex(q.p (add (dec q.har) q.p.&4.vex))
850 =+ res=|4.vex
851 |- ?~ res |4.roq
852 ?. =(10 -.res) [-.res $(res +.res)]
853 (welp [`@t`10 (trip lev)] $(res +.res))
854 ::
856Examples
857--------
859 > (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
860 "abc"
861 > (scan "abc" (star ;~(pose prn (just `@`10))))
862 "abc"
863 > (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
864 "abc
865 de"
866 > (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
867 ! {1 6}
868 ! exit
869 > (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
870 "abc
871 de"
875***
876### `++low`
878Lowercase
880Parse a single lowercase letter.
882Source
883------
885 ++ low (shim 'a' 'z') :: lowercase
887Examples
888--------
890 > (scan "g" low)
891 ~~g
892 > `cord`(scan "g" low)
893 'g'
894 > (scan "abcdefghijklmnopqrstuvwxyz" (star low))
895 "abcdefghijklmnopqrstuvwxyz"
896 > (low [[1 1] "g"])
897 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
901***
902### `++mes`
904Hexbyte
906Parse a hexbyte.
908Source
909------
911 ++ mes %+ cook :: hexbyte
912 |=({a/@ b/@} (add (mul 16 a) b))
913 ;~(plug hit hit)
915Examples
916--------
918 > (scan "2A" mes)
919 42
920 > (mes [[1 1] "2A"])
921 [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
922 > (scan "42" mes)
923 66
927***
928### `++nix`
930Letters and `-`
932Parse Letters and `-`.
934Source
935------
937 ++ nix (boss 256 (star ;~(pose aln cab))) ::
939Examples
940--------
942 > (scan "as_me" nix)
943 q=435.626.668.897
944 > `@t`(scan "as_me" nix)
945 'as_me'
949***
951### `++nud`
953Numeric
955Parse a numeric character - A number.
957Source
958------
960 ++ nud (shim '0' '9') :: numeric
962Examples
963--------
965 > (scan "0" nud)
966 ~~0
967 > (scan "7" nud)
968 ~~7
969 > (nud [[1 1] "1"])
970 [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
971 > (scan "0123456789" (star nud))
972 "0123456789"
975***
976### `++prn`
978Printable character
980Parse any printable character.
982Source
983------
985 ++ prn ;~(less (just `@`127) (shim 32 256))
987Examples
988--------
990 > (scan "h" prn)
991 ~~h
992 > (scan "!" prn)
993 ~~~21.
994 > (scan "\01" prn)
995 ! {1 1}
996 ! exit
1000***
1001### `++qit`
1003Chars in cord
1005Parse an individual character to its cord atom representation.
1007Source
1008------
1010 ++ qit ;~ pose :: chars in a cord
1011 ;~(less bas soq prn)
1012 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1013 ==
1015Examples
1016--------
1018 > (scan "%" qit)
1019 37
1020 > `@t`(scan "%" qit)
1021 '%'
1022 > (scan "0" qit)
1023 48
1024 > (scan "E" qit)
1025 69
1026 > (scan "a" qit)
1027 97
1028 > (scan "\\0a" qit)
1029 10
1030 > `@ux`(scan "\\0a" qit)
1031 0xa
1032 > (scan "cord" (star qit))
1033 ~[99 111 114 100]
1037***
1038### `++qit`
1040Chars in cord
1042Parse an individual character to its cord atom representation.
1044Source
1045------
1047 ++ qit ;~ pose :: chars in a cord
1048 ;~(less bas soq prn)
1049 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1050 ==
1052Examples
1053--------
1055 > (scan "%" qit)
1056 37
1057 > `@t`(scan "%" qit)
1058 '%'
1059 > (scan "0" qit)
1060 48
1061 > (scan "E" qit)
1062 69
1063 > (scan "a" qit)
1064 97
1065 > (scan "\\0a" qit)
1066 10
1067 > `@ux`(scan "\\0a" qit)
1068 0xa
1069 > (scan "cord" (star qit))
1070 ~[99 111 114 100]
1075***
1076### `++qut`
1078Cord
1080Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
1081quote (aka triple-soq) cord, between which must be in an indented block.
1083Source
1084------
1086 ++ qut ;~ pose :: cord
1087 ;~ less soqs
1088 (ifix [soq soq] (boss 256 (more gon qit)))
1089 ==
1090 %- inde %+ ifix
1091 :- ;~ plug soqs
1092 ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
1093 ==
1094 ;~(plug (just '\0a') soqs)
1095 (boss 256 (star qat))
1096 ==
1097 ::
1099Examples
1100--------
1102 > (scan "'cord'" qut)
1103 q=1.685.221.219
1104 > 'cord'
1105 'cord'
1106 > `@ud`'cord'
1107 1.685.221.219
1108 /> '''
1109 Heredoc isn't prohibited from containing quotes
1110 '''
1111 'Heredoc isn't prohibited from containing quotes'
1115***
1116### `++soz`
1118Delimiting `'''`
1120Parse a triple-single quote, used for multiline strings.
1122Source
1123------
1125 ++ soz ;~(plug soq soq soq) :: delimiting '''
1127Examples
1128--------
1130 > (scan "'''" soz)
1131 [~~~27. ~~~27. ~~~27.]
1132 > (rash '"""' soz)
1133 ! {1 1}
1134 ! exit
1138***
1139### `++sym`
1141Term
1143A term: a letter(lowercase), followed by letters, numbers, or `-`.
1145Source
1146------
1148 ++ sym
1149 %+ cook
1150 |=(a=tape (rap 3 ^-((list ,@) a)))
1151 ;~(plug low (star ;~(pose nud low hep)))
1152 ::
1154Examples
1155--------
1157 > (scan "sam-2" sym)
1158 215.510.507.891
1159 > `@t`(scan "sam-2" sym)
1160 'sam-2'
1161 > (scan "sym" sym)
1162 7.174.515
1166***
1167### `++ven`
1169`+>-` axis syntax
1171Axis syntax parser
1173Source
1174------
1176 ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
1177 bet
1178 =+ hom=`?`|
1179 |= tub/nail
1180 ^- (like axis)
1181 =+ vex=?:(hom (bet tub) (gul tub))
1182 ?~ q.vex
1183 [p.tub [~ 1 tub]]
1184 =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
1185 ?> ?=(^ q.wag)
1186 [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
1187 ==
1189Examples
1190--------
1192 ~zod/arvo=/hoon/hoon> (scan "->+" ven)
1193 11
1194 ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
1195 0b1011
1196 ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
1197 11
1198 ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
1199 [3 4]
1203***
1204### `++vit`
1206Base64 digit
1208Parse a standard base64 digit.
1210Source
1211------
1213 ++ vit :: base64 digit
1214 ;~ pose
1215 (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
1216 (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
1217 (cook |=(a/@ (add a 4)) (shim '0' '9'))
1218 (cold 62 (just '-'))
1219 (cold 63 (just '+'))
1220 ==
1222Examples
1223--------
1225 ~zod/arvo=/hoon/hoon> (scan "C" vit)
1227 ~zod/arvo=/hoon/hoon> (scan "c" vit)
1228 28
1229 ~zod/arvo=/hoon/hoon> (scan "2" vit)
1230 54
1231 ~zod/arvo=/hoon/hoon> (scan "-" vit)
1232 62
1235***
1236### `++vul`
1238Comments to null
1240Source
1241------
1243 ++ vul %+ cold ~ :: comments
1244 ;~ plug col col
1245 (star prn)
1246 (just `@`10)
1247 ==
1249Parse comments and produce a null. Note that a comment must be ended
1250with a newline character.
1252Examples
1253--------
1255 > (scan "::this is a comment \0a" vul)
1257 > (scan "::this is a comment " vul)
1258 ! {1 21}
1259 ! exit
1263***