public void Parse(TemplateAST ast) { if (_parsed) ExceptionHelper.ThrowIncludeAlreadyParsed(_path); _parsedNode = ast.Root; _parsed = true; }
public void Parse(TemplateAST ast) { if (_parsed) { ExceptionHelper.ThrowIncludeAlreadyParsed(_path); } _parsedNode = ast.Root; _parsed = true; }
private void ParseIncludeTemplate(TemplateAST ast) { IncludeNodeVisitor v = new IncludeNodeVisitor(); ast.Root.Accept(v); foreach (IncludeNode inc in v.Includes) { TemplateParser inner = new TemplateParser(_engine); TemplateAST innerAst = inner.Parse(inc.Path.UnBracketing(StringPair.DoubleQuote)); inc.Parse(innerAst); } }
internal string Render(TemplateAST ast) { TemplateVisitor v = new TemplateVisitor(_ctx, _cfg); ast.Root.Accept(v); return v.Result; }