public void Eof_RemainingInput_ReturnsError() { var parser = Parse.Eof <int>(); var result = parser.Parse("abc"); ParseAssert.IsError(result); }
public void Eof_EndOfInput_ReturnsSuccess() { var parser = Parse.Eof <int>(); var result = parser.Parse(""); ParseAssert.IsSuccess(result); }
/// <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>())); }