Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/asttools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub fn get_parent<'a>(node: &'a Node<'a>, level: usize) -> Option<Node<'a>> {
Some(node)
}

#[doc(hidden)]
#[macro_use]
macro_rules! has_ancestors {
($node:expr, $( $typs:pat )|*, $( $typ:pat ),+) => {{
Expand Down Expand Up @@ -55,7 +54,6 @@ macro_rules! has_ancestors {
}};
}

#[doc(hidden)]
#[macro_use]
macro_rules! count_specific_ancestors {
($node:expr, $( $typs:pat )|*, $( $stops:pat )|*) => {{
Expand Down
37 changes: 13 additions & 24 deletions src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_checker {
( $name:ident, $( $type:ident ),* ) => {
#[inline(always)]
Expand All @@ -14,8 +13,7 @@ macro_rules! mk_checker {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_else_if {
($if_type:ident) => {
#[inline(always)]
Expand All @@ -32,8 +30,7 @@ macro_rules! mk_else_if {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_extern {
( $( $name:ident ),* ) => {
$(
Expand All @@ -42,8 +39,7 @@ macro_rules! mk_extern {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_enum {
( $( $camel:ident, $description:expr ),* ) => {
/// The list of supported languages.
Expand All @@ -57,8 +53,7 @@ macro_rules! mk_enum {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_impl_lang {
( $( ($camel:ident, $name:ident, $display: expr) ),* ) => {
impl LANG {
Expand Down Expand Up @@ -94,8 +89,7 @@ macro_rules! mk_impl_lang {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_action {
( $( ($camel:ident, $parser:ident) ),* ) => {
/// Runs a function, which implements the [`Callback`] trait,
Expand Down Expand Up @@ -171,8 +165,7 @@ macro_rules! mk_action {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_extensions {
( $( ($camel:ident, [ $( $ext:ident ),* ]) ),* ) => {
/// Detects the language associated to the input file extension.
Expand All @@ -199,8 +192,7 @@ macro_rules! mk_extensions {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_emacs_mode {
( $( ($camel:ident, [ $( $emacs_mode:expr ),* ]) ),* ) => {
/// Detects the language associated to the input `Emacs` mode.
Expand Down Expand Up @@ -230,8 +222,7 @@ macro_rules! mk_emacs_mode {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_code {
( $( ($camel:ident, $code:ident, $parser:ident, $name:ident, $docname:expr) ),* ) => {
$(
Expand Down Expand Up @@ -262,8 +253,7 @@ macro_rules! mk_code {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! mk_langs {
( $( ($camel:ident, $description: expr, $display: expr, $code:ident, $parser:ident, $name:ident, [ $( $ext:ident ),* ], [ $( $emacs_mode:expr ),* ]) ),* ) => {
mk_extern!($( $name ),*);
Expand All @@ -276,8 +266,7 @@ macro_rules! mk_langs {
};
}

#[doc(hidden)]
#[macro_export]
#[macro_use]
macro_rules! color {
( $stdout: ident, $color: ident) => {
$stdout.set_color(ColorSpec::new().set_fg(Some(Color::$color)))?;
Expand All @@ -291,8 +280,8 @@ macro_rules! color {
};
}

#[doc(hidden)]
#[macro_export]
#[cfg(test)]
#[macro_use]
macro_rules! check_metrics {
($source: expr, $file: expr, $parser: ident, $metric: ident,
[ $( ( $func_int: ident, $true_int_value: expr $(,$type_int: ty)? )$(,)* )* ]$(,)*
Expand Down