public BindingResolver(BlockStyles blockStyle = BlockStyles.CSharp, IFunctionRunner runner = null, BindingLexer lexer = null, BindingParser parser = null,
                               IAstCache cache        = null)
        {
            _lexer     = lexer ?? new BindingLexer(blockStyle);
            _parser    = parser ?? new BindingParser();
            BlockStyle = blockStyle;
            Cache      = cache;

            // Always setup standard functions
            UseRunner(new ObjectMethodRunner(new ScriptFunctions()));

            // Add custom functions
            if (runner != null)
            {
                UseRunner(runner);
            }
        }
Exemple #2
0
 /// <summary>
 ///     Wrapper class used to implement the middleware pattern
 /// </summary>
 /// <param name="source"></param>
 /// <param name="next"></param>
 public FunctionRunnerWrapper(IFunctionRunner source, FunctionRunnerWrapper next)
 {
     _source = source ?? throw new ArgumentNullException(nameof(source));
     Next    = next;
 }