Skip to content

Commit ad5eb6c

Browse files
documentation: fix tokens that can start indentation region (#17219)
## What: The documentation currently states: ``` * The following tokens can start an indentation region: * * : = => <- if then else while do try catch finally for yield match ``` This is not actually true, however, if you look at the source of the predicate which determines which tokens can start an indentation region: https://github.com/lampepfl/dotty/blob/865aa639c98e0a8771366b3ebc9580cc8b61bfeb/compiler/src/dotty/tools/dotc/parsing/Tokens.scala#L276 In particular, if I'm not mistaken, `return`, `throw`, and `with` are all also tokens which have this property. This PR just amends the documentation to reflect that.
2 parents 7187e22 + 4c9bdf0 commit ad5eb6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ object Scanners {
523523
*
524524
* The following tokens can start an indentation region:
525525
*
526-
* : = => <- if then else while do try catch finally for yield match
526+
* : = => <- if then else while do try catch
527+
* finally for yield match throw return with
527528
*
528529
* Inserting an INDENT starts a new indentation region with the indentation of the current
529530
* token as indentation width.

0 commit comments

Comments
 (0)