Skip to main content

Module expr

Module expr 

Source
Expand description

The small expression language inside {{ }} and @if(...).

It is deliberately tiny: paths, literals, comparisons, and boolean logic. There is no arithmetic, no method calls, and no assignment — a view that needs any of those is doing work that belongs in Rust, where the compiler can check it and a test can cover it.

Enums§

BinaryOp
The operators, loosest binding first: ||, &&, equality, comparison.
Expr
A parsed expression.

Functions§

parse
Parse exactly one expression, rejecting anything left over.
parse_arguments
Parse a comma-separated argument list, as @section("title", "Home") and @yield("body", "nothing here yet") need.
parse_foreach
Parse the head of @foreach(items as item) into its subject and binding.