diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-02-18 19:58:27 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-02-19 10:54:04 +0100 |
commit | dd9f25e670d39917118a4ae60897c2d4365e471f (patch) | |
tree | 3c9353b20fa5c1263e4cde48af61a183b8b24e62 | |
parent | 18a7d3e014fc99bdd086feaf1498e8ad67b00c87 (diff) |
clang: Print the semantic parent when dumping the AST.
-rw-r--r-- | src/clang.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<S: AsRef<str>>(depth: isize, prefix: S, ty: &Type) { |