2title = "4j: Parsing (Bases and Base Digits)"
11A core containing numeric parser primitives.
24 <36.ecc 414.gly 100.xkc 1.ypj %164>
33Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
46 ++ bix (bass 16 (stun [2 2] six))
66Parsing `++rule`. Parses an atom of aura `@pE`, a phrase of two bytes
80 ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
86 > (scan "doznec" hif:ab)
88 > (scan "pittyp" hif:ab)
96Parse two phonetic pairs
98Parsing `++rule`. Parses and unscrambles an atom of aura @pF, a phrase
99of two two-byte pairs that are encoded (and scrambled) phonetically.
113 |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
114 ;~(plug hif ;~(pfix hep hif))
120 > (scan "pittyp-pittyp" huf:ab)
122 > (scan "tasfyn-partyv" huf:ab)
124 > `@ux`(scan "tasfyn-partyv" huf:ab)
132Parse 8 phonetic bytes
134Parsing `++rule`. Parses an atom of aura @pG, a phrase of eight of
148 ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
154 > (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
155 q=365.637.097.828.335.095
156 > `@u`~sondel-forsut-tillyn-nillyt
157 365.637.097.828.335.095
166Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
170Up to five @uv (base 64) digits.
179 ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
187 > (scan "290j" pev:ab)
189 > (scan "123456" pev:ab)
192 > (scan "090j" pev:ab)
193 ~ <syntax error at [1 11]>
202Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
206Up to five @uw (base 64) digits.
213 ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
221 > (scan "aQ~9" pew:ab)
225 > (scan "123456" pew:ab)
228 > (scan "012345" pew:ab)
239Parsing `++rule`. Parses exactly five base-32 digits.
248 ++ piv (bass 32 (stun [5 5] siv))
254 > (scan "10b3l" piv:ab)
267Parsing `++rule`. Parses exactly five base-64 digits.
276 ++ piw (bass 64 (stun [5 5] siw))
282 > (scan "2C-pZ" piw:ab)
295Parsing `++rule`. Parses a binary number of up to 4 digits in length without
305 ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
313 > (scan "101" qeb:ab)
315 > (scan "1111" qeb:ab)
317 > (scan "11111" qeb:ab)
331Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
332without a leading zero.
341 ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
349 > (scan "18ac" qex:ab)
351 > (scan "18acc" qex:ab)
354 > (scan "08ac" qex:ab)
365Parsing `++rule`. Parses exactly four binary digits.
374 ++ qib (bass 2 (stun [4 4] sib))
380 > (scan "0001" qib:ab)
382 > (scan "0100" qib:ab)
384 > (scan "110" qib:ab)
395Parsing `++rule`. Parses exactly four hexadecimal digits.
404 ++ qix (bass 16 (stun [4 4] six))
410 > (scan "0100" qix:ab)
412 > (scan "10ff" qix:ab)
425Parsing `++rule`. Parses the number 1.
434 ++ seb (cold 1 (just '1'))
443 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
446 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
456Parsing `++rule`. Parses a nonzero decimal digit.
465 ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
484Parsing `++rule`. Parses a nonzero base-32 digit
493 ++ sev ;~(pose sed sov)
501 ~zod/socialnet=> (scan "0" sev:ab)
512Parsing `++rule`. Parses a nonzero base-64 digit
521 ++ sew ;~(pose sed sow)
540Parsing `++rule`. Parses a nonzero hexadecimal digit.
549 ++ sex ;~(pose sed sox)
568Parsing `++rule`. Parses a binary digit.
577 ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
585 ~zod/socialnet=> (scan "0" sib:ab)
595Parsing `++rule`. Parses a decimal digit.
604 ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
620Parsing `++rule`. Parses a base-32 digit.
629 ++ siv ;~(pose sid sov)
645Parsing `++rule`. Parses a base-64 digit.
654 ++ siw ;~(pose sid sow)
670Parsing `++rule`. Parses a hexadecimal digit.
679 ++ six ;~(pose sid sox)
695Parsing `++rule`. Parses a base-32 letter.
704 ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
720Parsing `++rule`. Parses a base-64 letter/symbol.
730 (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
731 (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
750Parsing `++rule`. Parses a hexadecimal letter.
759 ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
775Parsing `++rule`. Parses a decimal number of up to 3 digits without a
785 ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
793 > (scan "214" ted:ab)
795 > (scan "2140" ted:ab)
808Parsing `++rule`. Parses the leading phonetic byte, which represents a
818 ++ tip (sear |=(a/@ (ins:po a)) til)
824 > (scan "doz" tip:ab)
827 > (scan "pit" tip:ab)
835Trailing phonetic syllable
837Parsing `++rule`. Parses the trailing phonetic byte, which represents a
847 ++ tiq (sear |=(a/@ (ind:po a)) til)
854 > (scan "zod" tiq:ab)
856 > (scan "nec" tiq:ab)
864Parse 3 decimal digits
866Parsing `++rule`. Parses exactly three decimal digits.
875 ++ tid (bass 10 (stun [3 3] sid))
881 > (scan "013" tid:ab)
894Parsing `++rule`. Parses exactly three lowercase letters.
903 ++ til (boss 256 (stun [3 3] low))
909 > (scan "mer" til:ab)
911 > `@t`(scan "mer" til:ab)
924Parsing rule. Parses characters from an atom of the span aura `@ta`.
934 |=(a/tape (rap 3 ^-((list @) a)))
935 (star ;~(pose nud low hep dot sig cab))
941 > `@ta`(scan "asa-lom_tak" urs:ab)
943 > `@t`(scan "asa-lom_tak" urs:ab)
953Parsing rule. Parses all characters of the span aura `@ta` except
964 |=(a/tape (rap 3 ^-((list @) a)))
965 (star ;~(pose nud low hep dot sig))
971 > `@t`(scan "asa-lom.t0k" urt:ab)
979Parse bas, soq, or bix
981Parsing rule. Parses an escaped backslash, single quote, or hex pair
991 ++ voy ;~(pfix bas ;~(pose bas soq bix))
997 > (scan "\\0a" voy:ab)
999 > (scan "\\'" voy:ab)
1007Top-level atom parser engine
1009A core containing top-level atom parsers.
1026 <14.vpu 414.mof 100.xkc 1.ypj %164>
1035Parser modifier. Parses 0 or the sample rule `fel`.
1046 ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1052 > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1062Parsing rule. Parses a binary number without a leading zero.
1071 ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1077 > (scan "10.0110" bay:ag)
1087Parsing rule. Parses a `@is`, an IPv6 address.
1096 ++ bip =+ tod=(ape qex:ab)
1097 (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1103 > (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1104 q=283.183.420.760.121.105.516.068.864
1105 > `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1106 .0.0.ea.3e6c.0.0.0.0
1113Parse decimal with dots
1115Parsing rule. Parses a decimal number that includes dot separators.
1124 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1130 > (scan "52" dem:ag)
1132 > (scan "13.507" dem:ag)
1142Parsing rule. Parses a decimal number without a leading zero.
1151 ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1157 > (scan "52" dim:ag)
1159 > (scan "013507" dim:ag)
1168Parse decimal with leading `0`
1170Parsing rule. Parses a decmial number with leading zeroes.
1179 ++ dum (bass 10 (plus sid:ab))
1185 > (scan "52" dum:ag)
1187 > (scan "0000052" dum:ag)
1189 > (scan "13507" dim:ag)
1199Parsing rule. Parses an atom of aura `@p`, the phonetic base.
1209 (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1219 > (scan "zod" fed:ag)
1221 > (scan "nec" fed:ag)
1223 > (scan "sondel" fed:ag)
1227 > (scan "tillyn-nillyt" fed:ag)
1229 > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1230 15.331.165.687.565.582.592
1231 > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1232 282.810.089.790.159.633.869.501.053.313.363.681.181
1241Parsing rule. Parses a hexadecimal number
1250 ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1258 > (scan "1a" hex:ag)
1260 > (scan "3.ac8d" hex:ag)
1262 > `@ux`(scan "3.ac8d" hex:ag)
1272Parsing rule. Parses an IPv4 address.
1281 ++ lip =+ tod=(ape ted:ab)
1282 (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1288 > (scan "127.0.0.1" lip:ag)
1290 > `@if`(scan "127.0.0.1" lip:ag)
1292 > `@if`(scan "8.8.8.8" lip:ag)
1300Parse Base-32 with dots
1302Parsing rule. Parses a Base-32 number with dot separators.
1311 ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1317 > (scan "e2.ol4pm" viz:ag)
1327Parsing rule. Parses a raw base-32 string.
1336 ++ vum (bass 32 (plus siv:ab))
1342 > (scan "e2ol4pm" vum:ag)
1352Parsing rule. Parses a base-64 number.
1361 ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1369 > (scan "e2O.l4Xpm" wiz:ag)
1370 q=61.764.130.813.526
1377Core used to scramble 16-bit atoms
1379A door that contains arms that are used to scramble two atoms, `top`
1380and `bot`. Used especially in the phonetic base to disguise the
1381relationship between a planet and its star.
1401 > ~(. mu 0x20e5 0x5901)
1402 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
1411Produces the cell of `top` and `bot` with `top` scrambled to the result
1412of adding `bot` to `top` modulo 16. Used to scramble the name of a
1426 ++ zag [p=(end 4 1 (add top bot)) q=bot]
1432 > `[@ux @ux]`~(zag mu 0x20e0 0x201)
1440Subtract bottom from top
1442The inverse of `++zag`. Produces the cell of `top` and `bot` with
1443`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1444and the 16-bit complement of `bot`. Used to unscramble the name of the
1458 ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1464 > `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1472Concatenate into atom
1474Produces the concatenation of `top` and `bot`. Used to assemble a
1488 ++ zug (mix (lsh 4 1 top) bot)
1494 > `@ux`~(zug mu 0x10e1 0xfa)
1502Digit rendering engine
1504A door containing arms that render digits at bases 10, 16, 32, and 64.
1523 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1532Renders a decimal digit as an atom of an ACII byte value.
1560Renders a hexadecimal digit as an atom of an ASCII byte value.
1571 ++ x ?:((gte tig 10) (add tig 87) d)
1590Renders a base-32 digit as an atom of an ASCII byte value.
1599 ++ v ?:((gte tig 10) (add tig 87) d)
1619Renders a base-64 digit as an atom of an ASCII byte value.
1630 ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
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