Skip to content

Conversation

@joefarebrother
Copy link
Contributor

Resolves #4286

Adds synthetic nodes that contain one or more LocalVariableDeclExprs to hold them along with their corresponding TypeAccess. The type access is not made a child of the LocalVariableDeclExprs since one type access can be shared by multiple LocalVariableDeclExpr.
LocalVariableDeclStmt is excluded from this as a synthetic node there would serve no purpose.

The synthetic node added for the initialisers of a ForStmt is slightly different as the initialisers are not necassarily LocalVariableDecExprs; but can also be Assignments.

@joefarebrother joefarebrother requested review from a team and aeisenberg September 24, 2020 13:51
@github-actions github-actions bot added the Java label Sep 24, 2020
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly good to me. Only comment is that it seems like you're missing tests for instanceof expressions and enhanced for statements.

Also, please make sure to have someone on the java language team review this as well since I'm not really familiar with this code.

@aschackmull
Copy link
Contributor

Only comment is that it seems like you're missing tests for instanceof expressions and enhanced for statements.

Adding such tests would indeed be good.

Add tests for `EnhcancedForStmt`s and `InstanceOfExpr`s.
Rename LocalVarDeclParent to SingleLocalVarDeclParent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java: Add TypeAccess as a child of LocalVariableDeclExpr in Print AST Query

3 participants