Lines Matching full:attribute
3 //! Facility for interpreting structured content inside of an `Attribute`.
17 /// *Warning:* When parsing attribute args **other than** the
21 /// is concealed from attribute macros by rustc. Use
22 /// [`Attribute::parse_nested_meta`] instead.
24 /// [`Attribute::parse_nested_meta`]: crate::Attribute::parse_nested_meta
28 /// This example implements an attribute macro whose invocations look like this:
37 /// The "parameters" supported by the attribute are:
151 /// - [`Attribute::parse_nested_meta`] if you have an entire `Attribute` to
153 /// better error messages because `Attribute` holds span information for all
157 /// macro and parsing the arguments to the attribute macro, i.e. the ones
158 /// written in the same attribute that dispatched the macro invocation. Rustc
160 /// attribute macro invocation in this situation, so error messages might be
163 /// [`Attribute::parse_nested_meta`]: crate::Attribute::parse_nested_meta
182 /// use syn::{parse_quote, Attribute, LitStr};
184 /// let attr: Attribute = parse_quote! {
198 /// Err(meta.error("unsupported attribute"))
211 /// attribute convention.
216 /// use syn::{parse_quote, Attribute};
218 /// let attr: Attribute = parse_quote! {
252 /// use syn::{parenthesized, parse_quote, Attribute, LitInt};
254 /// let attr: Attribute = parse_quote! {
282 /// Report that the attribute's content did not conform to expectations.
291 /// # use syn::Attribute;
293 /// # fn example(attr: &Attribute) -> syn::Result<()> {
321 /// # use syn::Attribute;
323 /// # fn example(attr: &Attribute) -> syn::Result<()> {
414 return Err(input.error("expected nested attribute")); in parse_meta_path()
416 return Err(input.error("unexpected literal in nested attribute, expected ident")); in parse_meta_path()
418 return Err(input.error("unexpected token in nested attribute, expected ident")); in parse_meta_path()