public void collectOperands(PsiElement expression, List<Object> result, Ref<? super Boolean> unparsable) {
    if (expression instanceof PsiParenthesizedExpression parenthesized) {
      collectOperands(parenthesized.getExpression(), result, unparsable);
    }
    else if (expression instanceof PsiTypeCastExpression cast) {
      collectOperands(cast.getOperand(), result, unparsable);
    }
    else if (expression instanceof PsiConditionalExpression conditional) {
      unparsable.set(Boolean.TRUE);
      collectOperands(conditional.getThenExpression(), result, unparsable);
      addStringFragment(" ", result); // do not glue branches together
      collectOperands(conditional.getElseExpression(), result, unparsable);
    }
    else if (expression instanceof PsiPolyadicExpression binaryExpression &&
             binaryExpression.getOperationTokenType() == JavaTokenType.PLUS) {
      for (PsiExpression operand : binaryExpression.getOperands()) {
        collectOperands(operand, result, unparsable);
      }
    }
    else if (expression instanceof PsiAssignmentExpression assignmentExpression &&
             assignmentExpression.getOperationTokenType() == JavaTokenType.PLUSEQ) {
      unparsable.set(Boolean.TRUE);
      collectOperands(assignmentExpression.getLExpression(), result, unparsable);
      collectOperands(assignmentExpression.getRExpression(), result, unparsable);
    }
    else if (expression instanceof PsiTemplate template) {
      for (PsiElement child : template.getChildren()) {
        collectOperands(child, result, unparsable);
      }
    }
    else if (PsiUtilEx.isStringOrCharacterLiteral(expression) || expression instanceof PsiFragment) {
      result.add(expression);
    }
    else if (expression instanceof PsiExpression) {
      SmartList<PsiExpression> uncomputables = new SmartList<>();
      Object o = myEvaluationHelper.computeExpression((PsiExpression)expression, uncomputables);
      // in many languages 'null' is a reserved word
      addStringFragment(o == null ? "missingValue" : String.valueOf(o), result);
      if (!uncomputables.isEmpty()) {
        unparsable.set(Boolean.TRUE);
      }
    }
    else {
      unparsable.set(Boolean.TRUE);
      result.add(expression);
    }
  }
public void collectOperands(PsiElement expression, List<Object> result, Ref<? super Boolean> unparsable)