Skip to content

Commit 3bde66a

Browse files
committed
Pretty-print 'var' statements
1 parent 07d2ce7 commit 3bde66a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

java/ql/lib/semmle/code/java/PrettyPrintAst.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ private class PpAssertStmt extends PpAst, AssertStmt {
929929

930930
private class PpLocalVariableDeclStmt extends PpAst, LocalVariableDeclStmt {
931931
override string getPart(int i) {
932+
i = 0 and not exists(this.getAVariable().getTypeAccess()) and result = "var"
933+
or
932934
i = 1 and result = " "
933935
or
934936
exists(int v | v > 1 and i = 2 * v - 1 and result = ", " and v = this.getAVariableIndex())

0 commit comments

Comments
 (0)