Tale\Jade\Parser::handleClass PHP Method

handleClass() protected method

If there's no $_current-node, a new one is created It will be converted to a regular -node on the element (There is no class-node) Classes can only exist on elements and mixinCalls
protected handleClass ( array $token )
$token array the -token
    protected function handleClass(array $token)
    {
        if (!$this->current) {
            $this->current = $this->createElement();
        }
        if (!in_array($this->current->type, ['element', 'mixinCall'])) {
            $this->throwException("Classes can only be used on elements and mixin calls, not on {$this->current->type}", $token);
        }
        $attr = $this->createNode('attribute', $token);
        $attr->name = 'class';
        $attr->value = $token['name'];
        $attr->escaped = false;
        $this->current->attributes[] = $attr;
    }