public override void OnSlice(Slice node) { base.OnSlice(node); if (TypeSystemServices.IsDuckTyped((Expression) node.ParentNode)) return; AssertInt(node.Begin); AssertOptionalInt(node.End); if (node.Step != null) CompilerErrorFactory.NotImplemented(node.Step, "slicing step"); }
bool CheckComplexSlicingParameters(Slice node) { if (null != node.Step) { NotImplemented(node, "slicing step"); return false; } if (OmittedExpression.Default == node.Begin) node.Begin = CreateIntegerLiteral(0); else if (!AssertTypeCompatibility(node.Begin, TypeSystemServices.IntType, GetExpressionType(node.Begin))) return false; if (null != node.End && OmittedExpression.Default != node.End) return AssertTypeCompatibility(node.End, TypeSystemServices.IntType, GetExpressionType(node.End)); return true; }
public static bool IsComplexSlice(Slice slice) { return slice.End != null || slice.Step != null || slice.Begin == OmittedExpression.Default; }
public override void OnSlice(Slice node) { Visit(node.Begin); if (null != node.End || WasOmitted(node.Begin)) { Write(":"); } Visit(node.End); if (null != node.Step) { Write(":"); Visit(node.Step); } }
public static bool IsComplexSlice(Slice slice) { return null != slice.End || null != slice.Step || OmittedExpression.Default == slice.Begin; }
override public object Clone() { Slice clone = new Slice(); clone._lexicalInfo = _lexicalInfo; clone._endSourceLocation = _endSourceLocation; clone._documentation = _documentation; clone._isSynthetic = _isSynthetic; clone._entity = _entity; if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone(); if (null != _begin) { clone._begin = _begin.Clone() as Expression; clone._begin.InitializeParent(clone); } if (null != _end) { clone._end = _end.Clone() as Expression; clone._end.InitializeParent(clone); } if (null != _step) { clone._step = _step.Clone() as Expression; clone._step.InitializeParent(clone); } return clone; }