Class in macro compiler

Attr

class Attr
Import
use macro::{Attr};
Source: compiler/src/prelude/macro.hy

#[name(args)] on a declaration, field or variant.

Fields#

FieldTypeDescription
namestring
argsVec<AttrArg>

Methods#

NameDescription
srcThe attribute as written: #[name(key = "v", 2)].
hasTrue when the attribute has an argument named key, or a bare key.
argValue of the key = value argument, or fallback.

See also#

  • Code: Generated coil source: declarations, an expression, statements or a type.
  • Ident: A name as written in source.
  • Expr: A function-style macro argument as written: f(1), a + b, "text".
  • TypeRef: A type annotation as written (not resolved): Vec<int>, json::Value.
  • AttrArg: One key = value (or positional value, with key == "") attribute argument.
  • Field: A class field, or a field of a record enum variant.
  • Variant: One enum variant.
  • TypeDecl: A class or enum declaration handed to a derive or attribute macro.
↑ ↓ navigate ↵ open