register_lints

Macro register_lints 

Source
macro_rules! register_lints {
    ( @declare_structs $( ($pass_id:ident, $pass_type:ident, ($($lint:expr),* $(,)?)) ),* $(,)? ) => { ... };
    ( @declare_consts $( ($pass_id:ident, $pass_type:ident, ($($lint:expr),* $(,)?)) ),* $(,)? ) => { ... };
    ( @declare_funcs $( ($pass_id:ident, $pass_type:ident, $lints:tt) ),* $(,)? ) => { ... };
    (@early_impl $_pass_id:ident, late) => { ... };
    (@early_impl $pass_id:ident, $other:ident) => { ... };
    (@late_impl $_pass_id:ident, early) => { ... };
    (@late_impl $pass_id:ident, $other:ident) => { ... };
    (@early_create $_pass_id:ident, late) => { ... };
    (@early_create $pass_id:ident, $_other:ident) => { ... };
    (@late_create $_pass_id:ident, early) => { ... };
    (@late_create $pass_id:ident, $_other:ident) => { ... };
    ( $($tokens:tt)* ) => { ... };
}
Expand description

Registers Solidity linter passes that can have both early and late variants.

§Parameters

Each pass is declared with:

  • $pass_id: Identifier of the generated struct that will implement the pass trait(s).
  • $pass_type: Either early, late, or both to indicate which traits to implement.
  • $lints: A parenthesized, comma-separated list of SolLint constants.

§Outputs

  • Structs for each linting pass
  • Helper methods to create early and late passes with required lifetimes
  • const REGISTERED_LINTS containing all registered lint objects