classSourceException
abstract class SourceException
extends RuntimeException
Public API: explicitly declared with
@visibility public.The SQL text could not be read at a position.
Both a lexer that meets text it cannot tokenize and a parser that meets a token it cannot accept report this way, so a caller can handle either.
$e = \SqlParser\Lexer\LexicalException::unterminated('string', "SELECT\n'abc", 7);
$e instanceof \SqlParser\Lexer\SourceException // => true
$e->position->line // => 2Properties§
public int $offsetpublic SourcePosition $positionMethods§
public function __construct(
string $message,
public int $offset,
public SourcePosition $position,
)Parameters
$message | string | What went wrong |
$offset | int | Byte offset where it went wrong |
$position | SourcePosition | The same place as a line and column |
Called from 1
Calls 1
- static-call
RuntimeException::__construct()line 34
Test cases 25§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SourceExceptionTestcalls
Other tests reaching this symbol 24
LexicalExceptionTestcallsTerminalIndexTestcallsMySqlLexerTestcallsOperatorScannerTestcallsQuotedScannerTestcallsTriviaScannerTestcallsVariableScannerTestcallsWordScannerTestcallsMySqlParserTestcallsLrParserTestcallsSyntaxExceptionTestcallsLookaheadFilterTestcallsNumberScannerTestcallsOperatorScannerTestcallsPostgreSqlLexerTestcallsQuotedScannerTestcallsTriviaScannerTestcallsPostgreSqlParserTestcallsNumberScannerTestcallsOperatorScannerTestcallsQuotedScannerTestcallsSqliteLexerTestcallsVariableScannerTestcallsSqliteParserTestcalls