receiveNegation method

  1. @override
DartBlockValueTreeAlgebraicNode receiveNegation()
override

Implementation

@override
DartBlockValueTreeAlgebraicNode receiveNegation() {
  if (rightChild != null &&
      leftChild == null &&
      operator == DartBlockAlgebraicOperator.subtract) {
    if (parent != null) {
      parent!.replaceChild(this, rightChild);
      return rightChild!;
    } else {
      rightChild!.parent = null;

      return rightChild!;
    }
  } else {
    return receiveOperator(DartBlockAlgebraicOperator.subtract);
  }
}