Lexer: byte strings sufixes

This commit is contained in:
Aleksey Kladov 2017-12-31 14:10:18 +03:00
parent 2f24fb4f2c
commit b704eb708f
3 changed files with 14 additions and 2 deletions

View File

@ -123,7 +123,11 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind {
scan_literal_suffix(ptr); scan_literal_suffix(ptr);
CHAR CHAR
}, },
'b' => return scan_byte_char_or_string(ptr), 'b' => {
let kind = scan_byte_char_or_string(ptr);
scan_literal_suffix(ptr);
return kind
},
_ => (), _ => (),
} }
ERROR ERROR

View File

@ -1 +1,2 @@
b'' b'x' b"foo" br"" b'' b'x' b"foo" br""
b''suf b""ix br""br

View File

@ -5,3 +5,10 @@ WHITESPACE 1 " "
BYTE_STRING 6 "b\"foo\"" BYTE_STRING 6 "b\"foo\""
WHITESPACE 1 " " WHITESPACE 1 " "
RAW_BYTE_STRING 4 "br\"\"" RAW_BYTE_STRING 4 "br\"\""
WHITESPACE 1 "\n"
BYTE 6 "b\'\'suf"
WHITESPACE 1 " "
BYTE_STRING 5 "b\"\"ix"
WHITESPACE 1 " "
RAW_BYTE_STRING 6 "br\"\"br"
WHITESPACE 1 "\n"