and method

Expr and()

Implementation

Expr and() {
  Expr expr = equality();
  while (match([TokenType.AND])) {
    Token operator = previous();
    Expr right = equality();
    expr = Logical(expr, operator, right);
  }
  return expr;
}