Example #1
0
 public static Reply <T> mergeErrorReply <T>(ParserError err, Reply <T> reply) =>
 reply.Tag == ReplyTag.OK
         ? Reply.OK(reply.Result, reply.State, mergeError(err, reply.Error))
         : Reply.Error <T>(mergeError(err, reply.Error));
Example #2
0
 internal ParserResult(ResultTag tag, Reply <I, O> reply)
 {
     Tag   = tag;
     Reply = reply;
 }
Example #3
0
 public static ParserResult <I, O> Consumed <I, O>(Reply <I, O> reply) =>
 new ParserResult <I, O>(ResultTag.Consumed, reply);
Example #4
0
 public static ParserResult <I, O> ConsumedOK <I, O>(O value, PString <I> input, ParserError error) =>
 new ParserResult <I, O>(ResultTag.Consumed, Reply.OK(value, input, error));
Example #5
0
 public static ParserResult <I, O> ConsumedError <I, O>(ParserError error) =>
 new ParserResult <I, O>(ResultTag.Consumed, Reply.Error <I, O>(error));
Example #6
0
 public static ParserResult <I, O> EmptyOK <I, O>(O value, PString <I> input, ParserError error = null) =>
 new ParserResult <I, O>(ResultTag.Empty, Reply.OK(value, input, error));
Example #7
0
 public static ParserResult <I, O> EmptyError <I, O>(ParserError error) =>
 new ParserResult <I, O>(ResultTag.Empty, Reply.Error <I, O>(error));
Example #8
0
 public static ParserResult <I, O> Empty <I, O>(Reply <I, O> reply) =>
 new ParserResult <I, O>(ResultTag.Empty, reply);
Example #9
0
 public static ParserResult <T> ConsumedOK <T>(T value, PString input, ParserError error) =>
 new ParserResult <T>(ResultTag.Consumed, Reply.OK(value, input, error));
Example #10
0
 public static ParserResult <T> EmptyOK <T>(T value, PString input, ParserError error = null) =>
 new ParserResult <T>(ResultTag.Empty, Reply.OK(value, input, error));
Example #11
0
 public static ParserResult <T> Empty <T>(Reply <T> reply) =>
 new ParserResult <T>(ResultTag.Empty, reply);
Example #12
0
 public static ParserResult <T> Consumed <T>(Reply <T> reply) =>
 new ParserResult <T>(ResultTag.Consumed, reply);