Add classify_literal and undo expose next_token

This commit is contained in:
Edwin Cheng 2019-04-05 18:45:19 +08:00
parent 1ab78d6056
commit 1ea0238e53
5 changed files with 15 additions and 8 deletions

View file

@ -343,16 +343,14 @@ SOURCE_FILE@[0; 40)
if let tt::TokenTree::Subtree(subtree) = tt {
return &subtree;
}
assert!(false, "It is not a subtree");
unreachable!();
unreachable!("It is not a subtree");
}
fn to_literal(tt: &tt::TokenTree) -> &tt::Literal {
if let tt::TokenTree::Leaf(tt::Leaf::Literal(lit)) = tt {
return lit;
}
assert!(false, "It is not a literal");
unreachable!();
unreachable!("It is not a literal");
}
let rules = create_rules(