コード例 #1
0
        static IRenderizable ParseBlock(Token currentToken, List <Token> tokens, ref int index, Template mainTemplate)
        {
            var item = new TemplateBlock();

            var nextToken = tokens [index];

            if (nextToken.Type != TokenType.Parameter)
            {
                throw new TemplateException(string.Format("Invalid include at: {0}. Name not specified", currentToken.Position));
            }

            item.Path         = nextToken.Value.Trim();
            item.MainTemplate = mainTemplate;
            item.Body         = Parse(mainTemplate, tokens, ref index);
            return(item);
        }
コード例 #2
0
ファイル: Parser.cs プロジェクト: scorredoira/Sfx.Templates
		static IRenderizable ParseBlock(Token currentToken, List<Token> tokens, ref int index, Template mainTemplate)
		{
			var item = new TemplateBlock();

			var nextToken = tokens [index];
			if (nextToken.Type != TokenType.Parameter)
			{
				throw new TemplateException(string.Format("Invalid include at: {0}. Name not specified", currentToken.Position));
			}

			item.Path = nextToken.Value.Trim();
			item.MainTemplate = mainTemplate;    
			item.Body = Parse(mainTemplate, tokens, ref index);
			return item;
		}