New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Preprocessing Wrappers #84
Add Preprocessing Wrappers #84
Conversation
sources/ClangSharp/Cursors/Cursor.cs
Outdated
@@ -80,6 +80,10 @@ internal static Cursor Create(CXCursor handle) | |||
{ | |||
result = Attr.Create(handle); | |||
} | |||
else if (handle.IsPreprocessing) | |||
{ | |||
result = Preprocessing.Create(handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I've tried to mirror the Clang C++ API structure where applicable.
In this case, it would be:
class PreprocessedEntity : Cursor { }
class MacroExpansion : PreprocessedEntity { }
class PreprocessingDirective : PreprocessedEntity { }
class InclusionDirective : PreprocessingDirective { }
class MacroDefinitionRecord : PreprocessingDirective { }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the C++ API gives a structured layout that closely mirrors the actual OOP API design and allows various bits of code to be shared where it makes sense due to the backing data the cursor handles represent
Overall LGTM. Just a nit about the layout of the types. |
@tannergooding Thank you for the review. |
Thanks! |
Added few wrapper classes to handle preprocessing cursors..