예제 #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));
예제 #2
0
 internal ParserResult(ResultTag tag, Reply <I, O> reply)
 {
     Tag   = tag;
     Reply = reply;
 }
예제 #3
0
 public static ParserResult <I, O> Consumed <I, O>(Reply <I, O> reply) =>
 new ParserResult <I, O>(ResultTag.Consumed, reply);
예제 #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));
예제 #5
0
 public static ParserResult <I, O> ConsumedError <I, O>(ParserError error) =>
 new ParserResult <I, O>(ResultTag.Consumed, Reply.Error <I, O>(error));
예제 #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));
예제 #7
0
 public static ParserResult <I, O> EmptyError <I, O>(ParserError error) =>
 new ParserResult <I, O>(ResultTag.Empty, Reply.Error <I, O>(error));
예제 #8
0
 public static ParserResult <I, O> Empty <I, O>(Reply <I, O> reply) =>
 new ParserResult <I, O>(ResultTag.Empty, reply);
예제 #9
0
 public static ParserResult <T> ConsumedOK <T>(T value, PString input, ParserError error) =>
 new ParserResult <T>(ResultTag.Consumed, Reply.OK(value, input, error));
예제 #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));
예제 #11
0
 public static ParserResult <T> Empty <T>(Reply <T> reply) =>
 new ParserResult <T>(ResultTag.Empty, reply);
예제 #12
0
 public static ParserResult <T> Consumed <T>(Reply <T> reply) =>
 new ParserResult <T>(ResultTag.Consumed, reply);