Tale\Jade\Parser::handleToken PHP Method

handleToken() protected method

The token-type will be translated into a method name e.g. newLine => handleNewLine attribute => handleAttribute tag => handleTag First argument of that method will always be the token array If no token is passed, it will take the current token in the lexer's token generator
protected handleToken ( array $token = null )
$token array a token or the current lexer's generator token
    protected function handleToken(array $token = null)
    {
        $token = $token ? $token : $this->getToken();
        //Put together the method name
        $method = 'handle' . ucfirst($token['type']);
        //If the token has no handler, we throw an error
        if (!method_exists($this, $method)) {
            $this->throwException("Unexpected token `{$token['type']}` encountered, no handler {$method} found. " . "It seems you added custom tokens. Please extend the Parser and add a {$method}-method for that token", $token);
        } else {
            //Call the handler method and pass the token array as the first argument
            call_user_func([$this, $method], $token);
        }
    }