@@ -276,1052 +276,4 @@ Renders a coin `lot` as a tape.
282−Alphabetic characters
284−Parse alphabetic characters, both upper and lowercase.
289− ++ alf ;~(pose low hig) :: alphabetic
301− > (scan "AaBbCc" (star alf))
309−Alphanumeric characters
311−Parse alphanumeric characters - both alphabetic characters and numbers.
316− ++ aln ;~(pose low hig nud) :: alphanumeric
325− > (scan "alf42" (star aln))
328− > (scan "0123456789abcdef" (star aln))
338−Parse alphanumeric strings and hep, "-".
343− ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
355− > (scan "123abc-" (star alp))
366−Parse the hep and lus axis syntax.
371− ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
390−Parse a tape of binary (0s and 1s) and produce its atomic representation.
395− ++ bin (bass 2 (most gon but)) :: binary to atom
410− > (scan "100000001111" bin)
420−Parse a single binary digit.
425− ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
439− > (scan "01" (star but))
449−Parse a single octal digit.
454− ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
468− > (scan "60" (star cit))
478−Parse a decimal number to an atom.
483− ++ dem (bass 10 (most gon dit)) :: decimal to atom
493− > (scan "150000000" dem)
495− > (scan "12456" dem)
505−Parse a single decimal digit.
510− ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
518− > (scan "42" (star dit))
520− > (scan "26000" (star dit))
530−Dot followed by an optional gap, used with numbers.
535− ++ dog ;~(plug dot gay) ::
545− > (scan "a. " ;~(pfix alf dog))
555−Phonetic base phrase separator
560− ++ doh ;~(plug ;~(plug hep hep) gay) ::
566− /> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
567− ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
568− /> ~nopfel-botduc-nilnev-dolfyn--
569− haspub-natlun-lodmur-holtyd
570− ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
583−Parse phep, `--`, to null, `~`.
588− ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
596− > (dun [[1 1] "--"])
597− [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
607−Parse stet, `==`, to null `~`.
612− ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
620− > (duz [[1 1] "== |=..."])
621− [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
631−Whitespace component, either newline or space.
636− ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
642− /> ^- * :: show spaces
648− [32 32 32 45 10 32 45 10 32 32 45 0]
653− [32 32 32 10 32 10 32 32 0]
655− %- scan :_ (star gah)
659− ~[32 32 32 10 32 10 32 32]
673− ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
682−Two spaces, a newline, or comment.
687− ++ gaq ;~ pose :: end of line
689− ;~(plug gah ;~(pose gah vul))
706− ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
720− ++ gay ;~(pose gap (easy ~)) ::
728−Parse long numbers - Numbers which wrap around the shell with the line
733− ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
742− > (gon [[1 1] "\\/"])
743− [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
750−Axis syntax `<` or `>`
752−Parse the axis gal and gar axis syntax.
757− ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
776−Parse any hexadecimal number to an atom.
781− ++ hex (bass 16 (most gon hit)) :: hex to atom
797− > (scan "1EE7F7" hex)
799− > `@ux`(scan "1EE7F7" hex)
808−Parse a single uppercase letter.
813− ++ hig (shim 'A' 'Z') :: uppercase
822− > `cord`(scan "G" hig)
825− > (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
826− "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
829− [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
838−Parse a single hexadecimal digit.
843− ++ hit ;~ pose :: hex digits
845− (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
846− (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
858− [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
859− > (scan "2A" (star hit))
868−Apply `++rule` to indented block starting at current column number, omitting
869−the leading whitespace.
882− ++ inde |* sef/rule :: indentation block
884− =+ [har tap]=[p q]:+<
885− =+ lev=(fil 3 (dec q.har) ' ')
886− =+ eol=(just `@t`10)
887− =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
888− ;~(simu ;~(plug eol eol) eol)
890− =+ vex=(sef har(q 1) p.u.q.roq)
891− =+ fur=p.vex(q (add (dec q.har) q.p.vex))
893− =- vex(p fur, u.q -)
895− &4.vex(q.p (add (dec q.har) q.p.&4.vex))
898− ?. =(10 -.res) [-.res $(res +.res)]
899− (welp [`@t`10 (trip lev)] $(res +.res))
906− > (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
908− > (scan "abc" (star ;~(pose prn (just `@`10))))
910− > (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
913− > (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
916− > (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
927−Parse a single lowercase letter.
932− ++ low (shim 'a' 'z') :: lowercase
940− > `cord`(scan "g" low)
942− > (scan "abcdefghijklmnopqrstuvwxyz" (star low))
943− "abcdefghijklmnopqrstuvwxyz"
945− [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
959− ++ mes %+ cook :: hexbyte
960− |=({a/@ b/@} (add (mul 16 a) b))
969− > (mes [[1 1] "2A"])
970− [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
981−Parse Letters and `-`.
986− ++ nix (boss 256 (star ;~(pose aln cab))) ::
992− > (scan "as_me" nix)
995− > `@t`(scan "as_me" nix)
1006−Parse a numeric character - A number.
1011− ++ nud (shim '0' '9') :: numeric
1021− > (nud [[1 1] "1"])
1022− [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
1023− > (scan "0123456789" (star nud))
1032−Parse any printable character.
1037− ++ prn ;~(less (just `@`127) (shim 32 256))
1058−Parse an individual character to its cord atom representation.
1063− ++ qit ;~ pose :: chars in a cord
1064− ;~(less bas soq prn)
1065− ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1074− > `@t`(scan "%" qit)
1082− > (scan "\\0a" qit)
1084− > `@ux`(scan "\\0a" qit)
1086− > (scan "cord" (star qit))
1096−Parse an individual character to its cord atom representation.
1101− ++ qit ;~ pose :: chars in a cord
1102− ;~(less bas soq prn)
1103− ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1112− > `@t`(scan "%" qit)
1120− > (scan "\\0a" qit)
1122− > `@ux`(scan "\\0a" qit)
1124− > (scan "cord" (star qit))
1135−Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
1136−quote (aka triple-soq) cord, between which must be in an indented block.
1141− ++ qut ;~ pose :: cord
1143− (ifix [soq soq] (boss 256 (more gon qit)))
1147− ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
1149− ;~(plug (just '\0a') soqs)
1150− (boss 256 (star qat))
1158− > (scan "'cord'" qut)
1165− Heredoc isn't prohibited from containing quotes
1167− 'Heredoc isn't prohibited from containing quotes'
1176−Parse a triple-single quote, used for multiline strings.
1181− ++ soz ;~(plug soq soq soq) :: delimiting '''
1188− [~~~27. ~~~27. ~~~27.]
1200−A term: a letter(lowercase), followed by letters, numbers, or `-`.
1207− |=(a=tape (rap 3 ^-((list ,@) a)))
1208− ;~(plug low (star ;~(pose nud low hep)))
1215− > (scan "sam-2" sym)
1217− > `@t`(scan "sam-2" sym)
1234− ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
1239− =+ vex=?:(hom (bet tub) (gul tub))
1242− =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
1244− [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
1251− ~zod/arvo=/hoon/hoon> (scan "->+" ven)
1254− ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
1257− ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
1260− ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
1270−Parse a standard base64 digit.
1275− ++ vit :: base64 digit
1277− (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
1278− (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
1279− (cook |=(a/@ (add a 4)) (shim '0' '9'))
1280− (cold 62 (just '-'))
1281− (cold 63 (just '+'))
1288− ~zod/arvo=/hoon/hoon> (scan "C" vit)
1290− ~zod/arvo=/hoon/hoon> (scan "c" vit)
1292− ~zod/arvo=/hoon/hoon> (scan "2" vit)
1294− ~zod/arvo=/hoon/hoon> (scan "-" vit)
1306− ++ vul %+ cold ~ :: comments
1313−Parse comments and produce a null. Note that a comment must be ended
1314−with a newline character.
1319− > (scan "::this is a comment \0a" vul)
1321− > (scan "::this is a comment " vul)