function Scanner::consumeCommentsForCurrentToken
Consumes comment tokens associated with the current token
Return value
$this
2 calls to Scanner::consumeCommentsForCurrentToken()
- Scanner::consumeEnd in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Executes the operations to handle the end of the source scanning
- Scanner::consumeToken in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Consumes the current token
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php, line 960
Class
- Scanner
- Base class for scanners.
Namespace
Peast\SyntaxCode
protected function consumeCommentsForCurrentToken() {
$comments = $this->commentsForCurrentToken();
if ($comments && ($this->registerTokens || $this->eventsEmitter)) {
foreach ($comments as $comment) {
//Register the token if required
if ($this->registerTokens) {
$this->tokens[] = $comment;
}
//Emit the TokenConsumed event for the comment
$this->eventsEmitter && $this->eventsEmitter
->fire("TokenConsumed", array(
$comment,
));
}
}
return $this;
}