Reputation: 6595
The lexer/parser file located here is quite large and I'm not sure if it is suitable for just retrieving a list of Rust functions. Perhaps writing my own/using another library would be a better route to take?
The end objective would be to create a kind of execution manager. To contextualise, it would be able to read a list of function calls wrapped in a function. The function calls that are within the function will then be able to be re/ordered from some web interface. Thought it might be nice to manage larger applications this way.
Upvotes: 1
Views: 356
Reputation: 59045
No. I mean, not really. Whether you write your own parser or re-use syntex
, you're going to hit a fundamental limitation: macros.
So let's say you go all-out and expand macro_rules!
-based macros, including the ones defined in external crates (which means you'll also need to extract rustc
's crate metadata loading... which isn't stable). What about procedural macros and custom derive attributes? Those are defined in code and depend on compiler-internal interfaces to function.
The only way this is likely to ever work correctly is if you build on top of the compiler, or duplicate a huge amount of work (which also involves unstable binary interfaces).
Upvotes: 4