File tree 1 file changed +29
-0
lines changed 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,21 @@ pub fn parse_lib_pp(
335
335
}
336
336
}
337
337
338
+ /// Extracts the first matching variant from an iterator of `RefNode` values.
339
+ ///
340
+ /// This macro takes an iterator (`$n`) and a list of `RefNode` variant types (`$ty`),
341
+ /// returning the first occurrence of any specified variant as `Some(RefNode::<$ty>)`.
342
+ /// If no matching variant is found, it returns `None`.
343
+ ///
344
+ /// # Arguments
345
+ ///
346
+ /// - `$n`: An iterator over `RefNode` values.
347
+ /// - `$ty`: One or more `RefNode` variant names to search for.
348
+ ///
349
+ /// # Returns
350
+ ///
351
+ /// - `Some(RefNode::<$ty>)` if a matching variant is found.
352
+ /// - `None` if no matching variant is found.
338
353
#[ macro_export]
339
354
macro_rules! unwrap_node {
340
355
( $n: expr, $( $ty: tt ) ,+) => { {
@@ -351,6 +366,20 @@ macro_rules! unwrap_node {
351
366
} } ;
352
367
}
353
368
369
+ /// Extracts the first `Locate` variant from an iterator of `RefNode`.
370
+ ///
371
+ /// This macro takes an expression that evaluates to an iterable collection
372
+ /// of `RefNode` elements and returns the first `Locate` variant found,
373
+ /// if any. If no `Locate` variant is found, it returns `None`.
374
+ ///
375
+ /// # Arguments
376
+ ///
377
+ /// * `$n:expr` - An expression yielding an iterator over `RefNode` values.
378
+ ///
379
+ /// # Returns
380
+ ///
381
+ /// * `Option<Locate>` - The first `Locate` variant found in the iterator, or `None` if none exist.
382
+ ///
354
383
#[ macro_export]
355
384
macro_rules! unwrap_locate {
356
385
( $n: expr) => { {
You can’t perform that action at this time.
0 commit comments