@@ -198,6 +198,72 @@ struct CodedAt: PeerMacro {
198
198
}
199
199
}
200
200
201
+ /// Attribute type for `DecodedAt` macro-attribute.
202
+ ///
203
+ /// This type can validate`DecodedAt` macro-attribute
204
+ /// usage and extract data for `Codable` macro to
205
+ /// generate implementation.
206
+ struct DecodedAt : PeerMacro {
207
+ /// Provide metadata to `Codable` macro for final expansion
208
+ /// and verify proper usage of this macro.
209
+ ///
210
+ /// This macro doesn't perform any expansion rather `Codable` macro
211
+ /// uses when performing expansion.
212
+ ///
213
+ /// This macro verifies that macro usage condition is met by attached
214
+ /// declaration by using the `validate` implementation provided.
215
+ ///
216
+ /// - Parameters:
217
+ /// - node: The attribute describing this macro.
218
+ /// - declaration: The declaration this macro attribute is attached to.
219
+ /// - context: The context in which to perform the macro expansion.
220
+ ///
221
+ /// - Returns: No declaration is returned, only attached declaration is
222
+ /// analyzed.
223
+ static func expansion(
224
+ of node: AttributeSyntax ,
225
+ providingPeersOf declaration: some DeclSyntaxProtocol ,
226
+ in context: some MacroExpansionContext
227
+ ) throws -> [ DeclSyntax ] {
228
+ return try PluginCore . DecodedAt. expansion (
229
+ of: node, providingPeersOf: declaration, in: context
230
+ )
231
+ }
232
+ }
233
+
234
+ /// Attribute type for `EncodedAt` macro-attribute.
235
+ ///
236
+ /// This type can validate `EncodedAt` macro-attribute
237
+ /// usage and extract data for `Codable` macro to
238
+ /// generate implementation.
239
+ struct EncodedAt : PeerMacro {
240
+ /// Provide metadata to `Codable` macro for final expansion
241
+ /// and verify proper usage of this macro.
242
+ ///
243
+ /// This macro doesn't perform any expansion rather `Codable` macro
244
+ /// uses when performing expansion.
245
+ ///
246
+ /// This macro verifies that macro usage condition is met by attached
247
+ /// declaration by using the `validate` implementation provided.
248
+ ///
249
+ /// - Parameters:
250
+ /// - node: The attribute describing this macro.
251
+ /// - declaration: The declaration this macro attribute is attached to.
252
+ /// - context: The context in which to perform the macro expansion.
253
+ ///
254
+ /// - Returns: No declaration is returned, only attached declaration is
255
+ /// analyzed.
256
+ static func expansion(
257
+ of node: AttributeSyntax ,
258
+ providingPeersOf declaration: some DeclSyntaxProtocol ,
259
+ in context: some MacroExpansionContext
260
+ ) throws -> [ DeclSyntax ] {
261
+ return try PluginCore . EncodedAt. expansion (
262
+ of: node, providingPeersOf: declaration, in: context
263
+ )
264
+ }
265
+ }
266
+
201
267
/// Attribute type for `CodedIn` macro-attribute.
202
268
///
203
269
/// This type can validate`CodedIn` macro-attribute
0 commit comments