byOpStr static method

BinaryOperator? byOpStr(
  1. String opStr
)

Implementation

static BinaryOperator? byOpStr(String opStr) {
  BinaryOperator? retval = null;
  switch (opStr) {
    case '+':
      retval = Plus;
      break;
    case '-':
      retval = Minus;
      break;
    case '*':
      retval = Multiply;
      break;
    case '/':
      retval = Divide;
      break;
    case '%':
      retval = Modulo;
      break;
    case '&&':
      retval = And;
      break;
    case '||':
      retval = Or;
      break;
    case '==':
      retval = Equals;
      break;
    case '!=':
      retval = NotEquals;
      break;
    case '===':
      retval = Identical;
      break;
    case '!==':
      retval = NotIdentical;
      break;
    case '<':
      retval = Lower;
      break;
    case '>':
      retval = Bigger;
      break;
    case '<=':
      retval = LowerEquals;
      break;
    case '>=':
      retval = BiggerEquals;
      break;
  }
  return retval;
}