@@ -124,21 +124,26 @@ predicate sinkElement(Element e, string input, string kind) {
124
124
125
125
/** Gets the summary component for specification component `c`, if any. */
126
126
bindingset [ c]
127
- SummaryComponent interpretComponentSpecific ( string c ) {
127
+ SummaryComponent interpretComponentSpecific ( AccessPathToken c ) {
128
128
c = "Element" and result = SummaryComponent:: content ( any ( ElementContent ec ) )
129
129
or
130
+ // Qualified names may contain commas,such as in `Tuple<,>`, so get the entire argument list
131
+ // rather than an individual argument.
130
132
exists ( Field f |
131
- c .regexpCapture ( "Field\\[(.+)\\]" , 1 ) = f .getQualifiedName ( ) and
133
+ c .getName ( ) = "Field" and
134
+ c .getArgumentList ( ) = f .getQualifiedName ( ) and
132
135
result = SummaryComponent:: content ( any ( FieldContent fc | fc .getField ( ) = f ) )
133
136
)
134
137
or
135
138
exists ( Property p |
136
- c .regexpCapture ( "Property\\[(.+)\\]" , 1 ) = p .getQualifiedName ( ) and
139
+ c .getName ( ) = "Property" and
140
+ c .getArgumentList ( ) = p .getQualifiedName ( ) and
137
141
result = SummaryComponent:: content ( any ( PropertyContent pc | pc .getProperty ( ) = p ) )
138
142
)
139
143
or
140
144
exists ( SyntheticField f |
141
- c .regexpCapture ( "SyntheticField\\[(.+)\\]" , 1 ) = f and
145
+ c .getName ( ) = "SyntheticField" and
146
+ c .getArgumentList ( ) = f and
142
147
result = SummaryComponent:: content ( any ( SyntheticFieldContent sfc | sfc .getField ( ) = f ) )
143
148
)
144
149
}
@@ -253,21 +258,10 @@ predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode n) {
253
258
)
254
259
}
255
260
256
- bindingset [ s]
257
- private int parseIntegerPosition ( string s ) {
258
- result = s .regexpCapture ( "([0-9]+)" , 1 ) .toInt ( )
259
- or
260
- exists ( int n1 , int n2 |
261
- s .regexpCapture ( "([0-9]+)\\.\\.([0-9]+)" , 1 ) .toInt ( ) = n1 and
262
- s .regexpCapture ( "([0-9]+)\\.\\.([0-9]+)" , 2 ) .toInt ( ) = n2 and
263
- result in [ n1 .. n2 ]
264
- )
265
- }
266
-
267
261
/** Gets the argument position obtained by parsing `X` in `Parameter[X]`. */
268
262
bindingset [ s]
269
263
ArgumentPosition parseParamBody ( string s ) {
270
- result .getPosition ( ) = parseIntegerPosition ( s )
264
+ result .getPosition ( ) = AccessPath :: parseInt ( s )
271
265
or
272
266
s = "This" and
273
267
result .isQualifier ( )
@@ -276,7 +270,7 @@ ArgumentPosition parseParamBody(string s) {
276
270
/** Gets the parameter position obtained by parsing `X` in `Argument[X]`. */
277
271
bindingset [ s]
278
272
ParameterPosition parseArgBody ( string s ) {
279
- result .getPosition ( ) = parseIntegerPosition ( s )
273
+ result .getPosition ( ) = AccessPath :: parseInt ( s )
280
274
or
281
275
s = "Qualifier" and
282
276
result .isThisParameter ( )
0 commit comments