lib/puppet-lint/plugins/params_not_optional_with_undef.rb
# Returns an array of parameter tokens
Returns an array of parameter tokens
Returns an array of parameter tokens
def extract_params(idx)
    params = []
    return params if idx[:param_tokens].nil?
    e = idx[:param_tokens].each
    begin
      while (ptok = e.next)
        next unless ptok.type == :VARIABLE
        params << ptok
        nesting = 0
        loop do
          ptok = e.next
          case ptok.type
          when :LPAREN, :LBRACK
            nesting += 1
          when :RPAREN, :RBRACK
            nesting -= 1
          when :COMMA
            break unless nesting.positive?
          end
        end
      end
    rescue StopIteration; end 
    params
  end
def extract_params ( idx ) params = [ ] return params if idx [ :param_tokens ] . nil? e = idx [ :param_tokens ] . each begin while ( ptok = e . next ) next unless ptok . type == :VARIABLE params << ptok nesting = 0 loop do ptok = e . next case ptok . type when :LPAREN , :LBRACK nesting += 1 when :RPAREN , :RBRACK nesting -= 1 when :COMMA break unless nesting . positive? end end end rescue StopIteration ; end params end
Returns an array of parameter tokens
Returns an array of parameter tokens
# skip to the next parameter to avoid finding default values of variables # rubocop:disable Lint/SuppressedException
idx
<not_specific>