final class SqlTriviaReader

Reads what carries no meaning of its own: whitespace and comments.

These are kept rather than dropped so that a statement can be written back out exactly as it came in. A run of whitespace is one lexeme, and so is a whole comment, however long it runs.

Methods§

public function readAt(string $sql, int $offset, SqlLexerProfile $profile): SqlLexeme|null

Answers what trivia starts at an offset.

Parameters

$sqlstringThe statement, as written
$offsetintWhere to look
$profileSqlLexerProfileWhat the dialect spells things with

Returns

SqlLexeme|null The trivia read there, or null when none starts there
Test cases 5
Called from 1
Calls 8

Private surface 1§

Implementation details, listed for orientation only.

private SqlBlockCommentReader $blockComments = new \ZtdQuery\Sql\Reader\SqlBlockCommentReader()

Test cases 9§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 4

Relations§

Instantiated in 1
Method calls 1
Type declarations 1