Skip to content

Commit 515a74f

Browse files
committed
Allow trailing commas in lists
See also #115, and the comment there that goes with this commit: #115 (comment)
1 parent ad8ce13 commit 515a74f

14 files changed

+107
-12
lines changed

regression-tests/pure2-bugfix-for-parameter-decl-list-error.cpp2

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
f: (a, b, ) a + b;
2+
3+
g: <T, U, > (a: T, b: U) a + b;
4+
5+
doubler: (a: int,) -> (i : int,) = {
6+
i = a * 2;
7+
}
8+
9+
vals: @struct type = { i: int; }
10+
11+
main: () -> int = {
12+
(copy a := 42,) while false { a++; }
13+
_ = g(1, 2,);
14+
15+
grouping: std::vector = (0, 1, 2,);
16+
17+
array: std::array = (0, 1, 2,);
18+
19+
_ = array;
20+
_ = grouping;
21+
}

regression-tests/test-results/clang-12/pure2-trailing-commas.cpp.execution

Whitespace-only changes.

regression-tests/test-results/clang-12/pure2-trailing-commas.cpp.output

Whitespace-only changes.

regression-tests/test-results/gcc-10/pure2-trailing-commas.cpp.execution

Whitespace-only changes.

regression-tests/test-results/gcc-10/pure2-trailing-commas.cpp.output

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-trailing-commas.cpp.execution

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-trailing-commas.cpp.output

Whitespace-only changes.

regression-tests/test-results/msvc-2022/pure2-trailing-commas.cpp.execution

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pure2-trailing-commas.cpp

0 commit comments

Comments
 (0)