protected function patternSymbolsSplit(array $symbols, $separator, $optional_right_fragment = FALSE) {
    $separator_position = NULL;
    foreach ($symbols as $position => $symbol) {
      if (!($symbol instanceof NumberPatternSymbol)) {
        throw new \InvalidArgumentException();
      }
      if ($symbol->symbol === $separator && !$symbol->escaped) {
        if (is_null($separator_position)) {
          $separator_position = $position;
        }
        else {
          throw new \RunTimeException("Illegal separator ($separator) at position $symbol->position.");
        }
      }
    }

    if (!$separator_position) {
      if ($optional_right_fragment) {
        return array($symbols, FALSE);
      }
      throw new \RunTimeException("Missing separator ($separator).");
    }
    else {
      return array(
        array_slice($symbols, 0, $separator_position),
        array_slice($symbols, $separator_position + 1),
      );
    }
  }
protected function patternSymbolsSplit(array $symbols, $separator, $optional_right_fragment = FALSE) {
    $separator_position = NULL;
    foreach ($symbols as $position => $symbol) {
      if (!($symbol instanceof NumberPatternSymbol)) {
        throw new \InvalidArgumentException();
      }
      if ($symbol->symbol === $separator && !$symbol->escaped) {
        if (is_null($separator_position)) {
          $separator_position = $position;
        }
        else {
          throw new \RunTimeException("Illegal separator ($separator) at position $symbol->position.");
        }
      }
    }

    if (!$separator_position) {
      if ($optional_right_fragment) {
        return array($symbols, FALSE);
      }
      throw new \RunTimeException("Missing separator ($separator).");
    }
    else {
      return array(
        array_slice($symbols, 0, $separator_position),
        array_slice($symbols, $separator_position + 1),
      );
    }
  }
protected function patternSymbolsSplit ( array $ symbols , $ separator , $ optional_right_fragment = FALSE ) { $ separator_position = NULL ; foreach ( $ symbols as $ position => $ symbol ) { if ( ! ( $ symbol instanceof NumberPatternSymbol ) ) { throw new \ InvalidArgumentException ( ) ; } if ( $ symbol -> symbol === $ separator && ! $ symbol -> escaped ) { if ( is_null ( $ separator_position ) ) { $ separator_position = $ position ; } else { throw new \ RunTimeException ( "Illegal separator ($separator) at position $symbol->position." ) ; } } } if ( ! $ separator_position ) { if ( $ optional_right_fragment ) { return array ( $ symbols , FALSE ) ; } throw new \ RunTimeException ( "Missing separator ($separator)." ) ; } else { return array ( array_slice ( $ symbols , 0 , $ separator_position ) , array_slice ( $ symbols , $ separator_position + 1 ) , ) ; } }
Splits a pattern into two fragments.

@throws \InvalidArgumentException
@throws \RuntimeException

@param array $symbols
An array of NumberPatternSymbol objects.
@param string $separator
@param boolean $optional_right_fragment
Whether the symbols on the right side of the separator, and, because of
that, the separator itself are optional.

@return array
An array of NumberPatternSymbol objects.
Splits a pattern into two fragments .