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

Reads a { ... } block as Lemon's tokenizer does.

Braces nest, and braces inside comments, strings and character literals do not count. Backslashes escape inside strings and character literals.

Methods§

public function read(Cursor $cursor): string

Reads the block the cursor is at and returns the text between the braces.

Parameters

$cursorCursorPositioned at the opening brace

Returns

string The code without its braces

Throws

SyntaxException When the file ends before the closing brace
Test cases 2
Called from 1
Calls 9
public function comment(Cursor $cursor): void

Moves past a comment inside code.

Parameters

$cursorCursorPositioned at the slash
Test cases 1
Called from 1
Calls 5
public function literal(Cursor $cursor): void

Moves past a string or character literal inside code.

Parameters

$cursorCursorPositioned at the opening quote
Test cases 1
Called from 1
Calls 2

Test cases 12§

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

Dedicated tests 4
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Method calls 1
Type declarations 1