/// <summary>
/// Parses the object.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="root">if set to <c>true</c> [root].</param>
private void ParseObject(HoconValue owner, bool root)
{
if (owner.IsObject())
{
//the value of this KVP is already an object
}
else
{
//the value of this KVP is not an object, thus, we should add a new
owner.NewValue(new HoconObject());
}
HoconObject currentObject = owner.GetObject();
while (!reader.EoF)
{
Token t = reader.PullNext();
switch (t.Type)
{
case TokenType.EoF:
break;
case TokenType.Key:
HoconValue value = currentObject.GetOrCreateKey(t.Value);
ParseKeyContent(value);
if (!root)
return;
break;
case TokenType.ObjectEnd:
return;
}
}
}