예제 #1
0
파일: IncludeNode.cs 프로젝트: rexzh/RexToy
        public void Parse(TemplateAST ast)
        {
            if (_parsed)
                ExceptionHelper.ThrowIncludeAlreadyParsed(_path);

            _parsedNode = ast.Root;
            _parsed = true;
        }
예제 #2
0
        public void Parse(TemplateAST ast)
        {
            if (_parsed)
            {
                ExceptionHelper.ThrowIncludeAlreadyParsed(_path);
            }

            _parsedNode = ast.Root;
            _parsed     = true;
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 internal string Render(TemplateAST ast)
 {
     TemplateVisitor v = new TemplateVisitor(_ctx, _cfg);
     ast.Root.Accept(v);
     return v.Result;
 }