From dd9f25e670d39917118a4ae60897c2d4365e471f Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Sat, 18 Feb 2017 19:58:27 +0100 Subject: clang: Print the semantic parent when dumping the AST. --- src/clang.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/clang.rs b/src/clang.rs index 613e08e8..f752aaef 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -1498,6 +1498,13 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult { &specialized); } } + + if let Some(parent) = c.fallible_semantic_parent() { + println!(""); + print_cursor(depth, + String::from(prefix) + "semantic-parent.", + &parent); + } } fn print_type>(depth: isize, prefix: S, ty: &Type) { -- cgit v1.2.3