Automattic\WooCommerce\Vendor\GraphQL\Language
Parser::any
Returns a possibly empty list of parse nodes, determined by the parseFn. This list begins with a lex token of openKind and ends with a lex token of closeKind. Advances the parser to the next lex token after the closing token.
Method of the class: Parser{}
No Hooks.
Returns
NodeList<Node>.
Usage
// private - for code of main (parent) class only $result = $this->any( $openKind, $parseFn, $closeKind ): NodeList;
- $openKind(string) (required)
- .
- $parseFn(callable) (required)
- .
- $closeKind(string) (required)
- .
Parser::any() Parser::any code WC 11.1.2
private function any(string $openKind, callable $parseFn, string $closeKind): NodeList
{
$this->expect($openKind);
$nodes = [];
while (! $this->skip($closeKind)) {
$nodes[] = $parseFn($this);
}
return new NodeList($nodes);
}