lib/Languages/Galach/Parser.php
private function cleanupGroupDelimiters(array &$tokens)
    {
        $indexes = $this->getUnmatchedGroupDelimiterIndexes($tokens);

        while (!empty($indexes)) {
            $lastIndex = array_pop($indexes);
            $token = $tokens[$lastIndex];
            unset($tokens[$lastIndex]);

            if ($token->type === Tokenizer::TOKEN_GROUP_BEGIN) {
                $this->addCorrection(
                    self::CORRECTION_UNMATCHED_GROUP_LEFT_DELIMITER_IGNORED,
                    $token
                );
            } else {
                $this->addCorrection(
                    self::CORRECTION_UNMATCHED_GROUP_RIGHT_DELIMITER_IGNORED,
                    $token
                );
            }
        }
    }
private function cleanupGroupDelimiters(array &$tokens)
    {
        $indexes = $this->getUnmatchedGroupDelimiterIndexes($tokens);

        while (!empty($indexes)) {
            $lastIndex = array_pop($indexes);
            $token = $tokens[$lastIndex];
            unset($tokens[$lastIndex]);

            if ($token->type === Tokenizer::TOKEN_GROUP_BEGIN) {
                $this->addCorrection(
                    self::CORRECTION_UNMATCHED_GROUP_LEFT_DELIMITER_IGNORED,
                    $token
                );
            } else {
                $this->addCorrection(
                    self::CORRECTION_UNMATCHED_GROUP_RIGHT_DELIMITER_IGNORED,
                    $token
                );
            }
        }
    }
private function cleanupGroupDelimiters ( array & $ tokens ) { $ indexes = $ this -> getUnmatchedGroupDelimiterIndexes ( $ tokens ) ; while ( ! empty ( $ indexes ) ) { $ lastIndex = array_pop ( $ indexes ) ; $ token = $ tokens [ $ lastIndex ] ; unset ( $ tokens [ $ lastIndex ] ) ; if ( $ token -> type === Tokenizer :: TOKEN_GROUP_BEGIN ) { $ this -> addCorrection ( self :: CORRECTION_UNMATCHED_GROUP_LEFT_DELIMITER_IGNORED , $ token ) ; } else { $ this -> addCorrection ( self :: CORRECTION_UNMATCHED_GROUP_RIGHT_DELIMITER_IGNORED , $ token ) ; } } }
Clean up group delimiter tokens, removing unmatched left and right delimiter.

Closest group delimiters will be matched first, unmatched remainder is removed.

@param \QueryTranslator\Values\Token[] $tokens
Clean up group delimiter tokens removing unmatched left and right delimiter .