fact: Definition parseNumber (xs : list token) : optionE (nat * list token) := match xs with | [] => NoneE "Expected number" | x::xs' => if forallb isDigit (list_of_string x) then SomeE (fold_left (fun n d => 10 * n + (nat_of_ascii d - nat_of_ascii "0"%char)) (list_of_string x) 0, xs') else NoneE "Expected number" end.
imports: Coq.Strings.String Coq.Strings.Ascii Coq.Arith.Arith Coq.Arith.EqNat Coq.Lists.List Maps Imp