Example #1
0
 public static Parser <TAccumulate> ManyWhile <TValue, TAccumulate>(
     this Parser <TValue> parser,
     Func <TValue, bool> predicate,
     TAccumulate seed,
     Func <TAccumulate, TValue, TAccumulate> accumulator)
 {
     return(Many(parser.Where(predicate), seed, accumulator));
 }
Example #2
0
 public static Parser <TValue> OneOf <TValue>(this Parser <TValue> parser, params TValue[] values)
 {
     return(parser.Where(values.Contains));
 }
Example #3
0
 public static Parser <TValue> OneOf <TValue>(this Parser <TValue> parser, IEnumerable <TValue> values)
 {
     return(parser.Where(values.Contains));
 }