data Decl
A declaration or a member of one. parent is the name of the enclosing declaration ("" at the top level).
Example:
use std.comptime { Decl, warn }
// lints/pub_needs_name.oxl: a rule named like the file; the level comes from `[lint]` in oxl.toml
comptime fn pub_needs_name(d: Decl) {
if d.isPub && d.name.len() < 3 {
warn(d.span, "public name `{d.name}` is too short")
}
}pub(api) data DeclС версии. 1.0.0-beta
Поля
pub(api) kind: str | Kind of the declaration, as lower-case text ( |
pub(api) name: str | Name of the declaration. |
pub(api) parent: str | Name of the enclosing declaration; empty at the top level. |
pub(api) isPub: bool | Whether the declaration is public. |
pub(api) span: Span | Where the declaration is written. |
pub(api) attrs: List<Attr> | The attributes of the declaration. |
pub(api) exprs: List<Expr> | The expressions of its body in pre-order. |
Определено в: std/comptime/comptime.oxl:149