C#: Report IndexerProperty as Property in the PrintAST query

This commit is contained in:
Tamas Vajk
2021-02-01 10:08:51 +01:00
parent aa35fcafeb
commit 1b6cb340d3
9 changed files with 23 additions and 25 deletions

View File

@@ -566,6 +566,4 @@ class IndexerProperty extends Property {
// ```
result.getIndexer() = i
}
override string getAPrimaryQlClass() { result = "IndexerProperty" }
}

View File

@@ -240,7 +240,7 @@ arguments.cs:
# 72| 0: [TypeMention] Attribute
# 74| 4: [Field] x
# 74| -1: [TypeMention] int
# 75| 5: [IndexerProperty] y
# 75| 5: [Property] y
# 75| -1: [TypeMention] string
# 75| 3: [Getter] get_y
# 75| 4: [Setter] set_y

View File

@@ -150,7 +150,7 @@ attributes.cs:
# 62| 0: [TypeMention] Attribute
# 64| 4: [Field] x
# 64| -1: [TypeMention] int
# 65| 5: [IndexerProperty] y
# 65| 5: [Property] y
# 65| -1: [TypeMention] string
# 65| 3: [Getter] get_y
# 65| 4: [Setter] set_y

View File

@@ -141,7 +141,7 @@ csharp6.cs:
# 57| -1: [TypeMention] Dictionary<Int32, String>
# 57| 1: [TypeMention] int
# 57| 2: [TypeMention] string
# 58| 6: [IndexerProperty] DictionaryProperty
# 58| 6: [Property] DictionaryProperty
# 58| -1: [TypeMention] Dictionary<Int32, String>
# 58| 1: [TypeMention] int
# 58| 2: [TypeMention] string

View File

@@ -74,10 +74,10 @@ AsyncStreams.cs:
# 42| 1: [TypeMention] bool
DefaultInterfaceMethods.cs:
# 3| [Interface] IPerson
# 5| 4: [IndexerProperty] Name
# 5| 4: [Property] Name
# 5| -1: [TypeMention] string
# 5| 3: [Getter] get_Name
# 7| 5: [IndexerProperty] Greeting
# 7| 5: [Property] Greeting
# 7| -1: [TypeMention] string
# 9| 3: [Getter] get_Greeting
# 9| 4: [StringLiteral] "Hello"
@@ -95,7 +95,7 @@ DefaultInterfaceMethods.cs:
# 13| 0: [PropertyCall] access to property Greeting
# 13| 1: [StringLiteral] " "
# 13| 1: [ParameterAccess] access to parameter name
# 15| 7: [IndexerProperty] GreetingString
# 15| 7: [Property] GreetingString
# 15| -1: [TypeMention] string
# 15| 3: [Getter] get_GreetingString
# 15| 4: [MethodCall] call to method Greet
@@ -105,11 +105,11 @@ DefaultInterfaceMethods.cs:
# 20| [Class] Person
#-----| 3: (Base types)
# 20| 1: [TypeMention] IPerson
# 22| 5: [IndexerProperty] Name
# 22| 5: [Property] Name
# 22| -1: [TypeMention] string
# 22| 3: [Getter] get_Name
# 22| 4: [StringLiteral] "Petra"
# 24| 6: [IndexerProperty] Greeting
# 24| 6: [Property] Greeting
# 24| -1: [TypeMention] IPerson
# 24| -1: [TypeMention] string
# 24| 3: [Getter] get_Greeting
@@ -141,11 +141,11 @@ NullableRefTypes.cs:
# 9| -1: [TypeMention] MyClass
# 10| 6: [Field] B
# 10| -1: [TypeMention] MyClass
# 13| 7: [IndexerProperty] C
# 13| 7: [Property] C
# 13| -1: [TypeMention] MyClass
# 13| 3: [Getter] get_C
# 13| 4: [NullLiteral] null
# 14| 8: [IndexerProperty] D
# 14| 8: [Property] D
# 14| -1: [TypeMention] MyClass
# 14| 3: [Getter] get_D
# 14| 4: [ThisAccess] this access
@@ -417,7 +417,7 @@ NullableRefTypes.cs:
# 110| 0: [NullLiteral] null
# 112| 12: [Field] Property
# 112| -1: [TypeMention] MyClass
# 113| 13: [IndexerProperty] RefProperty
# 113| 13: [Property] RefProperty
# 113| -1: [TypeMention] MyClass
# 113| 3: [Getter] get_RefProperty
# 113| 4: [RefExpr] ref ...
@@ -502,7 +502,7 @@ NullableRefTypes.cs:
# 154| [Class] DisabledNullability
# 156| 5: [Field] f1
# 156| -1: [TypeMention] MyClass
# 157| 6: [IndexerProperty] P
# 157| 6: [Property] P
# 157| -1: [TypeMention] MyClass
# 157| 3: [Getter] get_P
# 157| 4: [ObjectCreation] object creation of type MyClass

