classModuleArguments
final class ModuleArguments
Reads the argument texts of a virtual table module from a parse tree, and checks a text against the grammar.
Rule: SQLITE-MODULE-ARGUMENT-TEXT-001. The arguments are the items of the argument list, separated by its top-level commas. The text of an argument is the text of its first token followed, for each further token, by the white space and comments before that token and the token itself: the span SQLite hands to the module. A text is one argument when the grammar, given the text between the parentheses of a virtual table definition, reads exactly one argument with that span and nothing before or after it. Terminates: the list is flattened iteratively and a text is parsed once. Source: https://sqlite.org/lang_createvtab.html (and sqlite3VtabArgExtend() in vtab.c of the release). Status: Implemented.
Methods§
public function texts(Node $list): list<string>Answers the text of each argument of a vtabarglist node, in order.
Parameters
$list | Node |
Returns
list<string>Test cases 2
Called from 2
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule::arguments() packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:111
- method-call SqlSemantics\Platform\Sqlite\Rules\Definition\ModuleArguments::single() packages/sql-semantics-sqlite/src/Rules/Definition/ModuleArguments.php:89
Calls 3
- method-call Lists::items() line 41
- new Lists line 41
- method-call ModuleArguments::tokens() line 43
Answers the tokens under a node in text order, without recursing on the tree.
Parameters
$node | Node |
Returns
list<Token>Test cases 1
Called from 3
- method-call SqlSemantics\Platform\Sqlite\Rules\Definition\ModuleArguments::texts() packages/sql-semantics-sqlite/src/Rules/Definition/ModuleArguments.php:43
- method-call SqlSemantics\Platform\Sqlite\Rules\Definition\ModuleArguments::single() packages/sql-semantics-sqlite/src/Rules/Definition/ModuleArguments.php:92
- method-call SqlSemantics\Platform\Sqlite\Rules\Definition\ModuleArguments::single() packages/sql-semantics-sqlite/src/Rules/Definition/ModuleArguments.php:93
public function single(string $text): boolTells whether SQLite reads a text as exactly one argument with that text.
Parameters
$text | string |
Returns
boolTest cases 2
Called from 1
Calls 5
- new SqliteParser line 81
- function-call
countline 89 - method-call ModuleArguments::texts() line 89
- method-call ModuleArguments::tokens() line 92
- function-call
array_sliceline 93
Private surface 1§
Implementation details, listed for orientation only.
private static ?SqliteParser $parser = nullTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
ModuleArgumentsTest::testSingleAcceptsOneArgumentTextcallsModuleArgumentsTest::testSingleRefusesTextSqliteWouldReadDifferentlycallsModuleArgumentsTest::testTextsAreTheExactSpansOfTheArgumentscallsModuleArgumentsTest::testTextsKeepCommentsWrittenBetweenTheTokensOfAnArgumentcallsModuleArgumentsTest::testTokensAreInTextOrdercalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule::arguments() packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:111
- new SqlSemantics\Platform\Sqlite\Statement\Schema\ModuleArgument::__construct() packages/sql-semantics-sqlite/src/Statement/Schema/ModuleArgument.php:44
Method calls 2
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule::arguments() packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:111
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\ModuleArgument::__construct() packages/sql-semantics-sqlite/src/Statement/Schema/ModuleArgument.php:44