Skip to content

Commit

Permalink
Fix parsing of module-info require directives that are both `stat…
Browse files Browse the repository at this point in the history
…ic` and `transitive`

PiperOrigin-RevId: 673075838
  • Loading branch information
cushon authored and Javac Team committed Sep 10, 2024
1 parent 5bd2dfa commit e1ea3c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/com/google/turbine/parse/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@ private ModRequires moduleRequires() {
if (token == Token.IDENT && lexer.stringValue().equals("transitive")) {
next();
access.add(TurbineModifier.TRANSITIVE);
break;
continue;
}
if (token == Token.STATIC) {
next();
access.add(TurbineModifier.STATIC);
break;
continue;
}
break;
}
Expand Down
2 changes: 2 additions & 0 deletions javatests/com/google/turbine/lower/ModuleIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public static Iterable<Object[]> parameters() {
"classpath.test",
"multimodule.test",
"module-info-open.test",
"module-requires-static-transitive.test",
"module-requires-transitive-static.test",
};
return ImmutableList.copyOf(testCases).stream().map(x -> new Object[] {x}).collect(toList());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=== module-info.java ===

module foo {
requires static transitive java.base;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=== module-info.java ===

module foo {
requires transitive static java.base;
}

0 comments on commit e1ea3c5

Please sign in to comment.