Skip to content

Commit 72dd6a8

Browse files
committed
Inline cexpr_tokens completely
1 parent e8b32d0 commit 72dd6a8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/clang.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -696,14 +696,6 @@ impl Cursor {
696696
RawTokens::new(self)
697697
}
698698

699-
/// Gets the tokens that correspond to that cursor as `cexpr` tokens.
700-
pub fn cexpr_tokens(self) -> Vec<cexpr::token::Token> {
701-
self.tokens()
702-
.iter()
703-
.filter_map(|token| token.as_cexpr_token())
704-
.collect()
705-
}
706-
707699
/// Obtain the real path name of a cursor of InclusionDirective kind.
708700
///
709701
/// Returns None if the cursor does not include a file, otherwise the file's full name

src/ir/var.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,11 @@ fn parse_int_literal_tokens(cursor: &clang::Cursor) -> Option<i64> {
405405
use cexpr::expr;
406406
use cexpr::expr::EvalResult;
407407

408-
let cexpr_tokens = cursor.cexpr_tokens();
408+
let cexpr_tokens: Vec<_> = cursor
409+
.tokens()
410+
.iter()
411+
.filter_map(|t| t.as_cexpr_token())
412+
.collect();
409413

410414
// TODO(emilio): We can try to parse other kinds of literals.
411415
match expr::expr(&cexpr_tokens) {

0 commit comments

Comments
 (0)