diff --git a/crates/libsyntax2/src/lexer/strings.rs b/crates/libsyntax2/src/lexer/strings.rs index fbae767e56..795ea97b7b 100644 --- a/crates/libsyntax2/src/lexer/strings.rs +++ b/crates/libsyntax2/src/lexer/strings.rs @@ -15,14 +15,23 @@ pub(crate) fn is_string_literal_start(c: char, c1: Option, c2: Option SyntaxKind { @@ -111,8 +120,3 @@ fn scan_raw_byte_string(ptr: &mut Ptr) { } } } - -fn scan_char_or_byte(ptr: &mut Ptr) { - //FIXME: deal with escape sequencies - ptr.bump(); -} diff --git a/crates/libsyntax2/tests/data/lexer/0006_chars.rs b/crates/libsyntax2/tests/data/lexer/0006_chars.rs index 03598d9082..454ee0a5f6 100644 --- a/crates/libsyntax2/tests/data/lexer/0006_chars.rs +++ b/crates/libsyntax2/tests/data/lexer/0006_chars.rs @@ -1 +1 @@ -'x' ' ' '0' +'x' ' ' '0' 'hello' '\x7f' '\n' '\\' '\'' diff --git a/crates/libsyntax2/tests/data/lexer/0006_chars.txt b/crates/libsyntax2/tests/data/lexer/0006_chars.txt index ecaf223552..950954fbc8 100644 --- a/crates/libsyntax2/tests/data/lexer/0006_chars.txt +++ b/crates/libsyntax2/tests/data/lexer/0006_chars.txt @@ -3,4 +3,14 @@ WHITESPACE 1 " " CHAR 3 "\' \'" WHITESPACE 1 " " CHAR 3 "\'0\'" +WHITESPACE 1 " " +CHAR 7 "\'hello\'" +WHITESPACE 1 " " +CHAR 6 "\'\\x7f\'" +WHITESPACE 1 " " +CHAR 4 "\'\\n\'" +WHITESPACE 1 " " +CHAR 4 "\'\\\\\'" +WHITESPACE 1 " " +CHAR 4 "\'\\\'\'" WHITESPACE 1 "\n"