Store passthrough attributes for diagnostic lint levels
diff --git a/syntax/mod.rs b/syntax/mod.rs
index 092f403..c478d3c 100644
--- a/syntax/mod.rs
+++ b/syntax/mod.rs
@@ -1,7 +1,7 @@
// Functionality that is shared between the cxxbridge macro and the cmd.
pub mod atom;
-mod attrs;
+pub mod attrs;
pub mod check;
pub mod derive;
mod discriminant;
@@ -32,7 +32,7 @@
use proc_macro2::{Ident, Span};
use syn::punctuated::Punctuated;
use syn::token::{Brace, Bracket, Paren};
-use syn::{Expr, Generics, Lifetime, LitInt, Token, Type as RustType};
+use syn::{Attribute, Expr, Generics, Lifetime, LitInt, Token, Type as RustType};
pub use self::atom::Atom;
pub use self::derive::{Derive, Trait};
@@ -72,6 +72,7 @@
pub lang: Lang,
pub doc: Doc,
pub derives: Vec<Derive>,
+ pub attrs: Vec<Attribute>,
pub type_token: Token![type],
pub name: Pair,
pub generics: Lifetimes,
@@ -84,6 +85,7 @@
pub struct Struct {
pub doc: Doc,
pub derives: Vec<Derive>,
+ pub attrs: Vec<Attribute>,
pub visibility: Token![pub],
pub struct_token: Token![struct],
pub name: Pair,
@@ -94,6 +96,7 @@
pub struct Enum {
pub doc: Doc,
pub derives: Vec<Derive>,
+ pub attrs: Vec<Attribute>,
pub enum_token: Token![enum],
pub name: Pair,
pub brace_token: Brace,
@@ -106,6 +109,7 @@
pub struct ExternFn {
pub lang: Lang,
pub doc: Doc,
+ pub attrs: Vec<Attribute>,
pub name: Pair,
pub sig: Signature,
pub semi_token: Token![;],
@@ -115,6 +119,7 @@
pub struct TypeAlias {
pub doc: Doc,
pub derives: Vec<Derive>,
+ pub attrs: Vec<Attribute>,
pub type_token: Token![type],
pub name: Pair,
pub generics: Lifetimes,
@@ -151,6 +156,7 @@
pub struct Var {
pub doc: Doc,
+ pub attrs: Vec<Attribute>,
pub visibility: Token![pub],
pub ident: Ident,
pub ty: Type,
@@ -170,6 +176,7 @@
pub struct Variant {
pub doc: Doc,
+ pub attrs: Vec<Attribute>,
pub name: Pair,
pub discriminant: Discriminant,
pub expr: Option<Expr>,