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