private HoconRoot ParseText(string text,Func<string,HoconRoot> includeCallback)
{
_includeCallback = includeCallback;
_root = new HoconValue();
_reader = new HoconTokenizer(text);
_reader.PullWhitespaceAndComments();
ParseObject(_root, true,"");
var c = new Config(new HoconRoot(_root, Enumerable.Empty<HoconSubstitution>()));
foreach (HoconSubstitution sub in _substitutions)
{
HoconValue res = c.GetValue(sub.Path);
if (res == null)
throw new FormatException("Unresolved substitution:" + sub.Path);
sub.ResolvedValue = res;
}
return new HoconRoot(_root, _substitutions);
}