-
Notifications
You must be signed in to change notification settings - Fork 854
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve tabular arguments for mixed sign numeric lists.
Treats unary minus literals (eg -4.0) as their underlying type when checking if all elements in a tabular list are of the same Tree.Kind. Fixes #400, #406 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=303137504
- Loading branch information
1 parent
d6d0b4d
commit b810032
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...est/resources/com/google/googlejavaformat/java/testdata/TabularMixedSignInitializer.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
public class T { | ||
private static final double[] f = { | ||
95.0, 75.0, -95.0, 75.0, | ||
-95.0, 75.0, +95.0, 75.0 | ||
}; | ||
|
||
private static final int[] g = { | ||
x++, y, ++z, | ||
x, y, ~z, | ||
--x, ++y, z-- | ||
}; | ||
|
||
private static final bool[] h = { | ||
a, b, c, d, | ||
!e, a, b, c | ||
}; | ||
} |
17 changes: 17 additions & 0 deletions
17
...st/resources/com/google/googlejavaformat/java/testdata/TabularMixedSignInitializer.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
public class T { | ||
private static final double[] f = { | ||
95.0, 75.0, -95.0, 75.0, | ||
-95.0, 75.0, +95.0, 75.0 | ||
}; | ||
|
||
private static final int[] g = { | ||
x++, y, ++z, | ||
x, y, ~z, | ||
--x, ++y, z-- | ||
}; | ||
|
||
private static final bool[] h = { | ||
a, b, c, d, | ||
!e, a, b, c | ||
}; | ||
} |