예제 #1
0
 public FuncDef(Name name, Expr[] parameters, Expr[] defaults, FuncDefType flags, Stmt body, string sourceFile)
     : base(body)
 {
     this.name       = name;
     this.parameters = parameters;
     this.defaults   = defaults;
     this.flags      = flags;
     this.decorators = null;
     this.filename   = sourceFile;
 }
예제 #2
0
        public FunctionX(PythonModule globals, string name, CallTargetN target, string[] argNames, object[] defaults, FuncDefType flags)
            :
            base(globals, name, target, argNames, defaults)
        {
            this.flags = flags;
            nparams    = argNames.Length;

            if ((flags & FuncDefType.KeywordDict) != 0)
            {
                extraArgs++;
                nparams--;
                kwDictPos = nparams;
            }

            if ((flags & FuncDefType.ArgList) != 0)
            {
                extraArgs++;
                nparams--;
                argListPos = nparams;
            }

            Debug.Assert(defaults.Length <= nparams);
        }
예제 #3
0
 public FuncDef(Name name, Expr[] parameters, Expr[] defaults, FuncDefType flags, string sourceFile)
     : this(name, parameters, defaults, flags, null, sourceFile)
 {
 }