Commit 81e057a
authored
No outdent at eof (#22435)
Fixes #22332
The reference does not mention `<eof>`. `<outdent>` insertion does not
require a particular next token, though some next tokens affect it (that
is, leading infix or tokens that close an indentation region). It does
require a "first token on the next line", for which we may take `<eof>`
as the lack of a token.
Of course, ordinary error messages say `eof`.
The same text with an opening brace is unchanged:
```
5 |
| ^
| '}' expected, but eof found
```1 parent 5fe57c2 commit 81e057a
File tree
2 files changed
+6
-0
lines changed- compiler/src/dotty/tools/dotc/parsing
- tests/pos
2 files changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments