Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disregard unrecognized clang AST node kind contents #233

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions physx-sys/pxbind/src/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ pub enum Item {
TypedefDecl(Typedef),
/// The deprecated declspec has been defined on the item (PX_DEPRECATED)
DeprecatedAttr,
FullComment,
/// We don't care about other items
Other {
kind: Option<clang_ast::Kind>,
name: Option<String>,
},
Other,
}

impl fmt::Display for Item {
Expand Down Expand Up @@ -392,15 +390,10 @@ impl<'ast> AstConsumer<'ast> {

/// Walks the AST of a node and attempts to retrieve a comment for it
fn get_comment(node: &Node) -> Option<Comment<'_>> {
let full_comment = node.inner.iter().find(|inner| {
matches!(
inner.kind,
Item::Other {
kind: Some(clang_ast::Kind::FullComment),
name: _,
}
)
})?;
let full_comment = node
.inner
.iter()
.find(|inner| matches!(inner.kind, Item::FullComment))?;

fn gather<'ast>(
node: &'ast Node,
Expand Down
Loading