Move newline handling down into parser.
This lets us make it a grammar feature and not a lexer trick. Newlines are explicitly ignored in some parts of the grammar. This lets, for example, things like "|" ignore the newline when used as an operator, but not when used as a parameter delimiter in a block argument.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
while // expect error
|
||||
(true) IO.print("bad")
|
||||
@@ -14,11 +14,3 @@ while (a < 3) {
|
||||
// expect: 0
|
||||
// expect: 1
|
||||
// expect: 2
|
||||
|
||||
// Newline after "while".
|
||||
var d = 0
|
||||
while
|
||||
(d < 3) IO.print(d = d + 1)
|
||||
// expect: 1
|
||||
// expect: 2
|
||||
// expect: 3
|
||||
|
||||
Reference in New Issue
Block a user