QuantificationNode constructor

QuantificationNode(
  1. Node child,
  2. int min, [
  3. int? max
])

Creates a quantification of child with min and optional max bounds.

Throws a RangeError if min is negative or if max is less than min.

Implementation

new(this.child, this.min, [this.max]) {
  RangeError.checkNotNegative(min, 'min', 'Minimum must be non-negative');
  final max = this.max;
  if (max != null && max < min) {
    throw RangeError.value(
      max,
      'max',
      'Maximum must be greater than or equal to minimum ($min)',
    );
  }
}