public SimpleAssignmentExpression(LeftValue/*!*/ left, Expression/*!*/ right, string operation, SourceSpan location) : base(operation, location) { Assert.NotNull(left, right); _left = left; _right = right; }
public CompoundLeftValue(LeftValue/*!*/[]/*!*/ leftValues, int unsplattedValueIndex) : base(SourceSpan.None) { Assert.NotNullItems(leftValues); Debug.Assert(unsplattedValueIndex >= 0 && unsplattedValueIndex <= leftValues.Length); _leftValues = leftValues; _unsplattedValueIndex = unsplattedValueIndex; }
public RescueClause(Expression/*!*/ type, LeftValue target, List<Expression> statements, SourceSpan location) : base(location) { Assert.NotNull(type); _types = CollectionUtils.MakeList(type); _target = target; _statements = statements; }
public RescueClause(CompoundRightValue type, LeftValue target, Statements statements, SourceSpan location) : base(location) { _types = type.RightValues; _splatType = type.SplattedValue; _target = target; _statements = statements; }
public RescueClause(LeftValue target, List <Expression> statements, SourceSpan location) : base(location) { _target = target; _types = Expression.EmptyList; _statements = statements; }
public RescueClause(Expression/*!*/ type, LeftValue target, Statements statements, SourceSpan location) : base(location) { Assert.NotNull(type); _types = new Expression[] { type }; _target = target; _statements = statements; }
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; }
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; }
public RescueClause(Expression /*!*/ type, LeftValue target, List <Expression> statements, SourceSpan location) : base(location) { Assert.NotNull(type); _types = CollectionUtils.MakeList(type); _target = target; _statements = statements; }
public RescueClause(CompoundRightValue type, LeftValue target, List <Expression> statements, SourceSpan location) : base(location) { _types = type.RightValues; _splatType = type.SplattedValue; _target = target; _statements = statements; }
public RescueClause(Expression /*!*/ type, LeftValue target, Statements statements, SourceSpan location) : base(location) { Assert.NotNull(type); _types = new Expression[] { type }; _target = target; _statements = statements; }
public CompoundLeftValue(List <LeftValue> /*!*/ leftValues, LeftValue unsplattedValue, SourceSpan location) : base(location) { Assert.NotNull(leftValues); _leftValues = leftValues; _unsplattedValue = unsplattedValue; }
public RescueClause(Expression /*!*/[] /*!*/ types, LeftValue target, Statements statements, SourceSpan location) : base(location) { Assert.NotNullItems(types); _types = types; _target = target; _statements = statements; }
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; }
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; }
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(); }
public RescueClause(LeftValue target, Statements statements, SourceSpan location) : base(location) { _target = target; _types = Expression.EmptyArray; _statements = statements; }
public CompoundLeftValue(LeftValue/*!*/[]/*!*/ leftValues) : this(leftValues, leftValues.Length) { }