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 Jun 17, 2022
1 parent 3988fce commit 64b5564
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 64b5564

Please sign in to comment.