def digits_ok

bolt@1.27.0.0 · src/rules/tokens.bend:67

import bolt@1.27.0.0/src/rules/tokens.bend as Tokens
import Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

67# digits alone, one or more: a U32 literal's chars
68def digits_ok(cs: List<&2, Char>) -> Bool:
69  match cs:
70    case Con{+c, Nil{}}:
71      Char.is_digit(c)
72    case Con{+c, t}:
73      Lazy.and_then(Char.is_digit(c), _u => digits_ok(t))
74    case Nil{}:
75      False{}

Uses (5)

Used by (1)