Implement SE-0200 (extended escaping in string literals)

Supports string literals like #"foo"\n"bar"#.
This commit is contained in:
John Holdsworth
2018-09-06 23:19:52 +01:00
committed by Brent Royal-Gordon
parent 5e2b705f6d
commit 4da8cbe655
9 changed files with 357 additions and 79 deletions

View File

@@ -0,0 +1,14 @@
// RUN: %target-typecheck-verify-swift
#"\##("invalid")"#
// expected-error@-1{{too many '#' characters in delimited escape}}
// expected-error@-2{{invalid escape sequence in literal}}
####"invalid"###
// expected-error@-1{{unterminated string literal}}
###"invalid"####
// expected-error@-1{{too many '#' characters in closing delimiter}}
// expected-error@-2{{consecutive statements on a line must be separated by ';'}}
// expected-error@-3{{expected expression}}
// expected-warning@-4{{string literal is unused}}