src/Phn/Dal/Language/Parser.php
private function isTemplateDefinition(Stream $stream)
    {
        if ($stream->current()->equals(Token::TYPE_KEYWORD, 'template')) {
            return true;
        }

        if (!$stream->current()->equals(Token::TYPE_KEYWORD, 'export')) {
            return false;
        }

        if ($stream->peek()->equals(Token::TYPE_KEYWORD, 'template') && $stream->peek(3)->equals(Token::TYPE_SYMBOL, '(')) {
            return true;
        }

        return false;
    }
private function isTemplateDefinition(Stream $stream)
    {
        if ($stream->current()->equals(Token::TYPE_KEYWORD, 'template')) {
            return true;
        }

        if (!$stream->current()->equals(Token::TYPE_KEYWORD, 'export')) {
            return false;
        }

        if ($stream->peek()->equals(Token::TYPE_KEYWORD, 'template') && $stream->peek(3)->equals(Token::TYPE_SYMBOL, '(')) {
            return true;
        }

        return false;
    }
private function isTemplateDefinition ( Stream $ stream ) { if ( $ stream -> current ( ) -> equals ( Token :: TYPE_KEYWORD , 'template' ) ) { return true ; } if ( ! $ stream -> current ( ) -> equals ( Token :: TYPE_KEYWORD , 'export' ) ) { return false ; } if ( $ stream -> peek ( ) -> equals ( Token :: TYPE_KEYWORD , 'template' ) && $ stream -> peek ( 3 ) -> equals ( Token :: TYPE_SYMBOL , '(' ) ) { return true ; } return false ; }
Checks whether the current token stream is about to define a template.

A template starts its definition when:

- it starts with the keyword "template"
- it starts with the keyword "export" followed by:
- the keyword "template" and the symbol "(" 2 tokens later such as:
export template foo (
^

@param Stream $stream

@return bool
Checks whether the current token stream is about to define a template .