- } else {
- let spacing = match conv.peek() {
- Some(next)
- if next.kind().is_trivia()
- || next.kind() == T!['[']
- || next.kind() == T!['{']
- || next.kind() == T!['('] =>
- {
- tt::Spacing::Alone
- }
- Some(next) if next.kind().is_punct() && next.kind() != UNDERSCORE => {
- tt::Spacing::Joint
- }
- _ => tt::Spacing::Alone,
- };
- let char = match token.to_char() {
- Some(c) => c,
- None => {
- panic!("Token from lexer must be single char: token = {:#?}", token);
- }
- };
- tt::Leaf::from(tt::Punct { char, spacing, id: conv.id_alloc().alloc(range) }).into()