classTriviaScanner
final class TriviaScanner
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Skips the whitespace and comments between MySQL tokens.
A /*! comment is versioned: when the release it names is not newer than the release being read for, its body is SQL and only the markers are skipped, with the closing marker recognised later at a token boundary. Any other block comment, a # comment, and a -- comment followed by a space are skipped whole.
Methods§
public function skip(Scan $scan): voidSkips every whitespace and comment at the cursor.
Parameters
$scan | Scan | The tokenization in progress |
Throws
LexicalException When a block comment never closesTest cases 3
Called from 1
Calls 3
- function-call
ctype_spaceline 36 - function-call
ctype_cntrlline 36 - method-call TriviaScanner::blockComment() line 48
public function blockComment(Scan $scan): voidSkips a block comment, or only its opening marker when its body is SQL.
Parameters
$scan | Scan | The tokenization in progress, positioned on the comment |
Throws
LexicalException When the comment never closesTest cases 2
Called from 1
Calls 1
- static-call LexicalException::unterminated() line 77
Test cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
TriviaScannerTest::testBlockCommentcallsTriviaScannerTest::testBlockCommentRejectsAnUnterminatedCommentcallsTriviaScannerTest::testSkipDropsAVersionCommentForANewerReleasecallsTriviaScannerTest::testSkipPassesWhitespaceAndCommentscallsTriviaScannerTest::testSkipReadsAVersionCommentBodyAsSqlcalls
Other tests reaching this symbol 2
MySqlLexerTestcallsMySqlParserTestcalls