classOperatorScanner
final class OperatorScanner
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Reads MySQL's operators, punctuation and parameter markers.
Comparison operators take the longest spelling the keyword table knows, && and || are the boolean operators, := assigns, and -> and ->> are the JSON operators of releases that have them. Every other punctuation character is a token of its own. Under the named parameter syntax, :name is a parameter marker as ? is.
Constants§
public const SINGLE = '()[],;+-*/%^~{}:=<>!&|.'Characters that are tokens of their own.
Methods§
Reads the operator at the cursor, if one starts there.
Parameters
$scan | Scan | The tokenization in progress |
Returns
Lexeme The lexemeThrows
LexicalException When the character starts no token at allTest cases 4
Called from 1
Calls 9
- static-call Scan::isIdentifierByte() line 44
- static-call LexicalException::unexpectedCharacter() line 45
- method-call Scan::lexeme() line 48
- function-call
substrline 51 - function-call
strlenline 52 - method-call OperatorScanner::multiCharacter() line 52
- method-call OperatorScanner::separator() line 59
- function-call
str_containsline 67 - class-const OperatorScanner::SINGLE() line 67
public function multiCharacter(Scan $scan, string $candidate): string|nullReads the . that separates the parts of a qualified name.
The word after it is read as an identifier whatever it spells, when one follows at once.
Parameters
$scan | Scan | The tokenization in progress, positioned on the dot |
Returns
Lexeme The lexemeTest cases 1
Called from 2
Calls 4
- static-call Scan::isIdentifierByte() line 113
- class-const LexerState::IdentifierStart() line 113
- class-const LexerState::Start() line 113
- method-call Scan::lexeme() line 115
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
OperatorScannerTest::testMultiCharactercallsOperatorScannerTest::testScancallsOperatorScannerTest::testScanReadsNamedParametersOnlyUnderTheNamedSyntaxcallsOperatorScannerTest::testScanRejectsAForeignCharactercallsOperatorScannerTest::testScanRejectsAParameterMarkerGluedToANamecallsOperatorScannerTest::testSeparatorcalls
Other tests reaching this symbol 2
MySqlLexerTestcallsMySqlParserTestcalls