OxL Reference

data Attr

An attribute @name(args).

Example:

oxl✓ checked in CI
use std.comptime { Decl, warn }

comptime fn no_deprecated(d: Decl) {
  for a in d.attrs {
    if a.name == "deprecated" {
      warn(a.span, "{d.name} is deprecated")
    }
  }
}
pub(api) data Attr

Since. 1.0.0-beta

Fields

pub(api) name: str

Name of the attribute without @.

pub(api) args: List<AttrArg>

The arguments in the order written.

pub(api) span: Span

Where the attribute is written.

Defined in: std/comptime/comptime.oxl:95

See also