Add proper test for literals and fixed typo bug

This commit is contained in:
Edwin Cheng 2019-04-05 20:58:24 +08:00
parent 1ea0238e53
commit 7abc06bd57
3 changed files with 51 additions and 5 deletions

View file

@ -217,7 +217,7 @@ fn scan_literal_suffix(ptr: &mut Ptr) {
pub fn classify_literal(text: &str) -> Option<Token> {
let tkn = next_token(text);
if tkn.kind.is_literal() || tkn.len.to_usize() != text.len() {
if !tkn.kind.is_literal() || tkn.len.to_usize() != text.len() {
return None;
}