You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/other-new-features/indentation.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Scala 3 enforces some rules on indentation and allows some occurrences of braces
9
9
- Second, some occurrences of braces `{...}` are made optional. Generally, the rule
10
10
is that adding a pair of optional braces will not change the meaning of a well-indented program.
11
11
12
-
These changes can be turned off with the compiler flag `-noindent`.
12
+
These changes can be turned off with the compiler flag `-no-indent`.
13
13
14
14
### Indentation Rules
15
15
@@ -28,7 +28,7 @@ The compiler enforces two rules for well-indented programs, flagging violations
28
28
println("done") // error: indented too far to the left
29
29
```
30
30
31
-
2. If significant indentation is turned off (i.e. under Scala2 mode or under `-noindent`) and we are at the start of an indented sub-part of an expression, and the indented part ends in a newline, the next statement must start at an indentation width less than the sub-part. This prevents errors where an opening brace was forgotten, asin
31
+
2. If significant indentation is turned off (i.e. under Scala2 mode or under `-no-indent`) and we are at the start of an indented sub-part of an expression, and the indented part ends in a newline, the next statement must start at an indentation width less than the sub-part. This prevents errors where an opening brace was forgotten, asin
32
32
33
33
```scala
34
34
if (x <0)
@@ -379,13 +379,13 @@ end IndentWidth
379
379
380
380
###Settings and Rewrites
381
381
382
-
Significant indentation is enabled by default. It can be turned off by giving any of the options `-noindent`, `old-syntax` and `language:Scala2`. If indentation is turned off, it is nevertheless checked that indentation conforms to the logical program structure asdefined by braces. If that is not the case, the compiler issues a warning.
382
+
Significant indentation is enabled by default. It can be turned off by giving any of the options `-no-indent`, `old-syntax` and `language:Scala2`. If indentation is turned off, it is nevertheless checked that indentation conforms to the logical program structure asdefined by braces. If that is not the case, the compiler issues a warning.
383
383
384
384
TheScala3 compiler can rewrite source code to indented code and back.
385
385
When invoked with options `-rewrite -indent` it will rewrite braces to
386
-
indented regions where possible. When invoked with options `-rewrite -noindent` it will rewrite in the reverse direction, inserting braces for indentation regions.
386
+
indented regions where possible. When invoked with options `-rewrite -no-indent` it will rewrite in the reverse direction, inserting braces for indentation regions.
387
387
The `-indent` option only works on [new-style syntax](./control-syntax.md). So to go from old-style syntax to new-style indented code one has to invoke the compiler twice, first with options `-rewrite -new-syntax`, then again with options
388
-
`-rewrite -indent`. To go in the opposite direction, from indented code to old-style syntax, it's `-rewrite -noindent`, followed by `-rewrite -old-syntax`.
388
+
`-rewrite -indent`. To go in the opposite direction, from indented code to old-style syntax, it's `-rewrite -no-indent`, followed by `-rewrite -old-syntax`.
0 commit comments