AddNodeToCurrentBlock() public method

public AddNodeToCurrentBlock ( SyntaxTreeNode node ) : void
node Veil.Parser.SyntaxTreeNode
return void
 private static void HandleEachOverExpression(SuperSimpleTemplateParserState state)
 {
     var each = SyntaxTree.Iterate(
         state.ParseCurrentTokenExpression(),
         SyntaxTree.Block()
     );
     state.AddNodeToCurrentBlock(each);
     state.PushNewScope(each.Body, each.ItemType);
 }
 private static void HandlePositiveConditional(SuperSimpleTemplateParserState state)
 {
     var condition = SyntaxTree.Conditional(
         state.ParseCurrentTokenExpression(),
         SyntaxTree.Block()
     );
     state.AddNodeToCurrentBlock(condition);
     state.PushNewScope(condition.TrueBlock);
 }
Esempio n. 3
0
        private static void HandlePositiveConditional(SuperSimpleTemplateParserState state)
        {
            var condition = SyntaxTree.Conditional(
                state.ParseCurrentTokenExpression(),
                SyntaxTree.Block()
                );

            state.AddNodeToCurrentBlock(condition);
            state.PushNewScope(condition.TrueBlock);
        }
Esempio n. 4
0
        private static void HandleEachOverExpression(SuperSimpleTemplateParserState state)
        {
            var each = SyntaxTree.Iterate(
                state.ParseCurrentTokenExpression(),
                SyntaxTree.Block()
                );

            state.AddNodeToCurrentBlock(each);
            state.PushNewScope(each.Body, each.ItemType);
        }
Esempio n. 5
0
        private static void HandlePartial(SuperSimpleTemplateParserState state)
        {
            var            details    = state.ParseCurrentTokenNameAndModelExpression();
            ExpressionNode expression = Expression.Self(state.CurrentTypeInScope());

            if (!String.IsNullOrEmpty(details.Model))
            {
                expression = state.ParseExpression(details.Model);
            }
            state.AddNodeToCurrentBlock(SyntaxTree.Include(details.Name, expression));
        }
Esempio n. 6
0
        private static void HandleWriteLiteral(SuperSimpleTemplateParserState state)
        {
            var expression = state.CurrentToken.Content;
            var htmlEncode = false;

            if (expression.StartsWith("!"))
            {
                htmlEncode = true;
                expression = expression.Substring(1);
            }
            state.AddNodeToCurrentBlock(SyntaxTree.WriteExpression(state.ParseExpression(expression), htmlEncode));
        }
Esempio n. 7
0
 private static void HandleStringLiteral(SuperSimpleTemplateParserState state)
 {
     state.AddNodeToCurrentBlock(SyntaxTree.WriteString(state.CurrentToken.Content));
 }
Esempio n. 8
0
 private static void HandleFlush(SuperSimpleTemplateParserState state)
 {
     state.AddNodeToCurrentBlock(SyntaxTree.Flush());
 }
Esempio n. 9
0
        private static void HandleSection(SuperSimpleTemplateParserState state)
        {
            var details = state.ParseCurrentTokenNameAndModelExpression();

            state.AddNodeToCurrentBlock(SyntaxTree.Override(details.Name));
        }
 private static void HandleStringLiteral(SuperSimpleTemplateParserState state)
 {
     state.AddNodeToCurrentBlock(SyntaxTree.WriteString(state.CurrentToken.Content));
 }
 private static void HandleWriteLiteral(SuperSimpleTemplateParserState state)
 {
     var expression = state.CurrentToken.Content;
     var htmlEncode = false;
     if (expression.StartsWith("!"))
     {
         htmlEncode = true;
         expression = expression.Substring(1);
     }
     state.AddNodeToCurrentBlock(SyntaxTree.WriteExpression(state.ParseExpression(expression), htmlEncode));
 }
 private static void HandleFlush(SuperSimpleTemplateParserState state)
 {
     state.AddNodeToCurrentBlock(SyntaxTree.Flush());
 }
 private static void HandleSection(SuperSimpleTemplateParserState state)
 {
     var details = state.ParseCurrentTokenNameAndModelExpression();
     state.AddNodeToCurrentBlock(SyntaxTree.Override(details.Name));
 }
        private static void HandlePartial(SuperSimpleTemplateParserState state)
        {
            var details = state.ParseCurrentTokenNameAndModelExpression();
            ExpressionNode expression = SyntaxTreeExpression.Self(state.CurrentTypeInScope());

            if (!String.IsNullOrEmpty(details.Model))
            {
                expression = state.ParseExpression(details.Model);
            }
            state.AddNodeToCurrentBlock(SyntaxTree.Include(details.Name, expression));
        }