protected override void ProcessArgument(TemplateContext context, ScriptNamedArgument argument)
 {
     _columnsCount = 1;
     if (argument.Name == "cols")
     {
         _columnsCount = context.ToInt(argument.Value.Span, context.Evaluate(argument.Value));
         if (_columnsCount <= 0)
         {
             _columnsCount = 1;
         }
         return;
     }
     base.ProcessArgument(context, argument);
 }
Esempio n. 2
0
 protected virtual ValueTask ProcessArgumentAsync(TemplateContext context, ScriptNamedArgument argument)
 {
     throw new ScriptRuntimeException(argument.Span, $"Unsupported argument `{argument.Name}` for statement: `{this}`");
 }
Esempio n. 3
0
 public static void AddParameter(this IScriptNamedArgumentContainer container, ScriptNamedArgument argument)
 {
     if (container.NamedArguments == null)
     {
         container.NamedArguments = new List <ScriptNamedArgument>();
     }
     container.NamedArguments.Add(argument);
 }