8000 Java: Replace MethodAccess, LValue, RValue with more intuitive names. Introduce NewClassExpr. by smowton · Pull Request #14575 · github/codeql · GitHub
[go: up one dir, main page]

Skip to content

Java: Replace MethodAccess, LValue, RValue with more intuitive names. Introduce NewClassExpr. #14575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test expectations
  • Loading branch information
smowton committed Oct 24, 2023
commit b849a66c9767347cee2ecef9a9ee44cd80cfb85d
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def.kt:
# 46| 0: [TypeAccess] Annot0k
# 46| 5: [BlockStmt] { ... }
# 47| 0: [ExprStmt] <Expr>;
# 47| 0: [MethodAccess] println(...)
# 47| 0: [MethodCall] println(...)
# 47| -1: [TypeAccess] ConsoleKt
# 47| 0: [MethodAccess] a(...)
# 47| 0: [MethodCall] a(...)
# 47| -1: [VarAccess] a
# 50| 1: [LocalVariableDeclStmt] var ...;
# 50| 1: [LocalVariableDeclExpr] x
Expand Down
48 changes: 24 additions & 24 deletions java/ql/test/kotlin/library-tests/classes/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ classes.kt:
# 28| 3: [TypeAccess] Unit
# 28| 5: [BlockStmt] { ... }
# 28| 0: [ReturnStmt] return ...
# 28| 0: [MethodAccess] funIF1(...)
# 28| 0: [MethodCall] funIF1(...)
# 28| -1: [SuperAccess] IF1.super
# 28| 0: [TypeAccess] IF1
# 28| 3: [Method] funIF2
# 28| 3: [TypeAccess] Unit
# 28| 5: [BlockStmt] { ... }
# 28| 0: [ReturnStmt] return ...
# 28| 0: [MethodAccess] funIF2(...)
# 28| 0: [MethodCall] funIF2(...)
# 28| -1: [SuperAccess] IF2.super
# 28| 0: [TypeAccess] IF2
# 29| 4: [Constructor] ClassSix
Expand All @@ -136,18 +136,18 @@ classes.kt:
# 35| 0: [SuperConstructorInvocationStmt] super(...)
# 35| 1: [BlockStmt] { ... }
# 39| 0: [ExprStmt] <Expr>;
# 39| 0: [MethodAccess] f(...)
# 39| 0: [MethodCall] f(...)
# 39| -1: [TypeAccess] ClassesKt
# 39| 0: [StringLiteral] "init1"
# 42| 1: [ExprStmt] <Expr>;
# 42| 0: [KtInitializerAssignExpr] ...=...
# 42| 0: [VarAccess] x
# 45| 2: [ExprStmt] <Expr>;
# 45| 0: [MethodAccess] f(...)
# 45| 0: [MethodCall] f(...)
# 45| -1: [TypeAccess] ClassesKt
# 45| 0: [StringLiteral] "init2"
# 36| 2: [ExprStmt] <Expr>;
# 36| 0: [MethodAccess] f(...)
# 36| 0: [MethodCall] f(...)
# 36| -1: [TypeAccess] ClassesKt
# 36| 0: [VarAccess] i
# 42| 2: [Method] getX
Expand Down Expand Up @@ -466,7 +466,7 @@ classes.kt:
# 112| 0: [TypeAccess] int
# 112| 5: [BlockStmt] { ... }
# 114| 1: [ExprStmt] <Expr>;
# 114| 0: [MethodAccess] foo(...)
# 114| 0: [MethodCall] foo(...)
# 114| -1: [ClassInstanceExpr] new Local1<Integer>(...)
# 114| -3: [TypeAccess] Local1<Integer>
# 114| 0: [TypeAccess] Integer
Expand Down Expand Up @@ -500,7 +500,7 @@ classes.kt:
# 120| 0: [TypeAccess] int
# 120| 5: [BlockStmt] { ... }
# 122| 1: [ExprStmt] <Expr>;
# 122| 0: [MethodAccess] foo(...)
# 122| 0: [MethodCall] foo(...)
# 122| -1: [ClassInstanceExpr] new Local2<Integer>(...)
# 122| -3: [TypeAccess] Local2<Integer>
# 122| 0: [TypeAccess] Integer
Expand Down Expand Up @@ -538,7 +538,7 @@ classes.kt:
# 130| 0: [TypeAccess] int
# 130| 5: [BlockStmt] { ... }
# 132| 1: [ExprStmt] <Expr>;
# 132| 0: [MethodAccess] foo(...)
< 57AE span class='blob-code-inner blob-code-marker ' data-code-marker="+"># 132| 0: [MethodCall] foo(...)
# 132| -1: [ClassInstanceExpr] new Local3<Integer>(...)
# 132| -3: [TypeAccess] Local3<Integer>
# 132| 0: [TypeAccess] Integer
Expand Down Expand Up @@ -616,7 +616,7 @@ generic_anonymous.kt:
# 11| 0: [TypeAccess] String
# 11| 5: [BlockStmt] { ... }
# 11| 0: [ReturnStmt] return ...
# 11| 0: [MethodAccess] get(...)
# 11| 0: [MethodCall] get(...)
# 11| -1: [ClassInstanceExpr] new Generic<String>(...)
# 11| -3: [TypeAccess] Generic<String>
# 11| 0: [TypeAccess] String
Expand All @@ -628,7 +628,7 @@ generic_anonymous.kt:
# 13| 0: [TypeAccess] int
# 13| 5: [BlockStmt] { ... }
# 13| 0: [ReturnStmt] return ...
# 13| 0: [MethodAccess] get(...)
# 13| 0: [MethodCall] get(...)
# 13| -1: [ClassInstanceExpr] new Generic<Integer>(...)
# 13| -3: [TypeAccess] Generic<Integer>
# 13| 0: [TypeAccess] Integer
Expand Down Expand Up @@ -674,7 +674,7 @@ generic_anonymous.kt B41A :
# 4| 0: [VarAccess] member
# 4| 2: [FieldDeclaration] T member;
# 4| -1: [TypeAccess] T
# 4| 0: [MethodAccess] getT(...)
# 4| 0: [MethodCall] getT(...)
# 4| -1: [ThisAccess] Generic.this
# 4| 0: [TypeAccess] Generic
# 4| 3: [Method] getMember
Expand All @@ -697,8 +697,8 @@ generic_anonymous.kt:
# 7| 3: [TypeAccess] T
# 7| 5: [BlockStmt] { ... }
# 7| 0: [ReturnStmt] return ...
# 7| 0: [MethodAccess] getMember(...)
# 7| -1: [MethodAccess] getX$private(...)
# 7| 0: [MethodCall] getMember(...)
# 7| -1: [MethodCall] getX$private(...)
# 7| -1: [ThisAccess] this
# 15| 4: [Class,GenericType,ParameterizedType] Outer
#-----| -2: (Generic Parameters)
Expand Down Expand Up @@ -753,14 +753,14 @@ generic_anonymous.kt:
# 26| 3: [TypeAccess] U2
# 26| 5: [BlockStmt] { ... }
# 26| 0: [ReturnStmt] return ...
# 26| 0: [MethodAccess] fn0(...)
# 26| 0: [MethodCall] fn0(...)
# 26| -1: [SuperAccess] C0.super
# 26| 0: [TypeAccess] C0
# 26| 3: [Method] fn1
# 26| 3: [TypeAccess] U3
# 26| 5: [BlockStmt] { ... }
# 26| 0: [ReturnStmt] return ...
# 26| 0: [MethodAccess] fn1(...)
# 26| 0: [MethodCall] fn1(...)
# 26| -1: [SuperAccess] C1.super
# 26| 0: [TypeAccess] C1
# 26| 1: [ExprStmt] <Expr>;
Expand All @@ -781,14 +781,14 @@ generic_anonymous.kt:
# 27| 3: [TypeAccess] U2
# 27| 5: [BlockStmt] { ... }
# 27| 0: [ReturnStmt] return ...
# 27| 0: [MethodAccess] fn0(...)
# 27| 0: [MethodCall] fn0(...)
# 27| -1: [SuperAccess] C0.super
# 27| 0: [TypeAccess] C0
# 27| 3: [Method] fn1
# 27| 3: [TypeAccess] U2
# 27| 5: [BlockStmt] { ... }
# 27| 0: [ReturnStmt] return ...
# 27| 0: [MethodAccess] fn1(...)
# 27| 0: [MethodCall] fn1(...)
# 27| -1: [SuperAccess] C1.super
# 27| 0: [TypeAccess] C1
# 27| 1: [ExprStmt] <Expr>;
Expand All @@ -809,14 +809,14 @@ generic_anonymous.kt:
# 28| 3: [TypeAccess] U2
# 28| 5: [BlockStmt] { ... }
# 28| 0: [ReturnStmt] return ...
# 28| 0: [MethodAccess] fn0(...)
# 28| 0: [MethodCall] fn0(...)
# 28| -1: [SuperAccess] C0.super
# 28| 0: [TypeAccess] C0
# 28| 3: [Method] fn1
# 28| 3: [TypeAccess] String
# 28| 5: [BlockStmt] { ... }
# 28| 0: [ReturnStmt] return ...
# 28| 0: [MethodAccess] fn1(...)
# 28| 0: [MethodCall] fn1(...)
# 28| -1: [SuperAccess] C1.super
# 28| 0: [TypeAccess] C1
# 28| 1: [ExprStmt] <Expr>;
Expand All @@ -837,7 +837,7 @@ generic_anonymous.kt:
# 29| 3: [TypeAccess] U2
# 29| 5: [BlockStmt] { ... }
# 29| 0: [ReturnStmt] return ...
# 29| 0: [MethodAccess] fn0(...)
# 29| 0: [MethodCall] fn0(...)
# 29| -1: [SuperAccess] C0.super
# 29| 0: [TypeAccess] C0
# 29| 1: [ExprStmt] <Expr>;
Expand All @@ -858,7 +858,7 @@ generic_anonymous.kt:
# 30| 3: [TypeAccess] String
# 30| 5: [BlockStmt] { ... }
# 30| 0: [ReturnStmt] return ...
# 30| 0: [MethodAccess] fn0(...)
# 30| 0: [MethodCall] fn0(...)
# 30| -1: [SuperAccess] C0.super
# 30| 0: [TypeAccess] C0
# 30| 1: [ExprStmt] <Expr>;
Expand Down Expand Up @@ -962,7 +962,7 @@ local_anonymous.kt:
# 11| 3: [TypeAccess] Unit
# 11| 5: [BlockStmt] { ... }
# 12| 1: [ExprStmt] <Expr>;
# 12| 0: [MethodAccess] fnLocal(...)
# 12| 0: [MethodCall] fnLocal(...)
# 12| -1: [ClassInstanceExpr] new (...)
# 12| -3: [TypeAccess] Object
# 15| 4: [Method] fn3
Expand Down Expand Up @@ -1030,7 +1030,7 @@ local_anonymous.kt:
# 21| 0: [Parameter] a0
# 21| 5: [BlockStmt] { ... }
# 21| 0: [ReturnStmt] return ...
# 21| 0: [MethodAccess] fn3(...)
# 21| 0: [MethodCall] fn3(...)
# 21| -1: [VarAccess] a0
# 21| -3: [TypeAccess] Function1<Class1,Unit>
# 21| 0: [TypeAccess] Class1
Expand Down Expand Up @@ -1092,7 +1092,7 @@ local_anonymous.kt:
# 33| 0: [WhenExpr] when ...
# 33| 0: [WhenBranch] ... -> ...
# 33| 0: [ValueEQExpr] ... (value equals) ...
# 33| 0: [MethodAccess] getX(...)
# 33| 0: [MethodCall] getX(...)
# 33| -1: [ThisAccess] this
# 33| 1: [IntegerLiteral] 1
# 33| 1: [ExprStmt] <Expr>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@
| Test.kt:40:4:40:6 | <Stmt> | StmtExpr | Test.kt:40:4:40:6 | { ... } | BlockStmt |
| Test.kt:40:4:40:6 | <implicit coercion to unit> | ImplicitCoercionToUnitExpr | Test.kt:38:9:38:9 | x | VarAccess |
| Test.kt:40:4:40:6 | Unit | TypeAccess | file://:0:0:0:0 | <none> | <none> |
| Test.kt:40:4:40:6 | dec(...) | MethodAccess | Test.kt:40:4:40:6 | ...=... | AssignExpr |
| Test.kt:40:4:40:6 | dec(...) | MethodCall | Test.kt:40:4:40:6 | ...=... | AssignExpr |
| Test.kt:40:4:40:6 | int tmp0 | LocalVariableDecl | file://:0:0:0:0 | <none> | <none> |
| Test.kt:40:4:40:6 | tmp0 | LocalVariableDeclExpr | Test.kt:40:4:40:4 | <Expr>; | ExprStmt |
| Test.kt:40:4:40:6 | tmp0 | VarAccess | Test.kt:40:4:40:6 | <implicit coercion to unit> | ImplicitCoercionToUnitExpr |
| Test.kt:40:4:40:6 | tmp0 | VarAccess | Test.kt:40:4:40:6 | dec(...) | MethodAccess |
| Test.kt:40:4:40:6 | tmp0 | VarAccess | Test.kt:40:4:40:6 | dec(...) | MethodCall |
| Test.kt:40:4:40:6 | var ...; | LocalVariableDeclStmt | Test.kt:40:4:40:4 | x | VarAccess |
| Test.kt:40:4:40:6 | { ... } | BlockStmt | Test.kt:40:4:40:6 | var ...; | LocalVariableDeclStmt |
| Test.kt:43:3:43:3 | <Expr>; | ExprStmt | Test.kt:43:7:43:8 | 30 | IntegerLiteral |
Expand Down Expand Up @@ -208,8 +208,8 @@
| Test.kt:105:20:107:5 | { ... } | BlockStmt | Test.kt:106:9:106:29 | <Expr>; | ExprStmt |
| Test.kt:106:9:106:29 | <Expr>; | ExprStmt | Test.kt:106:18:106:27 | "x not null" | StringLiteral |
| Test.kt:106:9:106:29 | ConsoleKt | TypeAccess | file://:0:0:0:0 | <none> | <none> |
| Test.kt:106:9:106:29 | println(...) | MethodAccess | Test.kt:100:1:110:1 | fn | Method |
| Test.kt:106:18:106:27 | "x not null" | StringLiteral | Test.kt:106:9:106:29 | println(...) | MethodAccess |
| Test.kt:106:9:106:29 | println(...) | MethodCall | Test.kt:100:1:110:1 | fn | Method |
| Test.kt:106:18:106:27 | "x not null" | StringLiteral | Test.kt:106:9:106:29 | println(...) | MethodCall |
| Test.kt:107:16:107:16 | y | VarAccess | Test.kt:107:21:107:24 | null | NullLiteral |
| Test.kt:107:16:107:24 | ... (value not-equals) ... | ValueNEExpr | Test.kt:100:1:110:1 | fn | Method |
| Test.kt:107:16:107:24 | ... (value not-equals) ... | ValueNEExpr | Test.kt:107:27:109:5 | { ... } | BlockStmt |
Expand All @@ -218,8 +218,8 @@
| Test.kt:107:27:109:5 | { ... } | BlockStmt | Test.kt:108:9:108:29 | <Expr>; | ExprStmt |
| Test.kt:108:9:108:29 | <Expr>; | ExprStmt | Test.kt:108:18:108:27 | "y not null" | StringLiteral |
| Test.kt:108:9:108:29 | ConsoleKt | TypeAccess | file://:0:0:0:0 | <none> | <none> |
| Test.kt:108:9:108:29 | println(...) | MethodAccess | Test.kt:100:1:110:1 | fn | Method |
| Test.kt:108:18:108:27 | "y not null" | StringLiteral | Test.kt:108:9:108:29 | println(...) | MethodAccess |
| Test.kt:108:9:108:29 | println(...) | MethodCall | Test.kt:100:1:110:1 | fn | Method |
| Test.kt:108:18:108:27 | "y not null" | StringLiteral | Test.kt:108:9:108:29 | println(...) | MethodCall |
| Test.kt:112:1:116:1 | Unit | TypeAccess | file://:0:0:0:0 | <none> | <none> |
| Test.kt:112:1:116:1 | fn | Method | file://:0:0:0:0 | <none> | <none> |
| Test.kt:112:8:112:17 | boolean | TypeAccess | file://:0:0:0:0 | <none> | <none> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dc.kt:
# 0| 1: [VarAccess] p0.strs
# 0| -1: [VarAccess] p0
# 0| 2: [ReturnStmt] return ...
# 0| 0: [MethodAccess] copy(...)
# 0| 0: [MethodCall] copy(...)
# 0| -1: [VarAccess] p0
# 0| 0: [VarAccess] p1
# 0| 1: [VarAccess] p2
Expand Down Expand Up @@ -123,7 +123,7 @@ dc.kt:
# 0| 5: [BlockStmt] { ... }
# 0| 0: [LocalVariableDeclStmt] var ...;
# 0| 1: [LocalVariableDeclExpr] result
# 0| 0: [MethodAccess] hashCode(...)
# 0| 0: [MethodCall] hashCode(...)
# 0| -1: [TypeAccess] Arrays
# 0| 0: [VarAccess] this.bytes
# 0| -1: [ThisAccess] this
Expand All @@ -134,7 +134,7 @@ dc.kt:
# 0| 0: [MulExpr] ... * ...
# 0| 0: [VarAccess] result
# 0| 1: [IntegerLiteral] 31
# 0| 1: [MethodAccess] hashCode(...)
# 0| 1: [MethodCall] hashCode(...)
# 0| -1: [TypeAccess] Arrays
# 0| 0: [VarAccess] this.strs
# 0| -1: [ThisAccess] this
Expand All @@ -147,13 +147,13 @@ dc.kt:
# 0| 0: [StringTemplateExpr] "..."
# 0| 0: [StringLiteral] "ProtoMapValue("
# 0| 1: [StringLiteral] "bytes="
# 0| 2: [MethodAccess] toString(...)
# 0| 2: [MethodCall] toString(...)
# 0| -1: [TypeAccess] Arrays
# 0| 0: [VarAccess] this.bytes
# 0| -1: [ThisAccess] this
# 0| 3: [StringLiteral] ", "
# 0| 4: [StringLiteral] "strs="
# 0| 5: [MethodAccess] toString(...)
# 0| 5: [MethodCall] toString(...)
# 0| -1: [TypeAccess] Arrays
# 0| 0: [VarAccess] this.strs
# 0| -1: [ThisAccess] this
Expand Down
Loading
0