Commit 937891b
committed
Normalize line ending to
This matches the specification of multi-line string literal handling:
From https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure/#String-Literals:
> Line breaks in a multiline string literal are normalized to use the line feed character. Even if your source file has a mix of carriage returns and line feeds, all of the line breaks in the string will be the same.
From https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170417/035923.html:
> The quoted string should normalize newlines to \n in the value of the literal, regardless of whether the source file uses \n (Unix), \r\n (Windows), or \r (classic Mac) line endings. Likewise, when the compiler strips the initial and final newline from the literal value, it will strip one of any of the \n, \r\n, or \r line-ending sequences from both ends of the literal.\n in StringLiteralExprSyntax.representedLiteralValue
1 parent e3ea968 commit 937891b
File tree
1 file changed
+4
-0
lines changed- Sources/SwiftParser
1 file changed
+4
-0
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
| |||
0 commit comments