Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Block Expressions

This section is a work-in-progress experiment about making the book executable.

Syntax
BlockExpression: {
        inner_attrs=InnerAttribute*
        statements=Statement*
        tail=ExpressionWithoutBlock?
    }
    => BlockExpression { inner_attrs, statements, tail: tail.map(Box::new) }
BlockExpressionNoInnerAttributes: {
        statements=Statement*
        tail=ExpressionWithoutBlock?
    }
    => BlockExpression { inner_attrs: vec![], statements, tail: tail.map(Box::new) }

#![allow(unused)]
fn main() {
pub struct BlockExpression {
    pub inner_attrs: Vec<InnerAttribute>,
    pub statements: Vec<Statement>,
    pub tail: Option<Box<Expression>>,
}
}