View File

@@ -599,7 +599,7 @@ expressions.cs:
# 64| 0: [PropertyCall] access to property Length
# 64| -1: [ParameterAccess] access to parameter s
# 64| 1: [ParameterAccess] access to parameter x
# 67| 14: [IndexerProperty] Name
# 67| 14: [Property] Name
# 67| -1: [TypeMention] string
# 69| 3: [Getter] get_Name
# 69| 4: [BlockStmt] {...}
@@ -1504,7 +1504,7 @@ expressions.cs:
# 375| 1: [ObjectCreation] object creation of type List<String>
# 375| 0: [TypeMention] List<String>
# 375| 1: [TypeMention] string
# 377| 7: [IndexerProperty] Name
# 377| 7: [Property] Name
# 377| -1: [TypeMention] string
# 377| 3: [Getter] get_Name
# 377| 4: [BlockStmt] {...}
@@ -1518,7 +1518,7 @@ expressions.cs:
# 377| 0: [AssignExpr] ... = ...
# 377| 0: [FieldAccess] access to field name
# 377| 1: [ParameterAccess] access to parameter value
# 378| 8: [IndexerProperty] PhoneNumbers
# 378| 8: [Property] PhoneNumbers
# 378| -1: [TypeMention] List<String>
# 378| 1: [TypeMention] string
# 378| 3: [Getter] get_PhoneNumbers

View File

@@ -289,7 +289,7 @@ generics.cs:
# 33| 9: [Method] staticFoo
# 33| -1: [TypeMention] Void
# 33| 4: [BlockStmt] {...}
# 35| 10: [IndexerProperty] Name
# 35| 10: [Property] Name
# 35| -1: [TypeMention] string
# 35| 3: [Getter] get_Name
# 35| 4: [BlockStmt] {...}

View File

@@ -34,7 +34,7 @@ Members.cs:
# 14| 4: [BlockStmt] {...}
# 16| 7: [Field] Field
# 16| -1: [TypeMention] string
# 18| 8: [IndexerProperty] Prop
# 18| 8: [Property] Prop
# 18| -1: [TypeMention] string
# 18| 3: [Getter] get_Prop
# 18| 4: [Setter] set_Prop
@@ -68,7 +68,7 @@ Members.cs:
# 26| 4: [BlockStmt] {...}
# 28| 8: [Field] Field
# 28| -1: [TypeMention] string
# 30| 9: [IndexerProperty] Prop
# 30| 9: [Property] Prop
# 30| -1: [TypeMention] string
# 30| 3: [Getter] get_Prop
# 30| 4: [Setter] set_Prop
@@ -110,7 +110,7 @@ Members.cs:
# 40| 4: [BlockStmt] {...}
# 41| 7: [Field] Field
# 41| -1: [TypeMention] string
# 42| 8: [IndexerProperty] Prop
# 42| 8: [Property] Prop
# 42| -1: [TypeMention] string
# 42| 3: [Getter] get_Prop
# 42| 4: [Setter] set_Prop
@@ -144,7 +144,7 @@ Members.cs:
# 47| 4: [BlockStmt] {...}
# 48| 8: [Field] Field
# 48| -1: [TypeMention] string
# 49| 9: [IndexerProperty] Prop
# 49| 9: [Property] Prop
# 49| -1: [TypeMention] string
# 49| 3: [Getter] get_Prop
# 49| 4: [Setter] set_Prop
@@ -173,7 +173,7 @@ Members.cs:
#-----| 2: (Parameters)
# 57| 0: [Parameter] i
# 57| 1: [Parameter] value
# 58| 6: [IndexerProperty] Prop
# 58| 6: [Property] Prop
# 58| -1: [TypeMention] string
# 58| 3: [Getter] get_Prop
# 58| 4: [Setter] set_Prop
@@ -202,7 +202,7 @@ Members.cs:
#-----| 2: (Parameters)
# 65| 0: [Parameter] i
# 65| 1: [Parameter] value
# 66| 6: [IndexerProperty] Prop
# 66| 6: [Property] Prop
# 66| -1: [TypeMention] string
# 66| 3: [Getter] get_Prop
# 66| 4: [Setter] set_Prop

View File

@@ -3,7 +3,7 @@ properties.cs:
# 7| 1: [Class] Button
# 10| 5: [Field] caption
# 10| -1: [TypeMention] string
# 12| 6: [IndexerProperty] Caption
# 12| 6: [Property] Caption
# 12| -1: [TypeMention] string
# 15| 3: [Getter] get_Caption
# 15| 4: [BlockStmt] {...}