Skip to content

Commit cf2b9f7

Browse files
committed
Revert "Introduce extent to ClangToken"
This reverts commit c462892. This turned out not to be used, and causes trouble with rust-lang#1740.
1 parent a1a0043 commit cf2b9f7

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/clang.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -797,16 +797,13 @@ impl<'a> Drop for RawTokens<'a> {
797797
}
798798
}
799799

800-
/// A raw clang token, that exposes only kind, spelling, and extent. This is a
800+
/// A raw clang token, that exposes only the kind and spelling. This is a
801801
/// slightly more convenient version of `CXToken` which owns the spelling
802-
/// string and extent.
802+
/// string.
803803
#[derive(Debug)]
804804
pub struct ClangToken {
805805
spelling: CXString,
806-
/// The extent of the token. This is the same as the relevant member from
807-
/// `CXToken`.
808-
pub extent: CXSourceRange,
809-
/// The kind of the token. This is the same as the relevant member from
806+
/// The kind of token, this is the same as the relevant member from
810807
/// `CXToken`.
811808
pub kind: CXTokenKind,
812809
}
@@ -865,12 +862,7 @@ impl<'a> Iterator for ClangTokenIterator<'a> {
865862
unsafe {
866863
let kind = clang_getTokenKind(*raw);
867864
let spelling = clang_getTokenSpelling(self.tu, *raw);
868-
let extent = clang_getTokenExtent(self.tu, *raw);
869-
Some(ClangToken {
870-
kind,
871-
extent,
872-
spelling,
873-
})
865+
Some(ClangToken { kind, spelling })
874866
}
875867
}
876868
}

0 commit comments

Comments
 (0)