fact: Fixpoint tokenize_helper (cls : chartype) (acc xs : list ascii) : list (list ascii) := let tk := match acc with [] => [] | _::_ => [rev acc] end in match xs with | [] => tk | (x::xs') => match cls, classifyChar x, x with | _, _, "(" => tk ++ ["("]::(tokenize_helper other [] xs') | _, _, ")" => tk ++ [")"]::(tokenize_helper other [] xs') | _, white, _ => tk ++ (tokenize_helper white [] xs') | alpha,alpha,x => tokenize_helper alpha (x::acc) xs' | digit,digit,x => tokenize_helper digit (x::acc) xs' | other,other,x => tokenize_helper other (x::acc) xs' | _,tp,x => tk ++ (tokenize_helper tp [x] xs') end end %char.
imports: Coq.Strings.String Coq.Strings.Ascii Coq.Arith.Arith Coq.Arith.EqNat Coq.Lists.List Maps Imp