classKeywordHash
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
$defines | list<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
$source | string | Contents of `mkkeywordhash.c` |
Returns
array{keywords: array<string, string>} Terminal name by upper-cased keywordThrows
RuntimeException When the file declares no keywordTest cases 2
public function compiledIn(list<string> $features): boolReports whether any of a keyword's features is compiled in.
Parameters
$features | list<string> | Feature names the keyword belongs to |
Returns
bool True when at least one feature is compiled inTest cases 1
Called from 1
Calls 3
- class-const KeywordHash::ENABLEABLE() line 101
- function-call
in_arrayline 103 - class-const KeywordHash::OMITTABLE() line 109
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.