Exemplo n.º 1
0
        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!");
            }
        }
Exemplo n.º 2
0
 internal LoLaObject(LoLaObject env) :
     base(env)
 {
 }
Exemplo n.º 3
0
 public ScriptFunction(LoLa.Runtime.LoLaObject env, string name, string[] args, IEnumerable <Instruction> code, bool isTapFunction) :
Exemplo n.º 4
0
        public static FunctionCall Evaluate(LoLa.Runtime.LoLaObject environment, string source)
        {
            var pgm = Compile(source);

            return(pgm.Evaluate(environment));
        }