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

Extracts the keyword table from SQLite's tool/mkkeywordhash.c.

Each keyword names the features it belongs to, and a build leaves out a keyword none of whose features are compiled in. The features follow the same SQLITE_OMIT_* and SQLITE_ENABLE_* names the grammar's own conditionals use, so one list of defines decides both.

Constants§

public const OMITTABLE = ['ALTER' => ['SQLITE_OMIT_ALTERTABLE', 'SQLITE_OMIT_VIRTUALTABLE'], 'ANALYZE' =…

Features that are compiled in unless the named option omits them.

public const ENABLEABLE = ['ORDERSET' => 'SQLITE_ENABLE_ORDERED_SET_AGGREGATES']

Features that are compiled in only when the named option enables them.

Methods§

public function __construct(private list<string> $defines = [])

Parameters

$defineslist<string>Names defined for the build, as `-D` would pass them
public function parse(string $source): array{keywords: array<string, string>}

Reads the keyword table of the build.

Parameters

$sourcestringContents of `mkkeywordhash.c`

Returns

array{keywords: array<string, string>} Terminal name by upper-cased keyword

Throws

RuntimeException When the file declares no keyword
Test cases 2
Calls 6
public function compiledIn(list<string> $features): bool

Reports whether any of a keyword's features is compiled in.

Parameters

$featureslist<string>Feature names the keyword belongs to

Returns

bool True when at least one feature is compiled in
Test cases 1
Called from 1
Calls 3

Private surface 1§

Implementation details, listed for orientation only.

private list<string> $defines = []

Test cases 3§

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

Dedicated tests 3