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

            _left = left;
            _right = right;
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 public RescueClause(CompoundRightValue type, LeftValue target, Statements statements, SourceSpan location)
     : base(location) {
     _types = type.RightValues;
     _splatType = type.SplattedValue;
     _target = target;
     _statements = statements;
 }
Exemplo n.º 5
0
 public RescueClause(LeftValue target, List <Expression> statements, SourceSpan location)
     : base(location)
 {
     _target     = target;
     _types      = Expression.EmptyList;
     _statements = statements;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 13
0
        public CompoundLeftValue(List <LeftValue> /*!*/ leftValues, LeftValue unsplattedValue, SourceSpan location)
            : base(location)
        {
            Assert.NotNull(leftValues);

            _leftValues      = leftValues;
            _unsplattedValue = unsplattedValue;
        }
Exemplo n.º 14
0
 public RescueClause(Expression /*!*/[] /*!*/ types, LeftValue target, Statements statements, SourceSpan location)
     : base(location)
 {
     Assert.NotNullItems(types);
     _types      = types;
     _target     = target;
     _statements = statements;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
Exemplo n.º 18
0
 public RescueClause(LeftValue target, Statements statements, SourceSpan location)
     : base(location) {
     _target = target;
     _types = Expression.EmptyArray;
     _statements = statements;
 }
Exemplo n.º 19
0
 public CompoundLeftValue(LeftValue/*!*/[]/*!*/ leftValues)
     : this(leftValues, leftValues.Length) {
 }