Esempio n. 1
0
        private static void AdvanceWhitespace(ICharReader charReader)
        {
            var peek = charReader.Peek();

            while (peek.HasValue && char.IsWhiteSpace(peek.Value))
            {
                charReader.Read();
                peek = charReader.Peek();
            }
        }
Esempio n. 2
0
        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()));
        }
Esempio n. 3
0
 public static char?TrimThenPeek(this ICharReader charReader)
 {
     AdvanceWhitespace(charReader);
     return(charReader.Peek());
 }