Parser: allow multiple statements on the same line as the colon e.g. def foo(x, y): print(x); print(y) Bug found when adding the pass statement. -- MOS_MIGRATED_REVID=88852710
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java b/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java index 51da72c..b6741c4 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
@@ -756,6 +756,14 @@ } @Test + public void testDefSingleLine() throws Exception { + List<Statement> statements = parseFileForSkylark( + "def foo(): x = 1; y = 2\n"); + FunctionDefStatement stmt = (FunctionDefStatement) statements.get(0); + assertThat(stmt.getStatements()).hasSize(2); + } + + @Test public void testSkipIfBlock() throws Exception { // Skip over 'if' blocks, when parsePython is set List<Statement> stmts = parseFile(