private Expr Call() { var expr = Primary(); while (true) { if (Match(LEFT_PAREN)) { expr = FinishCall(expr); } else if (Match(DOT)) { var name = Consume(IDENTIFIER, "Expect property name after '.'."); expr = new Expr.GetExpr(expr, name); } else { break; } } return(expr); }
public string VisitGetExpr(Expr.GetExpr expr) { return(Parenthesize2(".", expr.Object, expr.Name.Lexeme)); }
public object VisitGetExpr(Expr.GetExpr expr) { Resolve(expr.Object); return(null); }