classLemonPreprocessor
final class LemonPreprocessor
Selects source branches using the %if/%ifdef/%ifndef/%else/%endif directives from tool/lemon.c.
Methods§
public function __construct(private LemonCondition $condition = new \SqlFaker\Compiler\Lemon\LemonCondition())Parameters
$condition | LemonCondition | The build's fixed set of named definitions |
Test cases 5
LemonPreprocessorTest::testProcessHandlesSqliteUpdateDeleteLimitConditioncoversLemonPreprocessorTest::testProcessRejectsRepeatedElsecoversLemonPreprocessorTest::testProcessRejectsUnmatchedElsecoversLemonPreprocessorTest::testProcessRejectsUnterminatedConditionalsEvenWhenActivecoversLemonPreprocessorTest::testProcessSelectsNestedSourceBranchesAndPreservesLineCountcovers
Calls 1
public function process(string $input): stringPreserves line count while omitting source inactive in the target parser build.
Parameters
$input | string |
Returns
stringThrows
RuntimeException When conditional directives are unbalanced or malformedTest cases 5
LemonPreprocessorTest::testProcessHandlesSqliteUpdateDeleteLimitConditioncovers and callsLemonPreprocessorTest::testProcessRejectsRepeatedElsecovers and callsLemonPreprocessorTest::testProcessRejectsUnmatchedElsecovers and callsLemonPreprocessorTest::testProcessRejectsUnterminatedConditionalsEvenWhenActivecovers and callsLemonPreprocessorTest::testProcessSelectsNestedSourceBranchesAndPreservesLineCountcovers and calls
Called from 1
Private surface 1§
Implementation details, listed for orientation only.
private LemonCondition $condition = new \SqlFaker\Compiler\Lemon\LemonCondition()Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
LemonPreprocessorTest::testProcessHandlesSqliteUpdateDeleteLimitConditioncovers and callsLemonPreprocessorTest::testProcessRejectsRepeatedElsecovers and callsLemonPreprocessorTest::testProcessRejectsUnmatchedElsecovers and callsLemonPreprocessorTest::testProcessRejectsUnterminatedConditionalsEvenWhenActivecovers and callsLemonPreprocessorTest::testProcessSelectsNestedSourceBranchesAndPreservesLineCountcovers and calls
Other tests reaching this symbol 1
LemonParserTestcalls