I am working on a procedural macro. It takes a TokenStream, parses it into a syn AST, converts it into another syn AST, and finally parses it back to a TokenStream. I was wondering whether there is a way to infer types of variables at this level. I haven't found anything in the syn library yet, but I guess that makes sense because syn is about syntax.
Essentially, I want to track all the integers and bools in my syn AST. I'm currently thinking of writing some recursive thing that would probably be based on some type inferencing algorithm, but it feels like I''ll be reinventing the wheel.
If there is some library out there, it would be great if you could let me know. Any advice on going about the type inference mechanism would also be nice.