data AttrArg
An argument of an attribute: @retry(max: 3) has name "max", kind "int" and text "3".
Example:
use std.comptime { Decl, warn }
comptime fn retry_budget(d: Decl) {
for a in d.attrs {
if a.name == "retry" {
for arg in a.args {
if arg.name == "max" && arg.kind == "int" && arg.text != "3" {
warn(arg.span, "retry max is {arg.text}")
}
}
}
}
}pub(api) data AttrArgС версии. 1.0.0-beta
Поля
pub(api) name: str | Name of the argument ( |
pub(api) kind: str | Kind of the value: |
pub(api) text: str | The value as written in the source. |
pub(api) span: Span | Where the argument is written. |
Определено в: std/comptime/comptime.oxl:69