-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow lines starting with a dot to fall outside previous indentation …
…widths If line following some indented code starts with a '`.`' and its indentation width is different from the indentation widths of the two neighboring regions by more than a single space, the line accepted even if it does not match a previous indentation width.
- Loading branch information
Showing
6 changed files
with
80 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- Error: tests/neg/outdent-dot.scala:6:5 ------------------------------------------------------------------------------ | ||
6 | .toString // error | ||
| ^ | ||
| The start of this line does not match any of the previous indentation widths. | ||
| Indentation width of current line : 5 spaces | ||
| This falls between previous widths: 2 spaces and 6 spaces | ||
-- Error: tests/neg/outdent-dot.scala:11:3 ----------------------------------------------------------------------------- | ||
11 | .filter: x => // error | ||
| ^ | ||
| The start of this line does not match any of the previous indentation widths. | ||
| Indentation width of current line : 3 spaces | ||
| This falls between previous widths: 2 spaces and 6 spaces | ||
-- Error: tests/neg/outdent-dot.scala:13:4 ----------------------------------------------------------------------------- | ||
13 | println("foo") // error | ||
| ^ | ||
| The start of this line does not match any of the previous indentation widths. | ||
| Indentation width of current line : 4 spaces | ||
| This falls between previous widths: 2 spaces and 6 spaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def Block(f: => Int): Int = f | ||
|
||
def bar(): String = | ||
Block: | ||
2 + 2 | ||
.toString // error | ||
|
||
def foo(xs: List[Int]) = | ||
xs.map: x => | ||
x + 1 | ||
.filter: x => // error | ||
x > 0 | ||
println("foo") // error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def Block(f: => Int): Int = f | ||
|
||
def bar(): String = | ||
Block: | ||
2 + 2 | ||
.toString | ||
|
||
def foo(xs: List[Int]) = | ||
xs.map: x => | ||
x + 1 | ||
.filter: x => | ||
x > 0 | ||
println("foo") |