Skip to content

Commit 728ba4e

Browse files
committed
[Macros] Adapt to rename of ExpressionMacro.expansion(of:in:).
1 parent b6df411 commit 728ba4e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/ASTGen/Sources/ASTGen/Macros.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func evaluateMacro(
147147
return ExprSyntax(parentExpansion)
148148
}
149149

150-
return exprMacro.expand(parentExpansion, in: &context)
150+
return exprMacro.expansion(of: parentExpansion, in: &context)
151151
}
152152

153153
// FIXME: Emit diagnostics accumulated in the

test/Macros/Inputs/syntax_macro_definitions.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ private func replaceFirstLabel(
1616
}
1717

1818
public struct ColorLiteralMacro: ExpressionMacro {
19-
public static func expand(
20-
_ macro: MacroExpansionExprSyntax, in context: inout MacroExpansionContext
19+
public static func expansion(
20+
of macro: MacroExpansionExprSyntax, in context: inout MacroExpansionContext
2121
) -> ExprSyntax {
2222
let argList = replaceFirstLabel(
2323
of: macro.argumentList, with: "_colorLiteralRed"
@@ -31,8 +31,8 @@ public struct ColorLiteralMacro: ExpressionMacro {
3131
}
3232

3333
public struct FileIDMacro: ExpressionMacro {
34-
public static func expand(
35-
_ macro: MacroExpansionExprSyntax, in context: inout MacroExpansionContext
34+
public static func expansion(
35+
of macro: MacroExpansionExprSyntax, in context: inout MacroExpansionContext
3636
) -> ExprSyntax {
3737
let fileLiteral: ExprSyntax = #""\#(context.moduleName)/\#(context.fileName)""#
3838
if let leadingTrivia = macro.leadingTrivia {
@@ -43,8 +43,8 @@ public struct FileIDMacro: ExpressionMacro {
4343
}
4444

4545
public struct StringifyMacro: ExpressionMacro {
46-
public static func expand(
47-
_ macro: MacroExpansionExprSyntax, in context: inout MacroExpansionContext
46+
public static func expansion(
47+
of macro: MacroExpansionExprSyntax, in context: inout MacroExpansionContext
4848
) -> ExprSyntax {
4949
guard let argument = macro.argumentList.first?.expression else {
5050
// FIXME: Create a diagnostic for the missing argument?

0 commit comments

Comments
 (0)