Skip to content

Commit

Permalink
feat: added create array function
Browse files Browse the repository at this point in the history
  • Loading branch information
thygesteffensen committed Feb 28, 2021
1 parent 8b7bb26 commit fa18aa5
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Linq;
using Parser.ExpressionParser.Functions.Base;
using Parser.ExpressionParser.Functions.CustomException;

namespace Parser.ExpressionParser.Functions.Implementations.ConversionFunctions
{
public class CreateArrayFunction : Function
{
public CreateArrayFunction() : base("createArray")
{
}

public override ValueContainer ExecuteFunction(params ValueContainer[] parameters)
{
if (parameters.Length == 0)
{
throw InvalidTemplateException.BuildInvalidLanguageFunction("SomeActon", "createArray");
}

return new ValueContainer(parameters.ToList());
}
}
}

0 comments on commit fa18aa5

Please sign in to comment.