2 types derived from Rope
Microsoft.CodeAnalysis (2)
Collections\Rope.cs (2)
86private sealed class StringRope : Rope 115private sealed class ConcatRope : Rope
73 references to Rope
Microsoft.CodeAnalysis (19)
Collections\Rope.cs (12)
18public static readonly Rope Empty = ForString(""); 28public static Rope ForString(string s) 39public static Rope Concat(Rope r1, Rope r2) 59if (!(obj is Rope other) || Length != other.Length) 117private readonly Rope _left, _right; 120public ConcatRope(Rope left, Rope right) 130var stack = new Stack<Rope>(); 159var stack = new Stack<Rope>(); 185var stack = new Stack<Rope>();
ConstantValue.cs (2)
45internal virtual Rope? RopeValue { get { throw new InvalidOperationException(); } } 109internal static ConstantValue CreateFromRope(Rope value)
ConstantValueSpecialized.cs (5)
96internal override Rope? RopeValue 136private readonly Rope _value; 149_value = Rope.ForString(value); 152public ConstantValueString(Rope value) 192internal override Rope RopeValue
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Operators.cs (5)
2180Rope leftValue = valueLeft.RopeValue ?? Rope.Empty; 2181Rope rightValue = valueRight.RopeValue ?? Rope.Empty; 2184return (newLength > int.MaxValue) ? ConstantValue.Bad : ConstantValue.CreateFromRope(Rope.Concat(leftValue, rightValue));
Microsoft.CodeAnalysis.UnitTests (44)
Collections\RopeTests.cs (44)
23private static readonly Rope[] longRopes = longStrings.Select(s => Rope.ForString(s)).ToArray(); 29private static readonly Rope[] shortRopes = shortStrings.Select(s => Rope.ForString(s)).ToArray(); 31private static readonly Rope[] someRopes = shortRopes.Concat(longRopes).ToArray(); 37Rope r = Rope.Empty; 40Assert.Equal(r, Rope.ForString(string.Empty)); 41Assert.Equal(Rope.ForString(string.Empty), r); 47foreach (var rope in someRopes) 49Assert.Same(rope, Rope.Concat(rope, Rope.Empty)); 50Assert.Same(rope, Rope.Concat(Rope.Empty, rope)); 59Assert.Equal(s, Rope.ForString(s).ToString()); 66foreach (var r1 in someRopes) 68foreach (var r2 in someRopes) 70foreach (var r3 in someRopes) 72Rope c1 = Rope.Concat(r1, Rope.Concat(r2, r3)); 73Rope c2 = Rope.Concat(Rope.Concat(r1, r2), r3); 79Rope c3 = Rope.ForString(s); 92Assert.Throws<ArgumentNullException>(() => { Rope.ForString(null); }); 98foreach (var r in someRopes) 100Assert.Throws<ArgumentNullException>(() => { Rope.Concat(r, null); }); 101Assert.Throws<ArgumentNullException>(() => { Rope.Concat(null, r); }); 108var r = shortRopes.Aggregate(Rope.Concat); 121var r = Rope.ForString("x"); 128Rope r = Rope.ForString("x"); 129Rope all = r; 133r = Rope.Concat(r, r); 134all = Rope.Concat(all, r); 140var waferThinMint = Rope.ForString("y"); 141Assert.Throws<OverflowException>(() => Rope.Concat(all, waferThinMint)); 142Assert.Throws<OverflowException>(() => Rope.Concat(waferThinMint, all)); 143Assert.Throws<OverflowException>(() => Rope.Concat(all, all));
Microsoft.CodeAnalysis.VisualBasic (5)
Semantics\Operators.vb (5)
1517Dim leftValue As Rope = If(left.IsNothing, Rope.Empty, left.RopeValue) 1518Dim rightValue As Rope = If(right.IsNothing, Rope.Empty, right.RopeValue) 1527result = ConstantValue.CreateFromRope(Rope.Concat(leftValue, rightValue))