src/Luminous/Core/Scanners/StatefulScanner.php
protected function collapseTokenTree($node)
    {
        $text = '';
        foreach ($node['children'] as $c) {
            if (is_string($c)) {
                $text .= Utils::escapeString($c);
            } else {
                $text .= $this->collapseTokenTree($c);
            }
        }
        $tokenName = $node['token_name'];
        $token = array($node['token_name'], $text, true);

        $token_ = $this->ruleMapperFilter(array($token));
        $token = $token_[0];

        if (isset($this->filters[$tokenName])) {
            foreach ($this->filters[$tokenName] as $filter) {
                $token = call_user_func($filter[1], $token);
            }
        }
        list($tokenName, $text,) = $token;
        return ($tokenName === null) ? $text : Utils::tagBlock($tokenName, $text);
    }
protected function collapseTokenTree($node)
    {
        $text = '';
        foreach ($node['children'] as $c) {
            if (is_string($c)) {
                $text .= Utils::escapeString($c);
            } else {
                $text .= $this->collapseTokenTree($c);
            }
        }
        $tokenName = $node['token_name'];
        $token = array($node['token_name'], $text, true);

        $token_ = $this->ruleMapperFilter(array($token));
        $token = $token_[0];

        if (isset($this->filters[$tokenName])) {
            foreach ($this->filters[$tokenName] as $filter) {
                $token = call_user_func($filter[1], $token);
            }
        }
        list($tokenName, $text,) = $token;
        return ($tokenName === null) ? $text : Utils::tagBlock($tokenName, $text);
    }
protected function collapseTokenTree ( $ node ) { $ text = '' ; foreach ( $ node [ 'children' ] as $ c ) { if ( is_string ( $ c ) ) { $ text .= Utils :: escapeString ( $ c ) ; } else { $ text .= $ this -> collapseTokenTree ( $ c ) ; } } $ tokenName = $ node [ 'token_name' ] ; $ token = array ( $ node [ 'token_name' ] , $ text , true ) ; $ token_ = $ this -> ruleMapperFilter ( array ( $ token ) ) ; $ token = $ token_ [ 0 ] ; if ( isset ( $ this -> filters [ $ tokenName ] ) ) { foreach ( $ this -> filters [ $ tokenName ] as $ filter ) { $ token = call_user_func ( $ filter [ 1 ] , $ token ) ; } } list ( $ tokenName , $ text , ) = $ token ; return ( $ tokenName === null ) ? $ text : Utils :: tagBlock ( $ tokenName , $ text ) ; }
Recursive function to collapse the token tree into XML
@internal
Recursive function to collapse the token tree into XML