fn apply_expr(&mut self) -> WeldResult<Box<Expr>> {
        let mut expr = self.leaf_expr()?;
        while *self.peek() == TDot || *self.peek() == TOpenParen {
            if *self.next() == TDot {
                match *self.next() {
                    TIdent(ref value) => {
                        if value.starts_with('$') {
                            match u32::from_str_radix(&value[1..], 10) {
                                Ok(index) => {
                                    expr = expr_box(GetField { expr, index }, Annotations::new())
                                }
                                _ => {
                                    return compile_err!(
                                        "Expected field index but got '{}'",
                                        value
                                    );
                                }
                            }
                        }
                    }

                    ref other => return compile_err!("Expected field index but got '{}'", other),
                }
            } else {
                // TOpenParen
                let mut params: Vec<Expr> = Vec::new();
                while *self.peek() != TCloseParen {
                    let param = self.expr()?;
                    params.push(*param);
                    if *self.peek() == TComma {
                        self.next();
                    } else if *self.peek() != TCloseParen {
                        return compile_err!("Expected ',' or ')'");
                    }
                }
                self.consume(TCloseParen)?;
                expr = expr_box(Apply { func: expr, params }, Annotations::new())
            }
        }
        Ok(expr)
    }
Parse application chain expression such as a.0().3().
weld/src/syntax/parser.rs