public static IEnumerable <JToken> ParseToken(IStringParserQuick parser, JToken.ParseOptions flags = JToken.ParseOptions.None, int maxstringlen = 16384)
        {
            var res = ParseTokenInt(parser, flags, maxstringlen);

            if ((flags & ParseOptions.CheckEOL) != 0 && !parser.IsEOL())
            {
                throw new TokenException(GenErrorString(parser, "Extra Chars after JSON"));
            }
            return(res);
        }
Beispiel #2
0
        public static JToken Parse(IStringParserQuick parser, out string error, ParseOptions flags, char[] textbuffer)
        {
            JToken res = IntParse(parser, out error, flags, textbuffer);

            if (res != null && (flags & ParseOptions.CheckEOL) != 0 && !parser.IsEOL())
            {
                return(ParseError(parser, "Extra Chars after JSON", flags, out error));
            }
            else
            {
                return(res);
            }
        }
Beispiel #3
0
        // normally, use Parse above. Used only if you want to feed in another type of parser..

        public static JToken Parse(IStringParserQuick parser, out string error, ParseOptions flags, int textbufsize)
        {
            char[] textbuffer = new char[textbufsize];      // textbuffer to use for string decodes - one get of it, multiple reuses, faster

            JToken res = IntParse(parser, out error, flags, textbuffer);

            if (res != null && (flags & ParseOptions.CheckEOL) != 0 && !parser.IsEOL())
            {
                return(ParseError(parser, "Extra Chars after JSON", flags, out error));
            }
            else
            {
                return(res);
            }
        }