private Dictionary<string, object> ParseObject()
{
Dictionary<string, object> table = new Dictionary<string, object>();
// ditch opening brace
this.json.Read();
// {
while (true)
{
switch (this.NextToken)
{
case TOKEN.NONE:
return null;
case TOKEN.COMMA:
continue;
case TOKEN.CURLY_CLOSE:
return table;
default:
// name
string name = this.ParseString();
if (name == null)
{
return null;
}
// :
if (this.NextToken != TOKEN.COLON)
{
return null;
}
// ditch the colon
this.json.Read();
// value
table[name] = this.ParseValue();
break;
}
}
}