MochiLibraries / Biohazrd

A framework for automatically generating binding wrappers for C/C++ libraries
MIT License
60 stars 8 forks source link

Add namespace awareness to relevant transformations #137

Open PathogenDavid opened 3 years ago

PathogenDavid commented 3 years ago

Because namespaces weren't initially supported in Biohazrd, some of the built-in transformations don't handle them properly. For instance, MoveLooseDeclarationsIntoTypesTransformation effectively removes them from loose declarations.

PathogenDavid commented 3 years ago

One thing I've realized is that once DeduplicateNamesTransformation is namespace-aware, it is possible for name collisions to form when two namespaces with same-name types have using statements. Not sure if/how I want to handle that.

Edit: Going to consider this an unrelated issue to deal with when it comes up. (Might just add an optional output mode that fully-qualifies all translated type references. Won't be pretty, but it's likely the easiest fix for what is probably an unlikely situation.)