pub struct SourceDecl {
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
source_decl = "source" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".
Same shape as CellDecl: a source cell’s initializer is a one-time literal exactly like a
plain cell’s, and it supports the same filter clause and require block.
Fields§
§name: StringThe source 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 source ...; declaration.
Trait Implementations§
Source§impl Clone for SourceDecl
impl Clone for SourceDecl
Source§fn clone(&self) -> SourceDecl
fn clone(&self) -> SourceDecl
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more