Implements "gaps" in string literals. These are escape sequences of the
form `"\" newline whitespace+` that have the interpretation of an empty
string. For example,
```
"this is \
a string"
```
is equivalent to `"this is a string"`. These are modeled after string
continuations in
[Rust](https://doc.rust-lang.org/beta/reference/tokens.html#string-literals).
Implements RFC #2838
20 lines
451 B
Text
20 lines
451 B
Text
"ab"
|
|
"ab"
|
|
"a b"
|
|
"a b"
|
|
"this is a string"
|
|
"this is a string"
|
|
"there are three spaces between the brackets < >"
|
|
"there are three spaces between the brackets < >"
|
|
"this is\n a string with two space indent"
|
|
"ab"
|
|
"ab"
|
|
"ab"
|
|
"ab"
|
|
"ab"
|
|
"ab"
|
|
|
|
string_gaps.lean:101:0-104:10: error: <input>:1:4: expecting newline after carriage return
|
|
|
|
string_gaps.lean:109:0-112:10: error: <input>:1:3: invalid escape sequence
|
|
"this is line 1\n line 2, indented\nline 3"
|