private static void GuardHasParsedWholeInput(InputReader input) { if (input.HasNext()) { throw new BadInputFormat(input.Text, input.Index); } }
private static void SkipWhiteSpace(this InputReader input) { while (input.HasNext() && char.IsWhiteSpace(input.PeekNext())) { input.Next(); } }
internal static string TakeWhile(this InputReader input, Func <char, bool> predicate) { input.SkipWhiteSpace(); string token = ""; while (input.HasNext() && predicate(input.PeekNext())) { token += input.Next(); } return(token); }
internal static bool NextIs(this InputReader input, params char[] anyOf) { input.SkipWhiteSpace(); return(input.HasNext() && anyOf.Contains(input.PeekNext())); }