[Macros] Update the name and argument list for the function body macro

that wraps a function or closure body in a new top-level task.
This commit is contained in:
Holly Borla
2025-03-20 09:29:21 -07:00
parent be670da373
commit bac0a10ae2
9 changed files with 318 additions and 207 deletions

View File

@@ -43,4 +43,17 @@ extension ImplicitlyUnwrappedOptionalTypeSyntax {
trailingTrivia: self.trailingTrivia
)
}
}
}
extension LabeledExprListSyntax {
/// Retrieve the first element with the given label.
func first(labeled name: String) -> Element? {
return first { element in
if let label = element.label, label.text == name {
return true
}
return false
}
}
}