comparison method

AstNode comparison()

Implementation

AstNode comparison() {
  AstNode expr = term();
  while (match([
    TokenType.greater,
    TokenType.greaterEqual,
    TokenType.less,
    TokenType.lessEqual
  ])) {
    Token operator = previous();
    AstNode right = term();
    expr = BinaryExpression(expr, operator, right);
  }
  return expr;
}