In the following example, taken from nom
, the string __impl
appears in the first pattern. What is this element in terms of formal syntax and why is it there?
I'm under the impression that the literal __impl
in the pattern and the subsequent invocations are used as a dummy-string during pattern-matching, to separate the internally used patterns from the public ones. However, the "internal" match arm is hidden from rustdoc
as well. Does the __impl
-part have any more significance to Rust?
#[macro_export]
macro_rules! map(
// Internal parser, do not use directly
(__impl $i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => (
...
);
($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => (
map!(__impl $i, $submac!($($args)*), $g);
);
($i:expr, $f:expr, $g:expr) => (
map!(__impl $i, call!($f), $g);
);
);