Exemple #1
0
        //
        // For named arguments when the order of execution is different
        // to order of invocation
        //
        public Arguments MarkOrderedArgument(NamedArgument a)
        {
            //
            // An expression has no effect on left-to-right execution
            //
            if (a.Expr.IsSideEffectFree)
            {
                return(this);
            }

            ArgumentsOrdered ra = this as ArgumentsOrdered;

            if (ra == null)
            {
                ra = new ArgumentsOrdered(this);

                for (int i = 0; i < args.Count; ++i)
                {
                    var la = args [i];
                    if (la == a)
                    {
                        break;
                    }

                    //
                    // When the argument is filled later by default expression
                    //
                    if (la == null)
                    {
                        continue;
                    }

                    var ma = la as MovableArgument;
                    if (ma == null)
                    {
                        ma         = new MovableArgument(la);
                        ra.args[i] = ma;
                    }

                    ra.AddOrdered(ma);
                }
            }

            ra.AddOrdered(a);
            return(ra);
        }
Exemple #2
0
		//
		// For named arguments when the order of execution is different
		// to order of invocation
		//
		public Arguments MarkOrderedArgument (NamedArgument a)
		{
			//
			// An expression has no effect on left-to-right execution
			//
			if (a.Expr.IsSideEffectFree)
				return this;

			ArgumentsOrdered ra = this as ArgumentsOrdered;
			if (ra == null) {
				ra = new ArgumentsOrdered (this);

				for (int i = 0; i < args.Count; ++i) {
					var la = args [i];
					if (la == a)
						break;

					//
					// When the argument is filled later by default expression
					//
					if (la == null)
						continue;

					var ma = la as MovableArgument;
					if (ma == null) {
						ma = new MovableArgument (la);
						ra.args[i] = ma;
					}

					ra.AddOrdered (ma);
				}
			}

			ra.AddOrdered (a);
			return ra;
		}
Exemple #3
0
 public void AddOrdered(MovableArgument arg)
 {
     ordered.Add(arg);
 }
Exemple #4
0
			public void AddOrdered (MovableArgument arg)
			{
				ordered.Add (arg);
			}