@@ -13,15 +13,15 @@ A core containing numeric parser primitives.
13#### Source
13#### Source
20#### Examples
20#### Examples
24− <36.ecc 414.gly 100.xkc 1.ypj %164>
24+<36.ecc 414.gly 100.xkc 1.ypj %164>
@@ -30,330 +30,381 @@ A core containing numeric parser primitives.
31Parse hex pair
31Parse hex pair
33−Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
33+Parsing `rule`. Parses a pair of base-16 digits. Used in escapes.
43#### Source
35#### Source
46− ++ bix (bass 16 (stun [2 2] six))
38+++ bix (bass 16 (stun [2 2] six))
49#### Examples
41#### Examples
52− > (scan "07" bix:ab)
44+> (scan "07" bix:ab)
54− > (scan "51" bix:ab)
46+> (scan "51" bix:ab)
56− > (scan "a3" bix:ab)
48+> (scan "a3" bix:ab)
62−### `++hif:ab`
54+### `++fem:ab`
64−Parse phonetic pair
56+Parse base58check char
66−Parsing `++rule`. Parses an atom of aura `@pE`, a phrase of two bytes
58+Parse a single base58check character.
69−#### Accepts
60+#### Source
63+++ fem (sear |=(a=@ (cha:fa a)) aln)
73−#### Produces
66+#### Examples
83+Parse non-doz phonetic pair
85+Parsing `rule`. Parses an atom of aura `@pE`, a phrase of two bytes encoded
86+phonetically. If the leading syllable is `doz` (`0`), parsing will fail.
77#### Source
88#### Source
80− ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
91+++ haf (bass 256 ;~(plug tep tiq (easy ~)))
83#### Examples
94#### Examples
86− > (scan "doznec" hif:ab)
97+> `@p`(scan "sampel" haf:ab)
88− > (scan "pittyp" hif:ab)
99+
89− q=48.626
100+> `@p`(scan "dozpel" haf:ab)
94−### `++huf:ab`
107+### `++hef:ab`
96−Parse two phonetic pairs
109+Parse non-dozzod phonetic pair
98−Parsing `++rule`. Parses and unscrambles an atom of aura @pF, a phrase
111+Parsing `rule`. Parses an atom of aura `@pE` without leading `~` or `.~`, a
99−of two two-byte pairs that are encoded (and scrambled) phonetically.
112+phrase of two bytes encoded phonetically. If it's `dozzod`, parsing will fail.
101−#### Accepts
114+#### Source
117+++ hef %+ sear |=(a=@ ?:(=(a 0) ~ (some a)))
119+ ;~(plug tip tiq (easy ~))
105−#### Produces
122+#### Examples
125+> `@p`(scan "sampel" hef:ab)
128+> `@p`(scan "dozpel" hef:ab)
107−An atom. XX
131+> `@p`(scan "dozzod" hef:ab)
142+Parsing `rule`. Parses an atom of aura `@pE`, without leading `~` or `.~`. A
143+phrase of two bytes encoded phonetically.
109#### Source
145#### Source
112− ++ huf %+ cook
148+++ hif (boss 256 ;~(plug tip tiq (easy ~)))
113− |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
114− ;~(plug hif ;~(pfix hep hif))
117#### Examples
151#### Examples
120− > (scan "pittyp-pittyp" huf:ab)
154+> `@p`(scan "doznec" hif:ab)
122− > (scan "tasfyn-partyv" huf:ab)
156+
123− 65.792
157+> `@p`(scan "pittyp" hif:ab)
124− > `@ux`(scan "tasfyn-partyv" huf:ab)
158+~pittyp
130−### `++hyf:ab`
163+### `++hof:ab`
132−Parse 8 phonetic bytes
165+Parse 2-4 @q phonetic pairs
134−Parsing `++rule`. Parses an atom of aura @pG, a phrase of eight of
167+Parsing `rule`. Parses an atom of aura `@q` (non-scrambled `@p`), without
135−phonetic bytes.
168+leading `~` or `.~`, of between two and four phrases.
137−#### Accepts
170+#### Source
139−An atom of aura `@pG`
172+```hoon
173+++ hof (bass 0x1.0000 ;~(plug hef (stun [1 3] ;~(pfix hep hif))))
141−#### Produces
176+#### Example
179+> `@q`(scan "sampel-palnet" hof:ab)
143−An atom. XX
182+> `@q`(scan "sampel-sampel-palnet" hof:ab)
183+.~sampel-sampel-palnet
185+> `@q`(scan "sampel-sampel-sampel-palnet" hof:ab)
186+.~sampel-sampel-sampel-palnet
193+Parse 1-4 @q phonetic pairs
195+Parsing `rule`. Parses an atom of aura `@q` (non-scrambled `@p`), without
196+leading `~` or `.~`, of between one and four phrases.
145#### Source
198#### Source
148− ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
201+++ huf (bass 0x1.0000 ;~(plug hef (stun [0 3] ;~(pfix hep hif))))
151#### Examples
204#### Examples
154− > (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
207+> `@q`(scan "sampel" huf:ab)
155− q=365.637.097.828.335.095
208+.~sampel
156− > `@u`~sondel-forsut-tillyn-nillyt
209+
157− 365.637.097.828.335.095
210+> `@q`(scan "sampel-palnet" huf:ab)
213+> `@q`(scan "sampel-sampel-palnet" huf:ab)
214+.~sampel-sampel-palnet
216+> `@q`(scan "sampel-sampel-sampel-palnet" huf:ab)
217+.~sampel-sampel-sampel-palnet
162−### `++pev:ab`
222+### `++hyf:ab`
164−Parse \<= 5 base-32
224+Parse four @q phonetic pairs
166−Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
226+Parsing `rule`. Parses an atom of aura `@q` (non-scrambled `@p`), without
227+leading `~` or `.~`, of exactly four phrases.
168−#### Accepts
229+#### Source
170−Up to five @uv (base 64) digits.
231+```hoon
232+++ hyf (bass 0x1.0000 ;~(plug hif (stun [3 3] ;~(pfix hep hif))))
172−#### Produces
235+#### Examples
238+> `@q`(scan "sampel-sampel-sampel-palnet" hyf:ab)
239+.~sampel-sampel-sampel-palnet
246+Parse 1-5 @uv base-32 chars
248+Parsing `rule`. Parses one to five `@uv` base-32 digits without the leading `0v`
176#### Source
251#### Source
179− ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
254+++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
182#### Examples
257#### Examples
260+> `@uv`(scan "du3ja" pev:ab)
263+> `@uv`(scan "3ja" pev:ab)
185− > (scan "a" pev:ab)
266+> `@uv`(scan "a" pev:ab)
187− > (scan "290j" pev:ab)
189− > (scan "123456" pev:ab)
192− > (scan "090j" pev:ab)
193− ~ <syntax error at [1 11]>
198### `++pew:ab`
272### `++pew:ab`
200−Parse \<= 5 base-64
274+Parse 1-5 @uw base-64 chars
202−Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
206−Up to five @uw (base 64) digits.
276+Parsing `rule`. Parses one to five `@uw` base-64 digits without the leading `0w`
207−
277+or leading zeros.
210#### Source
279#### Source
213− ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
282+++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
216#### Examples
285#### Examples
219− > (scan "Q" pew:ab)
288+> `@uw`(scan "6U0gP" pew:ab)
221− > (scan "aQ~9" pew:ab)
290+
225− > (scan "123456" pew:ab)
291+> `@uw`(scan "gP" pew:ab)
228− > (scan "012345" pew:ab)
294+> `@uw`(scan "P" pew:ab)
235### `++piv:ab`
300### `++piv:ab`
237−Parse 5 base-32
302+Parse 5 @uv base-32 chars
239−Parsing `++rule`. Parses exactly five base-32 digits.
304+Parsing `rule`. Parses exactly five `@uv` base-32 digits without the leading
240−
305+`0v` or leading zeros.
245#### Source
307#### Source
248− ++ piv (bass 32 (stun [5 5] siv))
310+++ piv (bass 32 (stun [5 5] siv))
251#### Examples
313#### Examples
254− > (scan "10b3l" piv:ab)
316+> `@uv`(scan "du3ja" piv:ab)
255− q=1.059.957
317+0vdu3ja
256− > (scan "1" piv:ab)
319+> `@uv`(scan "u3ja" piv:ab)
258− ! exit
321+syntax error
263### `++piw:ab`
326### `++piw:ab`
265−Parse 5 base-64
328+Parse 5 @uw base-64 chars
267−Parsing `++rule`. Parses exactly five base-64 digits.
269−#### Accepts
330+Parsing `rule`. Parses exactly five `@uw` base-64 digits without the leading
270−
331+`0w` or leading zeros.
273#### Source
333#### Source
276− ++ piw (bass 64 (stun [5 5] siw))
336+++ piw (bass 64 (stun [5 5] siw))
279#### Examples
339#### Examples
282− > (scan "2C-pZ" piw:ab)
342+> `@uw`(scan "6U0gP" piw:ab)
283− q=43.771.517
343+0w6U0gP
284− > (scan "2" piv:ab)
345+> `@uw`(scan "U0gP" piw:ab)
286− ! exit
347+syntax error
291### `++qeb:ab`
352### `++qeb:ab`
293−Parse \<= 4 binary
354+Parse 1-4 binary digits
295−Parsing `++rule`. Parses a binary number of up to 4 digits in length without
300−#### Produces
356+Parsing `rule`. Parses a binary number of up to 4 digits in length without a
302#### Source
359#### Source
305− ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
362+++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
308#### Examples
365#### Examples
311− > (scan "1" qeb:ab)
368+> `@ub`(scan "1010" qeb:ab)
313− > (scan "101" qeb:ab)
370+
315− > (scan "1111" qeb:ab)
371+> `@ub`(scan "10" qeb:ab)
317− > (scan "11111" qeb:ab)
374+> `@ub`(scan "1" qeb:ab)
320− > (scan "01" qeb:ab)
377+> `@ub`(scan "0" qeb:ab)
322− ! exit
379+syntax error
327### `++qex:ab`
384### `++qex:ab`
329−Parse \<= 4 hex
386+Parse 1-4 hex digits
331−Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
332−without a leading zero.
334−#### Accepts
388+Parsing `rule`. Parses a hexadecimal number of up to 4 digits in length without
338#### Source
391#### Source
341− ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
394+++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
344#### Examples
397#### Examples
347− > (scan "ca" qex:ab)
400+> `@ux`(scan "beef" qex:ab)
349− > (scan "18ac" qex:ab)
402+
351− > (scan "18acc" qex:ab)
403+> `@ux`(scan "ef" qex:ab)
354− > (scan "08ac" qex:ab)
406+> `@ux`(scan "f" qex:ab)
@@ -362,28 +413,26 @@ without a leading zero.
363Parse 4 binary
414Parse 4 binary
365−Parsing `++rule`. Parses exactly four binary digits.
416+Parsing `rule`. Parses exactly four binary digits - may have leading zeros.
371#### Source
418#### Source
374− ++ qib (bass 2 (stun [4 4] sib))
421+++ qib (bass 2 (stun [4 4] sib))
377#### Examples
424#### Examples
380− > (scan "0001" qib:ab)
427+> `@ub`(scan "0001" qib:ab)
382− > (scan "0100" qib:ab)
430+> `@ub`(scan "1001" qib:ab)
384− > (scan "110" qib:ab)
433+> `@ub`(scan "1" qib:ab)
386− ! exit
435+syntax error
@@ -392,28 +441,26 @@ Parsing `++rule`. Parses exactly four binary digits.
393Parse 4 hex
442Parse 4 hex
395−Parsing `++rule`. Parses exactly four hexadecimal digits.
444+Parsing `rule`. Parses exactly four hexadecimal digits - may have leading zeros.
401#### Source
446#### Source
404− ++ qix (bass 16 (stun [4 4] six))
449+++ qix (bass 16 (stun [4 4] six))
407#### Examples
452#### Examples
410− > (scan "0100" qix:ab)
455+> `@ux`(scan "beef" qix:ab)
412− > (scan "10ff" qix:ab)
458+> `@ux`(scan "0000" qix:ab)
414− > (scan "0" qix:ab)
461+> `@ux`(scan "ef" qix:ab)
416− ! exit
463+syntax error
@@ -422,29 +469,23 @@ Parsing `++rule`. Parses exactly four hexadecimal digits.
425−Parsing `++rule`. Parses the number 1.
472+Parsing `rule`. Parses the number 1.
431#### Source
474#### Source
434− ++ seb (cold 1 (just '1'))
477+++ seb (cold 1 (just '1'))
437#### Examples
480#### Examples
440− > (scan "1" seb:ab)
483+> (scan "1" seb:ab)
442− > (scan "0" seb:ab)
485+
443− ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
445− > (scan "2" seb:ab)
486+> (scan "2" seb:ab)
446− ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
487+{1 1}
447− ! {1 1}
488+syntax error
@@ -453,26 +494,23 @@ Parsing `++rule`. Parses the number 1.
454Parse decimal
495Parse decimal
456−Parsing `++rule`. Parses a nonzero decimal digit.
497+Parsing `rule`. Parses a nonzero decimal digit.
462#### Source
499#### Source
465− ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
502+++ sed (cook |=(a=@ (sub a '0')) (shim '1' '9'))
468#### Examples
505#### Examples
471− > (scan "5" sed:ab)
508+> (scan "5" sed:ab)
473− > (scan "0" sed:ab)
511+> (scan "0" sed:ab)
475− ! exit
513+syntax error
@@ -481,26 +519,26 @@ Parsing `++rule`. Parses a nonzero decimal digit.
482Parse base-32
520Parse base-32
484−Parsing `++rule`. Parses a nonzero base-32 digit
522+Parsing `rule`. Parses a nonzero base-32 digit.
490#### Source
524#### Source
493− ++ sev ;~(pose sed sov)
527+++ sev ;~(pose sed sov)
496#### Examples
530#### Examples
499− > (scan "c" sev:ab)
533+> `@uv`(scan "2" sev:ab)
536+> `@uv`(scan "j" sev:ab)
501− ~zod/socialnet=> (scan "0" sev:ab)
539+> `@uv`(scan "0" sev:ab)
503− ! exit
541+syntax error
@@ -509,26 +547,26 @@ Parsing `++rule`. Parses a nonzero base-32 digit
510Parse base-64
548Parse base-64
512−Parsing `++rule`. Parses a nonzero base-64 digit
550+Parsing `rule`. Parses a nonzero base-64 digit.
518#### Source
552#### Source
521− ++ sew ;~(pose sed sow)
555+++ sew ;~(pose sed sow)
524#### Examples
558#### Examples
527− > (scan "M" sew:ab)
561+> `@uw`(scan "I" sew:ab)
564+> `@uw`(scan "2" sew:ab)
529− > (scan "0" sew:ab)
567+> `@uw`(scan "0" sew:ab)
531− ! exit
569+syntax error
@@ -537,26 +575,26 @@ Parsing `++rule`. Parses a nonzero base-64 digit
540−Parsing `++rule`. Parses a nonzero hexadecimal digit.
578+Parsing `rule`. Parses a non-zero hexadecimal digit.
546#### Source
580#### Source
549− ++ sex ;~(pose sed sox)
583+++ sex ;~(pose sed sox)
552#### Examples
586#### Examples
555− > (scan "e" sex:ab)
589+> `@ux`(scan "a" sex:ab)
592+> `@ux`(scan "2" sex:ab)
557− > (scan "0" sex:ab)
595+> `@ux`(scan "0" sex:ab)
559− ! exit
597+syntax error
@@ -565,25 +603,22 @@ Parsing `++rule`. Parses a nonzero hexadecimal digit.
566Parse binary
604Parse binary
568−Parsing `++rule`. Parses a binary digit.
606+Parsing `rule`. Parses a binary digit.
574#### Source
608#### Source
577− ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
611+++ sib (cook |=(a=@ (sub a '0')) (shim '0' '1'))
580#### Examples
614#### Examples
583− > (scan "1" sib:ab)
617+> `@ub`(scan "1" sib:ab)
585− ~zod/socialnet=> (scan "0" sib:ab)
620+> `@ub`(scan "0" sib:ab)
@@ -592,23 +627,22 @@ Parsing `++rule`. Parses a binary digit.
593Parse decimal
628Parse decimal
595−Parsing `++rule`. Parses a decimal digit.
630+Parsing `rule`. Parses a decimal digit.
601#### Source
632#### Source
604− ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
635+++ sid (cook |=(a=@ (sub a '0')) (shim '0' '9'))
607#### Examples
638#### Examples
610− > (scan "5" sid:ab)
641+> (scan "5" sid:ab)
@@ -617,23 +651,25 @@ Parsing `++rule`. Parses a decimal digit.
618Parse base-32
652Parse base-32
620−Parsing `++rule`. Parses a base-32 digit.
654+Parsing `rule`. Parses a base-32 digit.
626#### Source
656#### Source
629− ++ siv ;~(pose sid sov)
659+++ siv ;~(pose sid sov)
632#### Examples
662#### Examples
665+> `@uv`(scan "r" siv:ab)
668+> `@uv`(scan "5" siv:ab)
635− > (scan "c" siv:ab)
671+> `@uv`(scan "0" siv:ab)
@@ -642,23 +678,25 @@ Parsing `++rule`. Parses a base-32 digit.
643Parse base-64
679Parse base-64
645−Parsing `++rule`. Parses a base-64 digit.
681+Parsing `rule`. Parses a base-64 digit.
651#### Source
683#### Source
654− ++ siw ;~(pose sid sow)
686+++ siw ;~(pose sid sow)
657#### Examples
689#### Examples
660− > (scan "M" siw:ab)
692+> `@uw`(scan "M" siw:ab)
695+> `@uw`(scan "0" siw:ab)
698+> `@uw`(scan "c" siw:ab)
@@ -667,78 +705,80 @@ Parsing `++rule`. Parses a base-64 digit.
670−Parsing `++rule`. Parses a hexadecimal digit.
708+Parsing `rule`. Parses a hexadecimal digit.
676#### Source
710#### Source
679− ++ six ;~(pose sid sox)
713+++ six ;~(pose sid sox)
682#### Examples
716#### Examples
685− > (scan "e" six:ab)
719+> `@ux`(scan "e" six:ab)
722+> `@ux`(scan "0" six:ab)
691### `++sov:ab`
728### `++sov:ab`
693−Parse base-32
730+Parse @uv base-32 letter
695−Parsing `++rule`. Parses a base-32 letter.
732+Parsing `rule`. Parses a `@uv` base-32 letter (but not a number).
701#### Source
734#### Source
704− ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
737+++ sov (cook |=(a=@ (sub a 87)) (shim 'a' 'v'))
707#### Examples
740#### Examples
710− > (scan "c" sov:ab)
743+> `@uv`(scan "c" sov:ab)
746+> `@uv`(scan "j" sov:ab)
749+> `@uv`(scan "5" sov:ab)
716### `++sow:ab`
756### `++sow:ab`
720−Parsing `++rule`. Parses a base-64 letter/symbol.
758+Parse @uw base-64 letter/symbol
724−#### Produces
760+Parsing `rule`. Parses a base-64 letter/symbol (but not number).
726#### Source
762#### Source
729− ++ sow ;~ pose
765+++ sow ;~ pose
730− (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
766+ (cook |=(a=@ (sub a 87)) (shim 'a' 'z'))
731− (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
767+ (cook |=(a=@ (sub a 29)) (shim 'A' 'Z'))
732− (cold 62 (just '-'))
768+ (cold 62 (just '-'))
733− (cold 63 (just '~'))
769+ (cold 63 (just '~'))
737#### Examples
773#### Examples
740− > (scan "M" sow:ab)
776+> `@uw`(scan "M" sow:ab)
779+> `@uw`(scan "5" sow:ab)
@@ -747,56 +787,77 @@ Parsing `++rule`. Parses a base-64 letter/symbol.
748Parse hex letter
788Parse hex letter
750−Parsing `++rule`. Parses a hexadecimal letter.
790+Parsing `rule`. Parses a hexadecimal letter (but not number).
756#### Source
792#### Source
759− ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
795+++ sox (cook |=(a=@ (sub a 87)) (shim 'a' 'f'))
762#### Examples
798#### Examples
765− > (scan "e" sox:ab)
801+> `@ux`(scan "e" sox:ab)
804+> `@ux`(scan "5" sox:ab)
771### `++ted:ab`
811### `++ted:ab`
773−Parse \<= 3 decimal
813+Parse 1-999 decimal
775−Parsing `++rule`. Parses a decimal number of up to 3 digits without a
815+Parsing `rule`. Parses a decimal number of up to 3 digits without a
776leading zero.
816leading zero.
778−#### Accepts
818+#### Source
780−#### Produces
820+```hoon
821+++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
827+> (scan "214" ted:ab)
833+> (scan "2161" ted:ab)
842+Parse non-doz leading phonetic byte
844+Parsing `rule`. Parses the leading phonetic byte , which represents a syllable.
845+Fails if it is `doz`.
782#### Source
847#### Source
785− ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
850+++ tep (sear |=(a=@ ?:(=(a 'doz') ~ (ins:po a))) til)
788#### Examples
853#### Examples
791− > (scan "21" ted:ab)
856+> (scan "sam" tep:ab)
793− > (scan "214" ted:ab)
795− > (scan "2140" ted:ab)
797− > (scan "0" ted:ab)
859+> (scan "wic" tep:ab)
@@ -805,27 +866,22 @@ leading zero.
806Leading phonetic byte
867Leading phonetic byte
808−Parsing `++rule`. Parses the leading phonetic byte, which represents a
869+Parsing `rule`. Parses the leading phonetic byte, which represents a syllable.
815#### Source
871#### Source
818− ++ tip (sear |=(a/@ (ins:po a)) til)
874+++ tip (sear |=(a=@ (ins:po a)) til)
821#### Examples
877#### Examples
824− > (scan "doz" tip:ab)
880+> (scan "doz" tip:ab)
827− > (scan "pit" tip:ab)
883+> (scan "pit" tip:ab)
@@ -834,27 +890,21 @@ syllable.
835Trailing phonetic syllable
891Trailing phonetic syllable
837−Parsing `++rule`. Parses the trailing phonetic byte, which represents a
893+Parsing `rule`. Parses the trailing phonetic byte, which represents a syllable.
844#### Source
895#### Source
847− ++ tiq (sear |=(a/@ (ind:po a)) til)
898+++ tiq (sear |=(a=@ (ind:po a)) til)
851#### Examples
901#### Examples
854− > (scan "zod" tiq:ab)
904+> (scan "zod" tiq:ab)
856− > (scan "nec" tiq:ab)
906+> (scan "nec" tiq:ab)
@@ -863,26 +913,26 @@ syllable.
864Parse 3 decimal digits
914Parse 3 decimal digits
866−Parsing `++rule`. Parses exactly three decimal digits.
916+Parsing `rule`. Parses exactly three decimal digits.
872#### Source
918#### Source
875− ++ tid (bass 10 (stun [3 3] sid))
921+++ tid (bass 10 (stun [3 3] sid))
878#### Examples
924#### Examples
881− > (scan "013" tid:ab)
927+> (scan "013" tid:ab)
883− > (scan "01" tid:ab)
930+> (scan "999" tid:ab)
885− ! exit
935+syntax error
@@ -891,85 +941,70 @@ Parsing `++rule`. Parses exactly three decimal digits.
892Parse 3 lowercase
942Parse 3 lowercase
894−Parsing `++rule`. Parses exactly three lowercase letters.
944+Parsing `rule`. Parses exactly three lowercase letters.
900#### Source
946#### Source
903− ++ til (boss 256 (stun [3 3] low))
949+++ til (boss 256 (stun [3 3] low))
906#### Examples
952#### Examples
909− > (scan "mer" til:ab)
911− > `@t`(scan "mer" til:ab)
955+> `@t`(scan "mer" til:ab)
913− > (scan "me" til:ab)
958+> `@t`(scan "me" til:ab)
915− ! exit
960+syntax error
920### `++urs:ab`
965### `++urs:ab`
922−Parse span characters
967+Parse knot characters
924−Parsing rule. Parses characters from an atom of the span aura `@ta`.
969+Parsing rule. Parses characters from an atom of the knot aura `@ta`.
930#### Source
971#### Source
933− ++ urs %+ cook
974+++ urs %+ cook
934− |=(a/tape (rap 3 ^-((list @) a)))
975+ |=(a=tape (rap 3 ^-((list @) a)))
935− (star ;~(pose nud low hep dot sig cab))
976+ (star ;~(pose nud low hep dot sig cab))
938#### Examples
979#### Examples
941− > `@ta`(scan "asa-lom_tak" urs:ab)
982+> `@ta`(scan "asa-lom_tak" urs:ab)
942− ~.asa-lom_tak
983+~.asa-lom_tak
943− > `@t`(scan "asa-lom_tak" urs:ab)
949### `++urt:ab`
988### `++urt:ab`
951−Parse non-`_` span
990+Parse knot without underscores
953−Parsing rule. Parses all characters of the span aura `@ta` except
958−#### Produces
992+Parsing `rule`. Parses all characters of the knot aura `@ta` except for cab,
960#### Source
995#### Source
963− ++ urt %+ cook
998+++ urt %+ cook
964− |=(a/tape (rap 3 ^-((list @) a)))
999+ |=(a=tape (rap 3 ^-((list @) a)))
965− (star ;~(pose nud low hep dot sig))
1000+ (star ;~(pose nud low hep dot sig))
968#### Examples
1003#### Examples
971− > `@t`(scan "asa-lom.t0k" urt:ab)
1006+> `@ta`(scan "asa-lom.t0k" urt:ab)
972− 'asa-lom.t0k'
1007+~.asa-lom.t0k
@@ -978,26 +1013,25 @@ for cab, `_`.
979Parse bas, soq, or bix
1014Parse bas, soq, or bix
981−Parsing rule. Parses an escaped backslash, single quote, or hex pair
1016+Parsing `rule`. Parses an escaped backslash, single quote, or hex pair byte.
988#### Source
1018#### Source
991− ++ voy ;~(pfix bas ;~(pose bas soq bix))
1021+++ voy ;~(pfix bas ;~(pose bas soq bix))
994#### Examples
1024#### Examples
997− > (scan "\\0a" voy:ab)
1027+> (scan "\\\\" voy:ab)
999− > (scan "\\'" voy:ab)
1030+> (scan "\\'" voy:ab)
1033+> (scan "\\0a" voy:ab)
@@ -1008,22 +1042,11 @@ Top-level atom parser engine
1009A core containing top-level atom parsers.
1043A core containing top-level atom parsers.
1015#### Source
1045#### Source
1026− <14.vpu 414.mof 100.xkc 1.ypj %164>
@@ -1036,21 +1059,30 @@ Parser modifier. Parses 0 or the sample rule `fel`.
1037#### Accepts
1060#### Accepts
1039#### Produces
1064#### Produces
1041−`fel` is a `rule`.
1066+A `rule`.
1043#### Source
1068#### Source
1046− ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1071+++ ape |*(fel=rule ;~(pose (cold 0 (just '0')) fel))
1049#### Examples
1074#### Examples
1077+> (scan "0" (ape:ag (cold 2 (just '2'))))
1052− > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1080+> (scan "2" (ape:ag (cold 2 (just '2'))))
1083+> (scan "3" (ape:ag (cold 2 (just '2'))))
@@ -1059,23 +1091,19 @@ Parser modifier. Parses 0 or the sample rule `fel`.
1060Parses binary number
1092Parses binary number
1062−Parsing rule. Parses a binary number without a leading zero.
1094+Parsing `rule`. Parses a binary number without a leading zero.
1068#### Source
1096#### Source
1071− ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1099+++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1074#### Examples
1102#### Examples
1077− > (scan "10.0110" bay:ag)
1105+> `@ub`(scan "101.1100.0011.1010" bay:ag)
1078− q=38
1106+0b101.1100.0011.1010
@@ -1086,24 +1114,18 @@ Parse IPv6
1087Parsing rule. Parses a `@is`, an IPv6 address.
1115Parsing rule. Parses a `@is`, an IPv6 address.
1093#### Source
1117#### Source
1096− ++ bip =+ tod=(ape qex:ab)
1120+++ bip =+ tod=(ape qex:ab)
1097− (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1121+ (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1100#### Examples
1124#### Examples
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)
1127+> `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1106− .0.0.ea.3e6c.0.0.0.0
1128+.0.0.ea.3e6c.0.0.0.0
@@ -1112,25 +1134,21 @@ Parsing rule. Parses a `@is`, an IPv6 address.
1113Parse decimal with dots
1135Parse decimal with dots
1115−Parsing rule. Parses a decimal number that includes dot separators.
1137+Parsing `rule`. Parses a decimal number that includes dot separators.
1121#### Source
1139#### Source
1124− ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1142+++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1127#### Examples
1145#### Examples
1130− > (scan "52" dem:ag)
1148+> (scan "52" dem:ag)
1132− > (scan "13.507" dem:ag)
1150+> (scan "13.507" dem:ag)
1133− q=13.507
1151+13.507
@@ -1141,24 +1159,27 @@ Parse decimal number
1142Parsing rule. Parses a decimal number without a leading zero.
1160Parsing rule. Parses a decimal number without a leading zero.
1148#### Source
1162#### Source
1151− ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1165+++ dim (ape dip)
1154#### Examples
1168#### Examples
1157− > (scan "52" dim:ag)
1171+> (scan "52" dim:ag)
1177+> (scan "13507" dim:ag)
1159− > (scan "013507" dim:ag)
1180+> (scan "013507" dim:ag)
1161− ! exit
1182+syntax error
@@ -1169,25 +1190,21 @@ Parse decimal with leading `0`
1170Parsing rule. Parses a decmial number with leading zeroes.
1191Parsing rule. Parses a decmial number with leading zeroes.
1176#### Source
1193#### Source
1179− ++ dum (bass 10 (plus sid:ab))
1196+++ dum (bass 10 (plus sid:ab))
1182#### Examples
1199#### Examples
1185− > (scan "52" dum:ag)
1202+> (scan "52" dum:ag)
1187− > (scan "0000052" dum:ag)
1204+> (scan "0000052" dum:ag)
1189− > (scan "13507" dim:ag)
1206+> (scan "13507" dim:ag)
1190− q=13.507
1207+13.507
@@ -1198,69 +1215,141 @@ Parse phonetic base
1199Parsing rule. Parses an atom of aura `@p`, the phonetic base.
1216Parsing rule. Parses an atom of aura `@p`, the phonetic base.
1201−#### Accepts
1218+#### Source
1203−#### Produces
1220+```hoon
1221+++ fed %+ cook fynd:ob
1223+ %+ bass 0x1.0000.0000.0000.0000 :: oversized
1226+ (plus ;~(pfix doh hyf:ab))
1228+ hof:ab :: planet or moon
1237+> `@p`(scan "zod" fed:ag)
1240+> `@p`(scan "sampel" fed:ag)
1243+> `@p`(scan "sampel-palnet" fed:ag)
1246+> `@p`(scan "sampel-palnet-sampel-palnet" fed:ag)
1247+~sampel-palnet-sampel-palnet
1249+> `@p`(scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1250+~tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr
1257+Parse `@q` phonetic base
1259+Parsing rule. Parses an atom of aura `@q` (an unscrambled `@p`).
1205#### Source
1261#### Source
1208− ++ fed ;~ pose
1264+++ feq %+ cook |=(a=(list @) (rep 4 (flop a)))
1209− (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1265+ ;~ plug
1211− hif:ab
1266+ ;~(pose hif:ab tiq:ab)
1212− tiq:ab
1267+ (star ;~(pfix dof hif:ab))
1216#### Examples
1271#### Examples
1219− > (scan "zod" fed:ag)
1274+> `@q`(scan "sampel" feq:ag)
1221− > (scan "nec" fed:ag)
1276+
1222− 1
1277+> `@q`(scan "sampel-palnet" feq:ag)
1223− > (scan "sondel" fed:ag)
1278+.~sampel-palnet
1225− > ~tillyn-nillyt
1280+> `@q`(scan "sampel-sampel-palnet" feq:ag)
1226− ~tillyn-nillyt
1281+.~sampel-sampel-palnet
1227− > (scan "tillyn-nillyt" fed:ag)
1282+
1228− 3.569.565.175
1283+> `@q`(scan "sampel-palnet-sampel-palnet" feq:ag)
1229− > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1284+.~sampel-palnet-sampel-palnet
1230− 15.331.165.687.565.582.592
1285+
1231− > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1286+> `@q`(scan "sampel-sampel-sampel-sampel-palnet-sampel-palnet" feq:ag)
1232− 282.810.089.790.159.633.869.501.053.313.363.681.181
1287+.~sampel-sampel-sampel-sampel-palnet-sampel-palnet
1237−### `++hex:ag`
1292+### `++fim:ag`
1239−Parse hex
1294+Parse base58check
1241−Parsing rule. Parses a hexadecimal number
1296+Parse a base58check value, check checksum, and return decoded value sans-checksum. If
1297+the checksum check fails, parsing will fail.
1243−#### Accepts
1299+#### Source
1245−#### Produces
1301+```hoon
1302+++ fim (sear den:fa (bass 58 (plus fem:ab)))
1307+With valid checksum:
1310+> (enc:fa 0xdead.beef)
1311+0xdead.beef.938b.8b0c
1312+> (c-co:co 0xdead.beef.938b.8b0c)
1314+> `@ux`(scan "eFGDJSVvRHd" fim:ag)
1318+With invalid checksum:
1321+> (c-co:co 0xdead.beef.ffff)
1323+> `@ux`(scan "2utUWE41U" fim:ag)
1334+Parsing `rule`. Parses a hexadecimal number
1247#### Source
1336#### Source
1250− ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1339+++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1253#### Examples
1342#### Examples
1256− > (scan "4" hex:ag)
1345+> `@ux`(scan "4" hex:ag)
1258− > (scan "1a" hex:ag)
1348+> `@ux`(scan "1a" hex:ag)
1260− > (scan "3.ac8d" hex:ag)
1350+
1262− > `@ux`(scan "3.ac8d" hex:ag)
1351+> `@ux`(scan "3.ac8d" hex:ag)
1263− 0x3.ac8d
1352+0x3.ac8d
@@ -1269,28 +1358,61 @@ Parsing rule. Parses a hexadecimal number
1270Parse IPv4 address
1359Parse IPv4 address
1272−Parsing rule. Parses an IPv4 address.
1361+Parsing `rule`. Parses an IPv4 address.
1274−#### Accepts
1363+#### Source
1276−#### Produces
1365+```hoon
1366+++ lip =+ tod=(ape ted:ab)
1367+ (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1373+> `@if`(scan "127.0.0.1" lip:ag)
1381+Parse numerical month
1383+Parse a numerical month (1-12).
1278#### Source
1385#### Source
1281− ++ lip =+ tod=(ape ted:ab)
1388+++ mot ;~ pose
1282− (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1389+ ;~ pfix
1391+ (cook |=(a=@ (add 10 (sub a '0'))) (shim '0' '2'))
1285#### Examples
1397#### Examples
1288− > (scan "127.0.0.1" lip:ag)
1400+> (scan "0" mot:ag)
1289− q=2.130.706.433
1401+{1 1}
1290− > `@if`(scan "127.0.0.1" lip:ag)
1402+syntax error
1292− > `@if`(scan "8.8.8.8" lip:ag)
1404+> (scan "1" mot:ag)
1410+> (scan "12" mot:ag)
1413+> (scan "13" mot:ag)
@@ -1299,23 +1421,19 @@ Parsing rule. Parses an IPv4 address.
1300Parse Base-32 with dots
1422Parse Base-32 with dots
1302−Parsing rule. Parses a Base-32 number with dot separators.
1424+Parsing `rule`. Parses a Base-32 number with dot separators.
1308#### Source
1426#### Source
1311− ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1429+++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1314#### Examples
1432#### Examples
1317− > (scan "e2.ol4pm" viz:ag)
1435+> `@uv`(scan "e2.ol4pm" viz:ag)
1318− q=15.125.353.270
1436+0ve2.ol4pm
@@ -1324,23 +1442,19 @@ Parsing rule. Parses a Base-32 number with dot separators.
1325Parse base-32 string
1443Parse base-32 string
1327−Parsing rule. Parses a raw base-32 string.
1445+Parsing `rule`. Parses a raw base-32 string (without dots).
1333#### Source
1447#### Source
1336− ++ vum (bass 32 (plus siv:ab))
1450+++ vum (bass 32 (plus siv:ab))
1339#### Examples
1453#### Examples
1342− > (scan "e2ol4pm" vum:ag)
1456+> `@uv`(scan "e2ol4pm" vum:ag)
1343− q=15.125.353.270
1457+0ve2.ol4pm
@@ -1349,25 +1463,19 @@ Parsing rule. Parses a raw base-32 string.
1350Parse base-64
1464Parse base-64
1352−Parsing rule. Parses a base-64 number.
1466+Parsing `rule`. Parses a base-64 number.
1358#### Source
1468#### Source
1361− ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1471+++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1366#### Examples
1474#### Examples
1369− > (scan "e2O.l4Xpm" wiz:ag)
1477+> `@uw`(scan "e2O.l4Xpm" wiz:ag)
1370− q=61.764.130.813.526
1478+0we2O.l4Xpm
@@ -1382,24 +1490,15 @@ relationship between a planet and its star.
1383#### Accepts
1491#### Accepts
1385−#### Produces
1493+`top` is an atom.
1387`bot` is an atom.
1495`bot` is an atom.
1391#### Source
1497#### Source
1395− |_ [top/@ bot/@]
1501+ |_ [top=@ bot=@]
1401− > ~(. mu 0x20e5 0x5901)
1402− <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
@@ -1414,23 +1513,23 @@ planet.
1415#### Accepts
1514#### Accepts
1417−#### Produces
1516+`top` & `bot` are atoms, and are the sample of `+mu`.
1419−`bot` is an atom.
1518+#### Produces
1421−`top` is an atom.
1520+A `(pair @ @)`.
1423#### Source
1522#### Source
1426− ++ zag [p=(end 4 1 (add top bot)) q=bot]
1525+++ zag [p=(end 4 (add top bot)) q=bot]
1429#### Examples
1528#### Examples
1432− > `[@ux @ux]`~(zag mu 0x20e0 0x201)
1531+> `[@ux @ux]`~(zag mu 0x20e0 0x201)
1433− [0x22e1 0x201]
1532+[0x22e1 0x201]
@@ -1439,30 +1538,29 @@ planet.
1440Subtract bottom from top
1539Subtract bottom from top
1442−The inverse of `++zag`. Produces the cell of `top` and `bot` with
1541+The inverse of [`++zag`](#zagmu). Produces the cell of `top` and `bot` with
1443−`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1542+`top` unscrambled. The unscrambled `top` is the sum of the sample `top` and the
1444−and the 16-bit complement of `bot`. Used to unscramble the name of the
1543+16-bit complement of `bot`. Used to unscramble the name of the planet.
1447#### Accepts
1545#### Accepts
1449−#### Produces
1547+`top` & `bot` are atoms, and are the sample of `+mu`.
1451−`bot` is an atom.
1549+#### Produces
1453−`top` is an atom.
1551+A `(pair @ @)`.
1455#### Source
1553#### Source
1458− ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1556+++ zig [p=(end 4 (add top (sub 0x1.0000 bot))) q=bot]
1461#### Examples
1559#### Examples
1464− > `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1562+> `[@ux @ux]`~(zig mu 0x22e1 0x201)
1465− [0x1f04 0x1042]
1563+[0x20e0 0x201]
@@ -1476,23 +1574,23 @@ planet name.
1477#### Accepts
1575#### Accepts
1479−#### Produces
1577+`top` & `bot` are atoms, and are the sample of `+mu`.
1481−`bot` is an atom.
1579+#### Produces
1483−`top` is an atom.
1581+An atom.
1485#### Source
1583#### Source
1488− ++ zug (mix (lsh 4 1 top) bot)
1586+++ zug (mix (lsh 4 top) bot)
1491#### Examples
1589#### Examples
1494− > `@ux`~(zug mu 0x10e1 0xfa)
1592+> `@ux`~(zug mu 0x22e1 0x201)
1495− 0x10e1.00fa
1593+0x22e1.0201
@@ -1505,22 +1603,51 @@ A door containing arms that render digits at bases 10, 16, 32, and 64.
1506#### Accepts
1604#### Accepts
1621+Render a single base58check character.
1625+`tig` is an `atom`, and is the sample of `+ne`.
1508#### Produces
1627#### Produces
1510−`tig` is an `atom`.
1629+An atom.
1512#### Source
1631#### Source
1515− ++ ne
1634+++ c (cut 3 [tig 1] key:fa)
1519#### Examples
1637#### Examples
1522− > ~(. ne 20)
1640+> `@t`~(c ne 7)
1523− <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1641+'8'
@@ -1533,22 +1660,23 @@ Renders a decimal digit as an atom of an ACII byte value.
1534#### Accepts
1661#### Accepts
1663+`tig` is an `atom`, and is the sample of `+ne`.
1536#### Produces
1665#### Produces
1538−`tig` is an `atom`.
1667+An atom.
1540#### Source
1669#### Source
1543− ++ d (add tig '0')
1672+++ d (add tig '0')
1546#### Examples
1675#### Examples
1549− > `@t`~(d ne 7)
1678+> `@t`~(d ne 7)
@@ -1561,24 +1689,26 @@ Renders a hexadecimal digit as an atom of an ASCII byte value.
1562#### Accepts
1690#### Accepts
1692+`tig` is an `atom`, and is the sample of `+ne`.
1564#### Produces
1694#### Produces
1566−`tig` is an `atom`.
1696+An atom.
1568#### Source
1698#### Source
1571− ++ x ?:((gte tig 10) (add tig 87) d)
1701+++ x ?:((gte tig 10) (add tig 87) d)
1574#### Examples
1704#### Examples
1577− > `@t`~(x ne 7)
1707+> `@t`~(x ne 7)
1580− > `@t`~(x ne 14)
1710+> `@t`~(x ne 14)
@@ -1591,23 +1721,29 @@ Renders a base-32 digit as an atom of an ASCII byte value.
1592#### Accepts
1722#### Accepts
1724+`tig` is an `atom`, and is the sample of `+ne`.
1594#### Produces
1726#### Produces
1596#### Source
1730#### Source
1599− ++ v ?:((gte tig 10) (add tig 87) d)
1733+++ v ?:((gte tig 10) (add tig 87) d)
1602#### Examples
1736#### Examples
1605− > `@t`~(v ne 7)
1739+> `@t`~(v ne 7)
1607− > `@t`~(v ne 14)
1742+> `@t`~(v ne 14)
1609− > `@t`~(v ne 25)
1745+> `@t`~(v ne 25)
@@ -1620,35 +1756,41 @@ Renders a base-64 digit as an atom of an ASCII byte value.
1621#### Accepts
1757#### Accepts
1759+`tig` is an `atom`, and is the sample of `+ne`.
1623#### Produces
1761#### Produces
1625−`tig` is an `atom`.
1763+An atom.
1627#### Source
1765#### Source
1630− ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
1768+++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
1635#### Examples
1771#### Examples
1638− > `@t`~(w ne 7)
1774+> `@t`~(w ne 7)
1640− > `@t`~(w ne 14)
1777+> `@t`~(w ne 14)
1642− > `@t`~(w ne 25)
1780+> `@t`~(w ne 25)
1644− > `@t`~(w ne 52)
1783+> `@t`~(w ne 52)
1646− > `@t`~(w ne 61)
1786+> `@t`~(w ne 61)
1648− > `@t`~(w ne 63)
1789+> `@t`~(w ne 63)
1650− > `@t`~(w ne 62)
1792+> `@t`~(w ne 62)