evaluateString method

bool evaluateString(
  1. String? left,
  2. String operator,
  3. String right
)

Implementation

bool evaluateString(String? left, String operator, String right) {
  switch (operator) {
    case '=' || '==':
      return left == right;
    case '<>' || '!=':
      return left != right;
    case '>':
      // Should be consistent with `org-string>`
      return left == null || left.compareTo(right) > 0;
    case '=>' || '>=':
      // Should be consistent with `org-string>=`
      return left == null || left.compareTo(right) >= 0;
    case '<':
      // Should be consistent with `org-string<`
      return left != null && left.compareTo(right) < 0;
    case '=<' || '<=':
      // Should be consistent with `org-string<=`
      return left != null && left.compareTo(right) <= 0;
  }
  throw UnimplementedError();
}