Skip to content

Commit b61c0e9

Browse files
committed
Add a macro lookup function
1 parent 2b092ab commit b61c0e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/_SwiftSyntaxMacros/MacroSystem.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public struct MacroSystem {
5252

5353
macros[macro.name] = macro
5454
}
55+
56+
/// Look for a macro with the given name.
57+
public func lookup(_ macroName: String) -> Macro.Type? {
58+
return macros[macroName]
59+
}
5560
}
5661

5762
/// Syntax rewriter that evaluates any macros encountered along the way.

0 commit comments

Comments
 (0)