Add a comment explaing rust_lib

This commit is contained in:
Ryan Hunt
2017-04-04 14:04:19 -04:00
committed by staktrace
parent 93b3a257d1
commit 6787a93fa2
+9
View File
@@ -4,6 +4,15 @@ use std::path::PathBuf;
use syn;
/*
* Recursively parses a rust library starting at the root crate's directory.
*
* Inside a crate, `mod` and `extern crate` declarations are followed
* and parsed. To find an external crate, the parser looks in the
* parent directory of the root crate. This could be improved
* to read the crate's Cargo.toml to find the crate, but it works well
* enough to find the crates that matter for creating bindings.
*/
pub fn parse<F>(crate_dir: String,
items_callback: &F)
where F: Fn(String, &Vec<syn::Item>)