final class QuotedLiteralScanner
    implements BisonScanner
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Consumes a quoted literal.

Bison spells a token's own text in single quotes and its alias in double quotes, so the quote character decides which lexeme was written. Both are read the same way, escapes included; only the resulting lexeme differs.

Methods§

public function handles(string $character): bool

Reports whether a quoted literal can start here.

Parameters

$characterstringA single character; never the empty string

Returns

bool True for either quote character
Test cases 1
public function scan(SourceCursor $cursor): BisonToken

Consumes the literal including both quotes.

Parameters

$cursorSourceCursorCursor positioned on the opening quote

Returns

BisonToken The unescaped text between the quotes
Test cases 4
Calls 6

Test cases 22§

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 17

Relations§

Instantiated in 1