Kahlan\Jit\Parser::_traitNode PHP Method

_traitNode() protected method

Build a trait node.
protected _traitNode ( )
    protected function _traitNode()
    {
        $this->_codeNode();
        $token = $this->_stream->current(true);
        $body = $token[1];
        $body .= $this->_stream->skipWhitespaces();
        $body .= $name = $this->_stream->current();
        $body .= $this->_stream->next([';', '{']);
        $this->_states['body'] .= $body;
        $node = new BlockDef($body, 'trait');
        $node->name = $name;
        return $this->_states['current'] = $this->_contextualize($node);
    }