private static void AdvanceWhitespace(ICharReader charReader) { var peek = charReader.Peek(); while (peek.HasValue && char.IsWhiteSpace(peek.Value)) { charReader.Read(); peek = charReader.Peek(); } }
private JsonValue ParseNumber(ICharReader charReader) { var sb = new StringBuilder(); var peek = charReader.Peek(); while (peek.HasValue && Numerics.Contains(peek.Value)) { sb.Append(charReader.Read()); peek = charReader.Peek(); } return(new JsonNumber(sb.ToString())); }
public static char?TrimThenPeek(this ICharReader charReader) { AdvanceWhitespace(charReader); return(charReader.Peek()); }