OxL Справочник OxL
РусскийEnglish

data Attr

An attribute @name(args).

Example:

oxl✓ проверяется в 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

С версии. 1.0.0-beta

Поля

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.

Определено в: std/comptime/comptime.oxl:95

См. также