Function rustc_expand::mbe::macro_check::check_nested_macro
source · fn check_nested_macro(
sess: &ParseSess,
node_id: NodeId,
macro_rules: bool,
tts: &[TokenTree],
macros: &Stack<'_, MacroState<'_>>,
valid: &mut bool
) -> usize
Expand description
Checks the body of nested macro, returns where the check stopped, and sets valid
to false in
case of errors.
The token trees are checked as long as they look like a list of (LHS) => {RHS} token trees. This
check is a best-effort to detect a macro definition. It returns the position in tts
where we
stopped checking because we detected we were not in a macro definition anymore.
Arguments:
sess
is used to emit diagnostics and lintsnode_id
is used to emit lintsmacro_rules
specifies whether the macro ismacro_rules
tts
is checked as a list of (LHS) => {RHS}macros
is the stack of outer macrosvalid
is set in case of errors