/// <summary> /// Parses the text. /// </summary> /// <param name="text">The text.</param> /// <returns>HoconValue.</returns> /// <exception cref="System.Exception">Unresolved substitution: + sub.Path</exception> private HoconRoot ParseText(string text) { 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 Exception("Unresolved substitution:" + sub.Path); sub.ResolvedValue = res; } return new HoconRoot(root, substitutions); }
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); }
private HoconValue ParseText(string text) { root = new HoconValue(); reader = new HoconTokenizer(text); reader.PullWhitespaceAndComments(); ParseObject(root, true); var c = new Config(root); foreach (HoconSubstitution sub in substitutions) { HoconValue res = c.GetValue(sub.Path); if (res == null) { throw new Exception("Unresolved substitution:" + sub.Path); } sub.ResolvedValue = res; } return(root); }
/// <summary> /// Parses the text. /// </summary> /// <param name="text">The text.</param> /// <returns>HoconValue.</returns> /// <exception cref="System.Exception">Unresolved substitution: + sub.Path</exception> private HoconRoot ParseText(string text) { _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 Exception("Unresolved substitution:" + sub.Path); } sub.ResolvedValue = res; } return(new HoconRoot(_root, _substitutions)); }
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)); }