JSON.scan_hex: def of qasim-bend-kit@0.1.0.2 Import: import qasim-bend-kit@0.1.0.2/libs/JSON.bend as JSON Lines 350-403 of qasim-bend-kit@0.1.0.2/libs/JSON.bend: https://jend.leeeet.dev/read.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&start_line=350&end_line=403 import Base def scan_hex(n: Nat, s: String, acc: U32) -> Result<&1, &1, Error, HexScan>: match n: case 0n: Done{HexScan{acc, s}} case 1n+p: match s: case SNil{}: Fail{Error{}} case SCon{'0', t}: scan_hex(p, t, (acc * 16 + 0 : U32)) case SCon{'1', t}: scan_hex(p, t, (acc * 16 + 1 : U32)) case SCon{'2', t}: scan_hex(p, t, (acc * 16 + 2 : U32)) case SCon{'3', t}: scan_hex(p, t, (acc * 16 + 3 : U32)) case SCon{'4', t}: scan_hex(p, t, (acc * 16 + 4 : U32)) case SCon{'5', t}: scan_hex(p, t, (acc * 16 + 5 : U32)) case SCon{'6', t}: scan_hex(p, t, (acc * 16 + 6 : U32)) case SCon{'7', t}: scan_hex(p, t, (acc * 16 + 7 : U32)) case SCon{'8', t}: scan_hex(p, t, (acc * 16 + 8 : U32)) case SCon{'9', t}: scan_hex(p, t, (acc * 16 + 9 : U32)) case SCon{'a', t}: scan_hex(p, t, (acc * 16 + 10 : U32)) case SCon{'b', t}: scan_hex(p, t, (acc * 16 + 11 : U32)) case SCon{'c', t}: scan_hex(p, t, (acc * 16 + 12 : U32)) case SCon{'d', t}: scan_hex(p, t, (acc * 16 + 13 : U32)) case SCon{'e', t}: scan_hex(p, t, (acc * 16 + 14 : U32)) case SCon{'f', t}: scan_hex(p, t, (acc * 16 + 15 : U32)) case SCon{'A', t}: scan_hex(p, t, (acc * 16 + 10 : U32)) case SCon{'B', t}: scan_hex(p, t, (acc * 16 + 11 : U32)) case SCon{'C', t}: scan_hex(p, t, (acc * 16 + 12 : U32)) case SCon{'D', t}: scan_hex(p, t, (acc * 16 + 13 : U32)) case SCon{'E', t}: scan_hex(p, t, (acc * 16 + 14 : U32)) case SCon{'F', t}: scan_hex(p, t, (acc * 16 + 15 : U32)) case _: Fail{Error{}} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=Error https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=HexScan