This commit is contained in:
Aleksey Kladov 2019-09-22 23:46:27 +03:00
parent c12a713739
commit 66101e931c
4 changed files with 24 additions and 38 deletions

View file

@ -148,15 +148,7 @@ fn convert_ident(ident: &tt::Ident) -> TtToken {
}
fn convert_punct(p: tt::Punct) -> TtToken {
let kind = match p.char {
// lexer may produce compound tokens for these ones
'.' => T![.],
':' => T![:],
'=' => T![=],
'!' => T![!],
'-' => T![-],
c => SyntaxKind::from_char(c).unwrap(),
};
let kind = SyntaxKind::from_char(p.char).unwrap();
let text = {
let mut buf = [0u8; 4];
let s: &str = p.char.encode_utf8(&mut buf);