Inheritance: Expression
        public SimpleAssignmentExpression(LeftValue/*!*/ left, Expression/*!*/ right, string operation, SourceSpan location)
            : base(operation, location) {
            Assert.NotNull(left, right);

            _left = left;
            _right = right;
        }
示例#2
0
 public CompoundLeftValue(LeftValue/*!*/[]/*!*/ leftValues, int unsplattedValueIndex) 
     : base(SourceSpan.None) {
     Assert.NotNullItems(leftValues);
     Debug.Assert(unsplattedValueIndex >= 0 && unsplattedValueIndex <= leftValues.Length);
     _leftValues = leftValues;
     _unsplattedValueIndex = unsplattedValueIndex;
 }
示例#3
0
 public RescueClause(Expression/*!*/ type, LeftValue target, List<Expression> statements, SourceSpan location)
     : base(location) {
     Assert.NotNull(type);
     _types = CollectionUtils.MakeList(type);
     _target = target;
     _statements = statements;
 }
示例#4
0
 public RescueClause(CompoundRightValue type, LeftValue target, Statements statements, SourceSpan location)
     : base(location) {
     _types = type.RightValues;
     _splatType = type.SplattedValue;
     _target = target;
     _statements = statements;
 }
示例#5
0
 public RescueClause(LeftValue target, List <Expression> statements, SourceSpan location)
     : base(location)
 {
     _target     = target;
     _types      = Expression.EmptyList;
     _statements = statements;
 }
示例#6
0
 public RescueClause(Expression/*!*/ type, LeftValue target, Statements statements, SourceSpan location)
     : base(location) {
     Assert.NotNull(type);
     _types = new Expression[] { type };
     _target = target;
     _statements = statements;
 }
示例#7
0
        public CompoundLeftValue(List<LeftValue>/*!*/ leftValues, LeftValue unsplattedValue, SourceSpan location)
            : base(location) {
            Assert.NotNull(leftValues);

            _leftValues = leftValues;
            _unsplattedValue = unsplattedValue;
        }
        public SimpleAssignmentExpression(LeftValue /*!*/ left, Expression /*!*/ right, string operation, SourceSpan location)
            : base(operation, location)
        {
            Assert.NotNull(left, right);

            _left  = left;
            _right = right;
        }
示例#9
0
        private readonly Expression[] _types; // might be empty, might include SplattedArgument expressions

        #endregion Fields

        #region Constructors

        public RescueClause(Expression/*!*/[]/*!*/ types, LeftValue target, Statements statements, SourceSpan location)
            : base(location)
        {
            Assert.NotNullItems(types);
            _types = types;
            _target = target;
            _statements = statements;
        }
示例#10
0
 public RescueClause(Expression /*!*/ type, LeftValue target, List <Expression> statements, SourceSpan location)
     : base(location)
 {
     Assert.NotNull(type);
     _types      = CollectionUtils.MakeList(type);
     _target     = target;
     _statements = statements;
 }
示例#11
0
 public RescueClause(CompoundRightValue type, LeftValue target, List <Expression> statements, SourceSpan location)
     : base(location)
 {
     _types      = type.RightValues;
     _splatType  = type.SplattedValue;
     _target     = target;
     _statements = statements;
 }
示例#12
0
 public RescueClause(Expression /*!*/ type, LeftValue target, Statements statements, SourceSpan location)
     : base(location)
 {
     Assert.NotNull(type);
     _types      = new Expression[] { type };
     _target     = target;
     _statements = statements;
 }
示例#13
0
        public CompoundLeftValue(List <LeftValue> /*!*/ leftValues, LeftValue unsplattedValue, SourceSpan location)
            : base(location)
        {
            Assert.NotNull(leftValues);

            _leftValues      = leftValues;
            _unsplattedValue = unsplattedValue;
        }
示例#14
0
 public RescueClause(Expression /*!*/[] /*!*/ types, LeftValue target, Statements statements, SourceSpan location)
     : base(location)
 {
     Assert.NotNullItems(types);
     _types      = types;
     _target     = target;
     _statements = statements;
 }
示例#15
0
        public Parameters(LeftValue /*!*/[] mandatory, int leadingMandatoryCount, SimpleAssignmentExpression /*!*/[] optional, LeftValue unsplat, LocalVariable block, SourceSpan location)
            : base(location)
        {
            mandatory = mandatory ?? LeftValue.EmptyArray;
            optional  = optional ?? SimpleAssignmentExpression.EmptyArray;

            Debug.Assert(leadingMandatoryCount >= 0 && leadingMandatoryCount <= mandatory.Length);
            Debug.Assert(leadingMandatoryCount == mandatory.Length || optional != null || unsplat != null);

            _mandatory             = mandatory;
            _leadingMandatoryCount = leadingMandatoryCount;
            _optional = optional;
            _unsplat  = unsplat;
            _block    = block;
        }
示例#16
0
        public Parameters(LeftValue/*!*/[] mandatory, int leadingMandatoryCount, SimpleAssignmentExpression/*!*/[] optional, LeftValue unsplat, LocalVariable block, SourceSpan location)
            : base(location) {

            mandatory = mandatory ?? LeftValue.EmptyArray;
            optional = optional ?? SimpleAssignmentExpression.EmptyArray;

            Debug.Assert(leadingMandatoryCount >= 0 && leadingMandatoryCount <= mandatory.Length);
            Debug.Assert(leadingMandatoryCount == mandatory.Length || optional != null || unsplat != null);

            _mandatory = mandatory;
            _leadingMandatoryCount = leadingMandatoryCount;
            _optional = optional;
            _unsplat = unsplat;
            _block = block;
        }
示例#17
0
        internal static string assignmentVar(LeftValue lval, NodeParent parent)
        {
            if (lval is LocalVariable)
            {
                var method = parent.OfType<MethodDefinition>().ToArray();
                if (method.Length > 0 && method[0].Parameters != null
                    && method[0].Parameters.Mandatory.Where(p => p.ToString() == ((LocalVariable)lval).Name).Count() > 0)
                {
                    return "$" + Mangling.RubyIdentifierToPHP(((LocalVariable)lval).Name);
                }
                if (parent.OfType<ClassDefinition>().Count() == 0)
                {
                    return "$_locals->" + Mangling.RubyIdentifierToPHP(((LocalVariable)lval).Name);
                }
            }

            return ((Variable)lval).ToPHPVariable();
        }
示例#18
0
 public RescueClause(LeftValue target, Statements statements, SourceSpan location)
     : base(location) {
     _target = target;
     _types = Expression.EmptyArray;
     _statements = statements;
 }
示例#19
0
 public CompoundLeftValue(LeftValue/*!*/[]/*!*/ leftValues)
     : this(leftValues, leftValues.Length) {
 }