Exemplo n.º 1
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));
Exemplo n.º 2
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);
Exemplo n.º 3
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));
Exemplo n.º 4
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);