Expand description
Syntax tree for Bern declarations. Spans are kept so diagnostics from both the macros and the build tool point at the developer’s source.
Structs§
- Action
receiver.member.method(args): an action after=>, or the query call of aquery:property.- Component
Call - A reference to a declared Bern component with named arguments.
- Element
- A built-in component such as
Button(...) { ... } => action. - IfLet
Node if let Some(name) = expr { … } else { … }- IfNode
- Match
Arm - Match
Node - Path
Expr a,a.bora.b.c. Roots are component parameters or template variables; a lone identifier may also be a keyword such assegmented.- Prop
- Tr
tr! { "zh-Hans" => "…{count}…", "en" => "…"; count: app.count }- TrArg
- An interpolation argument after the
;intr!. - TrEntry
- One translation inside
tr!. - UiBody
- The contents of one
ui!invocation. - Variant
Expr Type::VariantorType::Variant { field: expr }.
Enums§
- Binary
Op - Expr
- Restricted expressions: literals, translations, typed bindings, enum values and a fixed set of operators. Arbitrary function calls do not exist in this grammar.
- Literal
- Node
- Pattern
- TypeRef
- Bern’s view of a Rust type used in declarations.
- UnaryOp
Functions§
- child_
names - The element names among
children,Nonefor anything else. Withitems, for navigation containers, the elements in each branch of a condition ormatchand in eachForEachtemplate count instead.