33import csharp
44
55private string modifyMethodName ( ) {
6- result = "Add" or
7- result = "AddFirst" or
8- result = "AddLast" or
9- result = "Clear" or
10- result = "Enqueue" or
11- result = "ExceptWith" or
12- result = "Insert" or
13- result = "IntersectWith" or
14- result = "Push" or
15- result = "Remove" or
16- result = "RemoveAt" or
17- result = "RemoveFirst" or
18- result = "RemoveLast" or
19- result = "Set" or
20- result = "SetAll" or
21- result = "SymmetricExceptWith" or
22- result = "UnionWith"
6+ result =
7+ [
8+ "Add" , "AddFirst" , "AddLast" , "Clear" , "Enqueue" , "ExceptWith" , "Insert" , "IntersectWith" ,
9+ "Push" , "Remove" , "RemoveAt" , "RemoveFirst" , "RemoveLast" , "Set" , "SetAll" ,
10+ "SymmetricExceptWith" , "UnionWith"
11+ ]
2312}
2413
2514/** A method call that modifies a collection. */
@@ -39,45 +28,27 @@ class CollectionModificationAccess extends Access {
3928}
4029
4130private string collectionTypeName ( ) {
42- result = "ArrayList" or
43- result = "BitArray" or
44- result = "Hashtable" or
45- result = "ICollection" or
46- result = "IDictionary" or
47- result = "IList" or
48- result = "Queue" or
49- result = "ReadOnlyCollectionBase" or
50- result = "SortedList" or
51- result = "Stack"
31+ result =
32+ [
33+ "ArrayList" , "BitArray" , "Hashtable" , "ICollection" , "IDictionary" , "IList" , "Queue" ,
34+ "ReadOnlyCollectionBase" , "SortedList" , "Stack"
35+ ]
5236}
5337
54- private string collectionNamespaceName ( ) {
55- result = "Mono.Collections" or
56- result = "System.Collections"
57- }
38+ private string collectionNamespaceName ( ) { result = [ "Mono.Collections" , "System.Collections" ] }
5839
5940private string genericCollectionNamespaceName ( ) {
60- result = "Mono.Collections.Generic" or
61- result = "System.Collections.Generic"
41+ result = [ "Mono.Collections.Generic" , "System.Collections.Generic" ]
6242}
6343
6444private string genericCollectionTypeName ( ) {
65- result = "Dictionary<,>" or
66- result = "HashSet<>" or
67- result = "ICollection<>" or
68- result = "IDictionary<,>" or
69- result = "IList<>" or
70- result = "ISet<>" or
71- result = "LinkedList<>" or
72- result = "List<>" or
73- result = "Queue<>" or
74- result = "SortedDictionary<,>" or
75- result = "SortedList<,>" or
76- result = "SortedSet<>" or
77- result = "Stack<>" or
78- result = "SynchronizedCollection<>" or
79- result = "SynchronizedKeyedCollection<>" or
80- result = "SynchronizedReadOnlyCollection<>"
45+ result =
46+ [
47+ "Dictionary<,>" , "HashSet<>" , "ICollection<>" , "IDictionary<,>" , "IList<>" , "ISet<>" ,
48+ "LinkedList<>" , "List<>" , "Queue<>" , "SortedDictionary<,>" , "SortedList<,>" , "SortedSet<>" ,
49+ "Stack<>" , "SynchronizedCollection<>" , "SynchronizedKeyedCollection<>" ,
50+ "SynchronizedReadOnlyCollection<>"
51+ ]
8152}
8253
8354/** A collection type. */
@@ -105,36 +76,18 @@ class EmptyCollectionCreation extends ObjectCreation {
10576}
10677
10778private string readonlyMethodName ( ) {
108- result = "BinarySearch" or
109- result = "Clone" or
110- result = "Contains" or
111- result = "ContainsKey" or
112- result = "ContainsValue" or
113- result = "CopyTo" or
114- result = "Equals" or
115- result = "FixedArray" or
116- result = "FixedSize" or
117- result = "Get" or
118- result = "GetEnumerator" or
119- result = "GetHashCode" or
120- result = "GetRange" or
121- result = "IndexOf" or
122- result = "IsProperSubsetOf" or
123- result = "IsProperSupersetOf" or
124- result = "IsSubsetOf" or
125- result = "IsSupersetOf" or
126- result = "LastIndexOf" or
127- result = "MemberwiseClone" or
128- result = "Peek" or
129- result = "ToArray" or
130- result = "ToString" or
131- result = "TryGetValue"
79+ result =
80+ [
81+ "BinarySearch" , "Clone" , "Contains" , "ContainsKey" , "ContainsValue" , "CopyTo" , "Equals" ,
82+ "FixedArray" , "FixedSize" , "Get" , "GetEnumerator" , "GetHashCode" , "GetRange" , "IndexOf" ,
83+ "IsProperSubsetOf" , "IsProperSupersetOf" , "IsSubsetOf" , "IsSupersetOf" , "LastIndexOf" ,
84+ "MemberwiseClone" , "Peek" , "ToArray" , "ToString" , "TryGetValue"
85+ ]
13286}
13387
13488private string noAddMethodName ( ) {
13589 result = readonlyMethodName ( ) or
136- result = "Dequeue" or
137- result = "Pop"
90+ result = [ "Dequeue" , "Pop" ]
13891}
13992
14093/** Holds if `a` is an access that does not modify a collection. */
0 commit comments