type = $type; $this->callback = $callback; } protected function generateMatches( ComponentValueList $values, $start, array $options ) { $cv = isset( $values[$start] ) ? $values[$start] : null; if ( $cv instanceof Token && $cv->type() === $this->type && ( !$this->callback || call_user_func( $this->callback, $cv ) ) ) { yield $this->makeMatch( $values, $start, $this->next( $values, $start, $options ) ); } } }