Skip to main content

Module ast

Module ast 

Source
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 a query: property.
ComponentCall
A reference to a declared Bern component with named arguments.
Element
A built-in component such as Button(...) { ... } => action.
IfLetNode
if let Some(name) = expr { … } else { … }
IfNode
MatchArm
MatchNode
PathExpr
a, a.b or a.b.c. Roots are component parameters or template variables; a lone identifier may also be a keyword such as segmented.
Prop
Tr
tr! { "zh-Hans" => "…{count}…", "en" => "…"; count: app.count }
TrArg
An interpolation argument after the ; in tr!.
TrEntry
One translation inside tr!.
UiBody
The contents of one ui! invocation.
VariantExpr
Type::Variant or Type::Variant { field: expr }.

Enums§

BinaryOp
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, None for anything else. With items, for navigation containers, the elements in each branch of a condition or match and in each ForEach template count instead.