Example #1
0
 public static ParserResult <I, O> ConsumedError <I, O>(ParserError error) =>
 new ParserResult <I, O>(ResultTag.Consumed, ReplyIO.Error <I, O>(error));
Example #2
0
 public static ParserResult <I, O> ConsumedOK <I, O>(O value, PString <I> input, ParserError error) =>
 new ParserResult <I, O>(ResultTag.Consumed, ReplyIO.OK(value, input, error));
Example #3
0
 public static ParserResult <I, O> EmptyError <I, O>(ParserError error) =>
 new ParserResult <I, O>(ResultTag.Empty, ReplyIO.Error <I, O>(error));
Example #4
0
 public static ParserResult <I, O> EmptyOK <I, O>(O value, PString <I> input, ParserError error = null) =>
 new ParserResult <I, O>(ResultTag.Empty, ReplyIO.OK(value, input, error));
Example #5
0
 public Reply <I, U> Select <U>(Func <O, U> map) =>
 Tag == ReplyTag.Error
         ? ReplyIO.Error <I, U>(Error)
         : ReplyIO.OK(map(Result), State, Error);
Example #6
0
 public Reply <I, U> Project <S, U>(S s, Func <S, O, U> project) =>
 Tag == ReplyTag.Error
         ? ReplyIO.Error <I, U>(Error)
         : ReplyIO.OK(project(s, Result), State, Error);