Skip to content

Commit

Permalink
Revert "Introduce extent to ClangToken"
Browse files Browse the repository at this point in the history
This reverts commit c462892.

This turned out not to be used, and causes trouble with rust-lang#1740.
  • Loading branch information
kulp committed Jul 22, 2022
1 parent 105b942 commit 2a247bf
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,16 +797,13 @@ impl<'a> Drop for RawTokens<'a> {
}
}

/// A raw clang token, that exposes only kind, spelling, and extent. This is a
/// A raw clang token, that exposes only the kind and spelling. This is a
/// slightly more convenient version of `CXToken` which owns the spelling
/// string and extent.
/// string.
#[derive(Debug)]
pub struct ClangToken {
spelling: CXString,
/// The extent of the token. This is the same as the relevant member from
/// `CXToken`.
pub extent: CXSourceRange,
/// The kind of the token. This is the same as the relevant member from
/// The kind of token, this is the same as the relevant member from
/// `CXToken`.
pub kind: CXTokenKind,
}
Expand Down Expand Up @@ -865,12 +862,7 @@ impl<'a> Iterator for ClangTokenIterator<'a> {
unsafe {
let kind = clang_getTokenKind(*raw);
let spelling = clang_getTokenSpelling(self.tu, *raw);
let extent = clang_getTokenExtent(self.tu, *raw);
Some(ClangToken {
kind,
extent,
spelling,
})
Some(ClangToken { kind, spelling })
}
}
}
Expand Down

0 comments on commit 2a247bf

Please sign in to comment.