internal override void Resolve(ParserContext parser)
        {
            parser.ValueStackDepth = 0;

            this.FunctionID = parser.GetNextFunctionId();

            for (int i = 0; i < this.DefaultValues.Length; ++i)
            {
                if (this.DefaultValues[i] != null)
                {
                    this.DefaultValues[i] = this.DefaultValues[i].Resolve(parser);
                }
            }

            this.Code = Executable.Resolve(parser, this.Code).ToArray();

            if (this.Code.Length == 0 || !(this.Code[this.Code.Length - 1] is ReturnStatement))
            {
                List <Executable> newCode = new List <Executable>(this.Code);
                newCode.Add(new ReturnStatement(this.FirstToken, null, this));
                this.Code = newCode.ToArray();
            }
        }
Exemple #2
0
 protected static IList <Executable> Listify(Executable ex)
 {
     return(new Executable[] { ex });
 }
Exemple #3
0
 internal override Executable PastelResolve(ParserContext parser)
 {
     this.Condition = this.Condition.PastelResolve(parser);
     this.Code      = Executable.PastelResolveExecutables(parser, this.Code);
     return(this);
 }