Commit 19132f1
authored
Current implementation does not work for the following code:
```cpp
main: () = {
:() = 1;
[[assert: 1]]
}
```
It fails with error:
```
error: subscript expression [ ] must not be empty (if you were trying to name a C-style array type, use 'std::array' instead) (at '[')
```
This change introduce small correction that moves back parsing
to semicolon (to simulate double semicolon) for short syntax.
It is not done in the following cases:
```cpp
:() = 1;(); // imediatelly called lambda
f(a,b,:() = 1;); // last argument in function call
f(a,:() = 1;,c); // first or in the middle argument
```
After this change the original issue is solved.
All regression tests pass. Closes #356
1 parent d7adb8f commit 19132f1
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3015 | 3015 | | |
3016 | 3016 | | |
3017 | 3017 | | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
3018 | 3029 | | |
3019 | 3030 | | |
3020 | 3031 | | |
| |||
0 commit comments