summary refs log tree commit diff
path: root/src/libsyntax/expand/mod.rs
blob: 03b30fda745f9bbee5c043d3c31f1c7431818f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
//! Definitions shared by macros / syntax extensions and e.g. librustc.

use crate::ast::Attribute;
use syntax_pos::symbol::sym;

pub mod allocator;

pub fn is_proc_macro_attr(attr: &Attribute) -> bool {
    [sym::proc_macro, sym::proc_macro_attribute, sym::proc_macro_derive]
        .iter().any(|kind| attr.check_name(*kind))
}