Skip to content

Commit

Permalink
Remove cexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed May 20, 2020
1 parent de666c9 commit 73013e1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 57 deletions.
26 changes: 0 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ shlex = "0.1"

[dependencies]
bitflags = "1.0.3"
cexpr = "0.4"
cfg-if = "0.1.0"
# This kinda sucks: https://github.com/rust-lang/cargo/issues/1982
clap = { version = "2", optional = true }
Expand Down
30 changes: 0 additions & 30 deletions src/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


use crate::ir::context::BindgenContext;
use cexpr;
use clang_sys::*;
use regex;
use std::ffi::{CStr, CString};
Expand Down Expand Up @@ -696,35 +695,6 @@ impl Cursor {
RawTokens::new(self)
}

/// Gets the tokens that correspond to that cursor as `cexpr` tokens.
pub fn cexpr_tokens(self) -> Vec<cexpr::token::Token> {
use cexpr::token;

self.tokens()
.iter()
.filter_map(|token| {
let kind = match token.kind {
CXToken_Punctuation => token::Kind::Punctuation,
CXToken_Literal => token::Kind::Literal,
CXToken_Identifier => token::Kind::Identifier,
CXToken_Keyword => token::Kind::Keyword,
// NB: cexpr is not too happy about comments inside
// expressions, so we strip them down here.
CXToken_Comment => return None,
_ => {
error!("Found unexpected token kind: {:?}", token);
return None;
}
};

Some(token::Token {
kind,
raw: token.spelling().to_vec().into_boxed_slice(),
})
})
.collect()
}

/// Gets the tokens that correspond to that cursor as `rcc` tokens.
pub fn rcc_tokens<'a>(self) -> Vec<rcc::Locatable<rcc::Token>> {
use rcc::{Files, Lexer};
Expand Down

0 comments on commit 73013e1

Please sign in to comment.