src/ViKon/Parser/lexer/Lexer.php
protected function reduce(&$text) {
        if (!array_key_exists($this->stack->top(), $this->patterns)) {
            return false;
        }
        if ($text !== '' && ($data = $this->patterns[$this->stack->top()]->split($text)) !== false) {
            list($unmatched, $matched, $text, $childRuleName) = $data;

            return [$unmatched, $matched, $childRuleName];
        }

        return true;
    }
protected function reduce(&$text) {
        if (!array_key_exists($this->stack->top(), $this->patterns)) {
            return false;
        }
        if ($text !== '' && ($data = $this->patterns[$this->stack->top()]->split($text)) !== false) {
            list($unmatched, $matched, $text, $childRuleName) = $data;

            return [$unmatched, $matched, $childRuleName];
        }

        return true;
    }
protected function reduce ( & $ text ) { if ( ! array_key_exists ( $ this -> stack -> top ( ) , $ this -> patterns ) ) { return false ; } if ( $ text !== '' && ( $ data = $ this -> patterns [ $ this -> stack -> top ( ) ] -> split ( $ text ) ) !== false ) { list ( $ unmatched , $ matched , $ text , $ childRuleName ) = $ data ; return [ $ unmatched , $ matched , $ childRuleName ] ; } return true ; }
Reduce input text length by patterns match

@param string $text

@return array|bool FALSE if no valid pattern found, TRUE if input text is empty or split is not succeed,
otherwise array with unmatched, matched part of text and used patterns rule name
Reduce input text length by patterns match