mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 18:34:03 +03:00
Convert dangling comma into unexpected expression (#5776)
Test and fix for #5691.
This commit is contained in:
parent
0536eeb0bb
commit
a150abbea8
@ -765,6 +765,9 @@ final class TreeToIr {
|
||||
items = cons(exp, items);
|
||||
for (var next : arr.getRest()) {
|
||||
exp = translateExpression(next.getBody(), false);
|
||||
if (exp == null) {
|
||||
yield translateSyntaxError(arr, IR$Error$Syntax$UnexpectedExpression$.MODULE$);
|
||||
}
|
||||
items = cons(exp, items);
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,13 @@ public class EnsoCompilerTest {
|
||||
""", true, true, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testListWithATrailingComma() throws Exception {
|
||||
parseTest("""
|
||||
main = ["a", ]
|
||||
""", true, true, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLocationsDeeplyNestedFunctions() throws Exception {
|
||||
parseTest("""
|
||||
|
Loading…
Reference in New Issue
Block a user