public static ParsedTemplate FromText(string content, ITextTemplatingEngineHost host) { ParsedTemplate template = new ParsedTemplate(host.TemplateFile); try { template.Parse(host, new Tokeniser(host.TemplateFile, content)); } catch (ParserException ex) { template.LogError(ex.Message, ex.Location); } return(template); }
public static ParsedTemplate FromText(string content, ITextTemplatingEngineHost host) { if (host == null) { throw new ArgumentNullException(nameof(host)); } var template = new ParsedTemplate(host.TemplateFile); try { template.Parse(host, new Tokeniser(host.TemplateFile, content)); } catch (ParserException ex) { template.LogError(ex.Message, ex.Location); } return(template); }