Skip to content

Commit 6dfe5b7

Browse files
committed
Merge branch 'topic/new_java_formatter' into 'master'
Introduce prettier as Java formatter Closes #184 See merge request eng/libadalang/langkit-query-language!396
2 parents e058486 + d753caa commit 6dfe5b7

File tree

172 files changed

+3649
-2747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+3649
-2747
lines changed

lkql_jit/benchmarks/src/test/java/com/adacore/lkql_jit/BenchmarksMain.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/** Entry point for the LKQL benchmarks. */
99
public class BenchmarksMain {
10+
1011
public static void main(String[] args) throws Exception {
1112
org.openjdk.jmh.Main.main(args);
1213
}

lkql_jit/benchmarks/src/test/java/com/adacore/lkql_jit/benchmarks/FibonacciBenchmark.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,30 @@ public class FibonacciBenchmark extends TruffleBenchmark {
2121

2222
/** The fibonacci function in LKQL */
2323
private static final String lkqlFibo =
24-
"""
24+
"""
2525
fun fibo(n) =
2626
if n <= 0
2727
then 0
2828
else if n == 1
2929
then 1
3030
else fibo(n-1) + fibo(n-2)
3131
fibo(%d)
32-
"""
33-
.formatted(term);
32+
""".formatted(term);
3433

3534
/** The fibonacci function in JS */
3635
private static final String jsFibo =
37-
"""
36+
"""
3837
function fibo(n) {
3938
if (n == 0) return 0;
4039
else if (n == 1) return 1;
4140
return fibo(n-1) + fibo(n-2);
4241
}
4342
fibo(%d)
44-
"""
45-
.formatted(term);
43+
""".formatted(term);
4644

4745
/** The fibonacci function in SimpleLanguage */
4846
private static final String slFibo =
49-
"""
47+
"""
5048
function fibo(n) {
5149
if (n < 2) {
5250
return 1;
@@ -56,8 +54,7 @@ function fibo(n) {
5654
function main() {
5755
fibo(%d);
5856
}
59-
"""
60-
.formatted(term);
57+
""".formatted(term);
6158

6259
/** Java recursive fibonacci implementation. */
6360
private static int javaFibo(int n) {

lkql_jit/benchmarks/src/test/java/com/adacore/lkql_jit/benchmarks/ListComprehensionBenchmark.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ public class ListComprehensionBenchmark extends TruffleBenchmark {
3030

3131
/** The source for the LKQL list comprehension value. */
3232
private static final String lkqlSource =
33-
"""
34-
val generator = [%s]
35-
val result = [x * 2 for x in generator].to_list
36-
""";
33+
"""
34+
val generator = [%s]
35+
val result = [x * 2 for x in generator].to_list
36+
""";
3737

3838
/** The fibonacci function in JS */
3939
private static final String jsSource =
40-
"""
41-
var generator = [%s];
42-
var result = generator.map(x => x * 2);
43-
""";
40+
"""
41+
var generator = [%s];
42+
var result = generator.map(x => x * 2);
43+
""";
4444

4545
/** Java recursive fibonacci implementation. */
4646
private void javaListComp() {
@@ -55,9 +55,10 @@ public void setup() {
5555
for (int i = 0; i < size; i++) {
5656
this.generator[i] = i;
5757
}
58-
final String generatorLiteral =
59-
String.join(
60-
",\n", Arrays.stream(this.generator).mapToObj(Integer::toString).toList());
58+
final String generatorLiteral = String.join(
59+
",\n",
60+
Arrays.stream(this.generator).mapToObj(Integer::toString).toList()
61+
);
6162
this.lkqlListComp = lkqlSource.formatted(generatorLiteral);
6263
this.jsListComp = jsSource.formatted(generatorLiteral);
6364
}

lkql_jit/builtins_annotations/src/main/java/com/adacore/lkql_jit/annotations/BuiltInFunction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515
@Target(ElementType.TYPE)
1616
public @interface BuiltInFunction {
17-
1817
/** Name for this built-in function */
1918
String name();
2019

lkql_jit/builtins_annotations/src/main/java/com/adacore/lkql_jit/annotations/BuiltInMethod.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
@Target(ElementType.TYPE)
1515
public @interface BuiltInMethod {
16-
1716
/** Name for this built-in method. */
1817
String name() default "";
1918

0 commit comments

Comments
 (0)