diff --git a/java/com/google/turbine/parse/Parser.java b/java/com/google/turbine/parse/Parser.java index 67c50241..7fed6666 100644 --- a/java/com/google/turbine/parse/Parser.java +++ b/java/com/google/turbine/parse/Parser.java @@ -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; } diff --git a/javatests/com/google/turbine/lower/ModuleIntegrationTest.java b/javatests/com/google/turbine/lower/ModuleIntegrationTest.java index 7cc7952e..a185781e 100644 --- a/javatests/com/google/turbine/lower/ModuleIntegrationTest.java +++ b/javatests/com/google/turbine/lower/ModuleIntegrationTest.java @@ -48,6 +48,8 @@ public static Iterable 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()); } diff --git a/javatests/com/google/turbine/lower/moduletestdata/module-requires-static-transitive.test b/javatests/com/google/turbine/lower/moduletestdata/module-requires-static-transitive.test new file mode 100644 index 00000000..84084dc1 --- /dev/null +++ b/javatests/com/google/turbine/lower/moduletestdata/module-requires-static-transitive.test @@ -0,0 +1,5 @@ +=== module-info.java === + +module foo { + requires static transitive java.base; +} \ No newline at end of file diff --git a/javatests/com/google/turbine/lower/moduletestdata/module-requires-transitive-static.test b/javatests/com/google/turbine/lower/moduletestdata/module-requires-transitive-static.test new file mode 100644 index 00000000..33c09118 --- /dev/null +++ b/javatests/com/google/turbine/lower/moduletestdata/module-requires-transitive-static.test @@ -0,0 +1,5 @@ +=== module-info.java === + +module foo { + requires transitive static java.base; +} \ No newline at end of file