Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-6476 Accept backslash at end of interpolation
Everyone wants to say `raw"\hello, world.\"`. Parser accepts arbitrary escaped quotes optionally followed by a quote. That is, an escaped quote is deemed to terminate the interpolated string if it is not followed by another quote on the same line.
- Loading branch information
Showing
6 changed files
with
42 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
t5510.scala:2: error: unclosed string literal (\" is an escaped quote, not the end of string) | ||
val sa = s"x\"y | ||
^ | ||
t5510.scala:3: error: unclosed string literal (\" is an escaped quote, not the end of string) | ||
t5510.scala:5: error: unclosed string literal (\" is an escaped quote, not the end of string) | ||
val sb = "x\"y | ||
^ | ||
t5510.scala:4: error: unclosed string literal | ||
t5510.scala:6: error: unclosed string literal | ||
val s1 = s"xxx | ||
^ | ||
t5510.scala:5: error: unclosed string literal | ||
t5510.scala:7: error: unclosed string literal | ||
val s2 = s"xxx $x | ||
^ | ||
t5510.scala:6: error: unclosed string literal | ||
t5510.scala:8: error: unclosed string literal | ||
val s3 = s"xxx $$ | ||
^ | ||
t5510.scala:7: error: unclosed string literal | ||
t5510.scala:9: error: unclosed string literal | ||
val s4 = ""s" | ||
^ | ||
t5510.scala:8: error: unclosed multi-line string literal | ||
t5510.scala:10: error: unclosed multi-line string literal | ||
val s5 = ""s""" $s1 $s2 s" | ||
^ | ||
t5510.scala:9: error: unclosed multi-line string literal | ||
t5510.scala:11: error: unclosed multi-line string literal | ||
} | ||
^ | ||
8 errors found | ||
7 errors found |
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,4 @@ | ||
t6476.scala:2: error: value y is not a member of String | ||
val sa = s"x\"y | ||
^ | ||
one error found |
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,3 @@ | ||
trait TypeErrors { | ||
val sa = s"x\"y | ||
} |
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