Expose read-only AST Node traversal API and internal classifiers#11
Expose read-only AST Node traversal API and internal classifiers#11sewerynplazuk wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| var isMacroExpandion: Bool { | ||
| public var isMacroExpansion: Bool { |
|
Thanks for the follow-up to #9, @sewerynplazuk — and nice catch on the One concern before merging: exposing classifiers like What if we exposed the goal directly instead? public extension String {
/// The nominal type or module that owns the demangled symbol.
var nominalOwner: SymbolOwner? { get }
}Internally it would reuse your classifiers but keep them Two questions to size this right:
The |
This PR enables downstream tools to traverse the demangled AST to find the nominal owners of symbols. Currently, they have to manually duplicate compiler logic to guess what constitutes a "context" or "function attribute," which may break between Swift releases.
The changes are straightforward and don't add any new logic or maintenance burden to upstream. Please let me know if this is acceptable, as it does enforce some sort of public contract.