示例#1
0
        public void Eof_RemainingInput_ReturnsError()
        {
            var parser = Parse.Eof <int>();
            var result = parser.Parse("abc");

            ParseAssert.IsError(result);
        }
示例#2
0
        public void Eof_EndOfInput_ReturnsSuccess()
        {
            var parser = Parse.Eof <int>();
            var result = parser.Parse("");

            ParseAssert.IsSuccess(result);
        }
示例#3
0
 /// <summary>
 /// Applies the parser and succeeds if it is followed by the end of the input.
 /// </summary>
 public static IParser <T> FollowedByEof <T>(this IParser <T> parser)
 {
     return(parser.FollowedBy(Parse.Eof <T>()));
 }