Rename range to by_kind

This commit is contained in:
Edwin Cheng 2019-12-18 11:36:10 +08:00
parent e16f3a5ee2
commit 2ea1cfd780
3 changed files with 4 additions and 4 deletions

View file

@ -19,7 +19,7 @@ pub enum TokenTextRange {
}
impl TokenTextRange {
pub fn range(self, kind: SyntaxKind) -> Option<TextRange> {
pub fn by_kind(self, kind: SyntaxKind) -> Option<TextRange> {
match self {
TokenTextRange::Token(it) => Some(it),
TokenTextRange::Delimiter(open, close) => match kind {

View file

@ -102,7 +102,7 @@ macro_rules! foobar {
let (expansion, (token_map, content)) = expand_and_map(&rules, "foobar!(baz);");
let get_text = |id, kind| -> String {
content[token_map.range_by_token(id).unwrap().range(kind).unwrap()].to_string()
content[token_map.range_by_token(id).unwrap().by_kind(kind).unwrap()].to_string()
};
assert_eq!(expansion.token_trees.len(), 4);