classExclusion
final class Exclusion
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
How deep the preprocessor is inside an excluded region, and where the region began.
Lemon counts nested %ifdef directives inside an excluded region so that only the matching %endif ends it.
Methods§
public function depth(): intAnswers how many directives deep the excluded region is.
Returns
int Zero outside an excluded regionTest cases 6
Called from 5
- method-call LemonParser\Preprocessor\Preprocessor::preprocess() packages/lemon-parser/src/Preprocessor/Preprocessor.php:57
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:79
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:82
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:87
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:93
public function start(): intAnswers where the excluded region began.
Returns
int The byte offset of its directiveTest cases 2
ExclusionTest::testEntercallsExclusionTest::testStartcalls
public function startLine(): intAnswers the line the excluded region began on.
Returns
int The line numberTest cases 2
public function enter(int $start, int $line): voidBegins an excluded region.
Parameters
$start | int | The byte offset of its directive |
$line | int | The line of its directive |
Test cases 7
public function nest(): voidNotes a further opening directive inside the excluded region.
Test cases 3
ExclusionTest::testEntercallsExclusionTest::testLeavecallsExclusionTest::testNestcalls
public function leave(): boolNotes a closing directive.
Returns
bool True when it ends the excluded regionTest cases 1
ExclusionTest::testLeavecalls
Private surface 3§
Implementation details, listed for orientation only.
private int $depth = 0private int $start = 0private int $startLine = 1Test cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
Other tests reaching this symbol 5
Relations§
Instantiated in 1
Method calls 13
- method-call LemonParser\Preprocessor\Preprocessor::preprocess() packages/lemon-parser/src/Preprocessor/Preprocessor.php:57
- method-call LemonParser\Preprocessor\Preprocessor::preprocess() packages/lemon-parser/src/Preprocessor/Preprocessor.php:58
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:79
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:79
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:79
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:82
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:83
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:85
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:87
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:88
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:93
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:94
- method-call LemonParser\Preprocessor\Preprocessor::settle() packages/lemon-parser/src/Preprocessor/Preprocessor.php:96