Пример #1
0
        public void Resolve(ResolveContext ec)
        {
//			using (ec.With (ResolveContext.Options.DoFlowAnalysis, true)) {

            // Keep track of the array initializer, we need it to do array type inference when searching for
            // a matching method.
            if (ec.FileType == SourceFileType.PlayScript)
            {
                if (Expr is AsArrayInitializer)
                {
                    InferArrayInitializer = (AsArrayInitializer)Expr;
                }
                else if (Expr is AsObjectInitializer)
                {
                    InferObjInitializer = (AsObjectInitializer)Expr;
                }
                else if (Expr is AnonymousMethodExpression)
                {
                    Expr = new Cast(new TypeExpression(ec.BuiltinTypes.Delegate, Expr.Location), Expr, Expr.Location);
                }
            }

            // Verify that the argument is readable
            if (ArgType != AType.Out)
            {
                Expr = Expr.Resolve(ec);
            }

            // Verify that the argument is writeable
            if (Expr != null && IsByRef)
            {
                Expr = Expr.ResolveLValue(ec, EmptyExpression.OutAccess);
            }

            if (Expr == null)
            {
                Expr = ErrorExpression.Instance;
            }
//			}
        }
Пример #2
0
		public void Resolve (ResolveContext ec)
		{
//			using (ec.With (ResolveContext.Options.DoFlowAnalysis, true)) {

				// Keep track of the array initializer, we need it to do array type inference when searching for
				// a matching method.
				if (ec.FileType == SourceFileType.PlayScript) {
					if (Expr is AsArrayInitializer) {
						InferArrayInitializer = (AsArrayInitializer)Expr;
					} else if (Expr is AsObjectInitializer) {
						InferObjInitializer = (AsObjectInitializer)Expr;
					} else if (Expr is AnonymousMethodExpression) {
						Expr = new Cast(new TypeExpression(ec.BuiltinTypes.Delegate, Expr.Location), Expr, Expr.Location);
					}
				}

				// Verify that the argument is readable
				if (ArgType != AType.Out)
					Expr = Expr.Resolve (ec);

				// Verify that the argument is writeable
				if (Expr != null && IsByRef)
					Expr = Expr.ResolveLValue (ec, EmptyExpression.OutAccess);

				if (Expr == null)
					Expr = ErrorExpression.Instance;
//			}
		}
Пример #3
0
		// ActionScript/PlayScript Expressions

		public virtual object Visit (AsObjectInitializer initializer)
		{
			return null;
		}
Пример #4
0
        // ActionScript/PlayScript Expressions

        public virtual object Visit(AsObjectInitializer initializer)
        {
            return(null);
        }