public ScriptFunction(LoLa.Runtime.LoLaObject env, string name, string[] args, IReadOnlyList <Instruction> code, bool isTapFunction) : #endif base(args.Length) { if (env == null) { throw new ArgumentNullException(nameof(env)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } if (code == null) { throw new ArgumentNullException(nameof(code)); } this.Environment = env; this.Name = name; this.@params = args.ToList(); this.Code = code.ToArray(); this.IsTapFunction = isTapFunction; if (this.IsTapFunction && ([email protected] > 0)) { throw new InvalidOperationException("Tap function must not have arguments!"); } }
internal LoLaObject(LoLaObject env) : base(env) { }
public ScriptFunction(LoLa.Runtime.LoLaObject env, string name, string[] args, IEnumerable <Instruction> code, bool isTapFunction) :
public static FunctionCall Evaluate(LoLa.Runtime.LoLaObject environment, string source) { var pgm = Compile(source); return(pgm.Evaluate(environment)); }