Kahlan\Jit\Parser::_useNode PHP Method

_useNode() protected method

Manage use statement.
protected _useNode ( )
    protected function _useNode()
    {
        $current = $this->_states['current'];
        $token = $this->_stream->current(true);
        $last = $alias = $use = '';
        $as = false;
        $stop = ';';
        $prefix = '';
        while ($token[1] !== $stop) {
            $this->_states['body'] .= $token[1];
            if (!($token = $this->_stream->next(true))) {
                break;
            }
            switch ($token[0]) {
                case ',':
                    $as ? $this->_states['uses'][$alias] = $prefix . $use : ($this->_states['uses'][$last] = $prefix . $use);
                    $last = $alias = $use = '';
                    $as = false;
                    break;
                case T_STRING:
                    $last = $token[1];
                    /* Always prefix */
                /* Always prefix */
                case T_NS_SEPARATOR:
                    $as ? $alias .= $token[1] : ($use .= $token[1]);
                    break;
                case T_AS:
                    $as = true;
                    break;
                case '{':
                    $prefix = $use;
                    $use = '';
                    $stop = '}';
                    break;
            }
        }
        $this->_states['body'] .= $token[0];
        $as ? $this->_states['uses'][$alias] = $prefix . $use : ($this->_states['uses'][$last] = $prefix . $use);
        $this->_codeNode('use');
    }