support literal suffixes

This commit is contained in:
Aleksey Kladov 2018-12-27 15:03:18 +03:00
parent 73ded3c63c
commit 359e70d1b2
7 changed files with 40 additions and 2 deletions

View file

@ -93,6 +93,7 @@ pub enum SyntaxErrorKind {
OverlongUnicodeEscape,
UnicodeEscapeOutOfRange,
UnclosedString,
InvalidSuffix,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@ -134,6 +135,7 @@ impl fmt::Display for SyntaxErrorKind {
}
UnicodeEscapeOutOfRange => write!(f, "Unicode escape code should be at most 0x10FFFF"),
UnclosedString => write!(f, "Unclosed string literal"),
InvalidSuffix => write!(f, "Invalid literal suffix"),
ParseError(msg) => write!(f, "{}", msg.0),
}
}