示例#1
0
 public BlockFunctionNode(int id, IBlockFunction blockFunction, IDictionary <string, ExpressionNode> attributes, string content)
 {
     Id            = id;
     BlockFunction = blockFunction;
     Attributes    = attributes;
     Content       = content;
 }
示例#2
0
        public void Setup()
        {
            var tokenizer           = new Tokenizer(new StringReader(input));
            var blockFunctions      = new IBlockFunction[] { new ForEach() };
            var inlineFunctions     = new IInlineFunction[] { new LDelim() };
            var expressionFunctions = new IExpressionFunction[] { new If() };

            var functions = new Functions(blockFunctions, inlineFunctions, expressionFunctions, new List <IVariableModifier>());

            parser = new Parser(0, tokenizer, functions);
        }
示例#3
0
        public void Setup()
        {
            var blockFunctions      = new IBlockFunction[] { new ForEach(), new Literal(), new Strip(), new Capture() };
            var inlineFunctions     = new IInlineFunction[] { new LDelim(), new RDelim(), new Assign(), new Cycle() };
            var expressionFunctions = new IExpressionFunction[] { new If() };
            var variableModifiers   = new IVariableModifier[] { new Capitalize(), new Cat(), new CountCharacters(), new CountParagraphs(), new CountSentences(), new CountWords(), new DateFormat(), new Default(), new Lower(), new NewLineToBreak(), new RegexReplace(), new Replace(), new Spacify(), new StringFormat(), new ASmarty.VariableModifiers.Strip(), new StripTags(), new Truncate(), new Upper(), new WordWrap(), new Indent() };
            var functions           = new Functions(blockFunctions, inlineFunctions, expressionFunctions, variableModifiers);

            viewData     = new Dictionary <string, object>();
            functionData = new Dictionary <string, object>();

            var internalEvaluator = new InternalEvaluator(null, null, functions);

            evaluator         = new ViewEngine.Evaluator(internalEvaluator, 0);
            functionEvaluator = new FunctionEvaluator(internalEvaluator, 0, functionData);
        }