OxL Reference

kw attr

Reserved keyword

The list of words: §1.4

Syntax

ebnf
AttrDecl    = "attr" Ident "{" { Field } "}" ;

Grammar: App. A

Defined in

Examples

oxl
attr Audit { level: Level = Level.Info }

comptime fn Audit.apply(d: Decl, a: Audit) -> Decl | CompileError {
  d.wrapBody(body => quote { log.at($a.level, "call {$d.name}"); $body })
}

— 15.4 User-defined attributes and code generation

Related diagnostics

deprecated, attribute-not-applicable, cache-not-readonly, invalid-window, retry-not-idempotent, rpc-attr

See also