I must be missing something. Using the code example in the readme on a small snippet of C++ code doesn't print anything, and trying on a larger code sample only prints a very small subset of the nodes in the AST. Here's the small chunk of C++ code I'm trying to parse:
ofPtr< ABTest > ABTest::create()
{
ofPtr< ABTest > create( new ABTest() );
create->init( create, ABTest::getValueStoreType() );
if (create->_this)
{
return create;
}
return ofPtr< ABTest >();
}
Here's the ruby code that's trying to parse it:
require 'ffi/clang'
include FFI::Clang
index = Index.new(false)
translation_unit = index.parse_translation_unit("/Users/cameron/Desktop/test.cpp")
cursor = translation_unit.cursor
cursor.visit_children do |cursor, parent|
puts "#{cursor.kind} #{cursor.spelling.inspect}"
next :recurse
end
This code prints nothing. Is it possible next :recurse isn't working for some reason? Thanks for your help :)
I must be missing something. Using the code example in the readme on a small snippet of C++ code doesn't print anything, and trying on a larger code sample only prints a very small subset of the nodes in the AST. Here's the small chunk of C++ code I'm trying to parse:
Here's the ruby code that's trying to parse it:
This code prints nothing. Is it possible
next :recurseisn't working for some reason? Thanks for your help :)