syntax: Remove deprecated unicode escapes

These have been deprecated for quite some time, so we should be good to remove
them now.
This commit is contained in:
Alex Crichton
2015-03-06 13:57:44 -08:00
parent 1fe8f22145
commit 39e2c69541
8 changed files with 24 additions and 64 deletions

View File

@@ -777,13 +777,6 @@ impl<'a> StringReader<'a> {
}
}
fn old_escape_warning(&mut self, sp: Span) {
self.span_diagnostic
.span_warn(sp, "\\U00ABCD12 and \\uABCD escapes are deprecated");
self.span_diagnostic
.fileline_help(sp, "use \\u{ABCD12} escapes instead");
}
/// Scan for a single (possibly escaped) byte or char
/// in a byte, (non-raw) byte string, char, or (non-raw) string literal.
/// `start` is the position of `first_source_char`, which is already consumed.
@@ -803,21 +796,8 @@ impl<'a> StringReader<'a> {
return match e {
'n' | 'r' | 't' | '\\' | '\'' | '"' | '0' => true,
'x' => self.scan_byte_escape(delim, !ascii_only),
'u' if !ascii_only => {
if self.curr == Some('{') {
self.scan_unicode_escape(delim)
} else {
let res = self.scan_hex_digits(4, delim, false);
let sp = codemap::mk_sp(escaped_pos, self.last_pos);
self.old_escape_warning(sp);
res
}
}
'U' if !ascii_only => {
let res = self.scan_hex_digits(8, delim, false);
let sp = codemap::mk_sp(escaped_pos, self.last_pos);
self.old_escape_warning(sp);
res
'u' if self.curr_is('{') => {
self.scan_unicode_escape(delim)
}
'\n' if delim == '"' => {
self.consume_whitespace();