Ejemplo n.º 1
0
        private static object ParseValue(char[] json, ref int index, ref bool success)
        {
            object result;

            switch (SimpleJsonTool.LookAhead(json, index))
            {
            case 1:
                result = SimpleJsonTool.ParseObject(json, ref index, ref success);
                return(result);

            case 3:
                result = SimpleJsonTool.ParseArray(json, ref index, ref success);
                return(result);

            case 7:
                result = SimpleJsonTool.ParseString(json, ref index, ref success);
                return(result);

            case 8:
                result = SimpleJsonTool.ParseNumber(json, ref index, ref success);
                return(result);

            case 9:
                SimpleJsonTool.NextToken(json, ref index);
                result = true;
                return(result);

            case 10:
                SimpleJsonTool.NextToken(json, ref index);
                result = false;
                return(result);

            case 11:
                SimpleJsonTool.NextToken(json, ref index);
                result = null;
                return(result);
            }
            success = false;
            result  = null;
            return(result);
        }