fn lambda_expr(&mut self) -> WeldResult<Box<Expr>> {
        let mut params: Vec<Parameter> = Vec::new();
        // The next token could be either '||' if there are no params, or '|' if there are some.
        let token = self.next();
        if *token == TBar {
            while *self.peek() != TBar {
                let name = self.symbol()?;
                let ty = self.optional_type()?;
                params.push(Parameter { name, ty });
                if *self.peek() == TComma {
                    self.next();
                } else if *self.peek() != TBar {
                    return compile_err!("Expected ',' or '|'");
                }
            }
            self.consume(TBar)?;
        } else if *token != TLogicalOr {
            return compile_err!("Expected '|' or '||'");
        }
        let body = self.expr()?;
        Ok(expr_box(Lambda { params, body }, Annotations::new()))
    }
Parse '|params| body' starting at the current position.
weld/src/syntax/parser.rs