def Parse.ascii_digit.val

bend-scanner@0.1.0.0 · parse.bend:91

import bend-scanner@0.1.0.0/parse.bend as Parse
import Base

91def Parse.ascii_digit.val(
92  +h: Char, t: String, off: Nat, dig: Bool
93) -> Result<&2, &2, Parse.Error, Parse.Dec>:
94  match dig:
95    case False{}:
96      Fail{Unexpected{off, h}}
97    case True{}:
98      Done{Dec{(Char.to_u32(h) - Char.to_u32('0') : U32), Cur{t, 1n+off}}}

Uses (11)

Used by (1)