pub struct CellDecl {
pub name: String,
pub name_span: ExprSpan,
pub type_name: Option<TypeExpr>,
pub initializer: Option<Expr>,
pub filter: Option<CellFilter>,
pub require: Option<RequireBlock>,
pub leading_comment: Option<Comment>,
pub doc_comment: Option<String>,
pub trailing_line_comment: Option<Comment>,
pub blank_line_before: bool,
pub span: ExprSpan,
}Expand description
cell_decl = "cell" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".
type_name/initializer are unresolved — no TypeRegistry lookup, no literal validation.
Exactly one of type_name, initializer may be absent, per the grammar’s two
cell_type_init forms, but this is not enforced here (an all-None CellDecl cannot be
produced by crate::AdamAstParser, which requires at least one of :/=).
Fields§
§name: StringThe cell’s declared name.
name_span: ExprSpanThe name token’s span.
type_name: Option<TypeExpr>The : type_expr annotation, if present.
initializer: Option<Expr>The = expression initializer, if present. Unresolved and unevaluated here — see
crate::parser::AdamParser for the compile-to-Sheet phase, which parses this with no
cell scope pushed and evaluates it eagerly, once, at parse time.
filter: Option<CellFilter>The filter clause, if present.
require: Option<RequireBlock>The require { ... } validation block, if present.
leading_comment: Option<Comment>A leading ////* */ comment immediately preceding this declaration, if recovered by
crate::trivia::attach_trivia.
doc_comment: Option<String>A leading /// doc comment immediately preceding this declaration, if recovered by
crate::AdamAstParser.
trailing_line_comment: Option<Comment>A ////* */ comment on the same source line as this declaration’s own last token, if
recovered by crate::trivia::attach_trivia. See
https://github.com/stlab/cel-rs/issues/59.
blank_line_before: boolWhether a blank line preceded this declaration, if recovered by
crate::trivia::attach_trivia.
span: ExprSpanThe span of the whole cell ...; declaration.