lib/puppet-lint/data.rb
def param_tokens(these_tokens)
      depth = 0
      lparen_idx = nil
      rparen_idx = nil

      these_tokens.each_with_index do |token, i|
        if token.type == :LPAREN
          depth += 1
          lparen_idx = i if depth == 1
        elsif token.type == :RPAREN
          depth -= 1
          if depth == 0
            rparen_idx = i
            break
          end
        end
      end

      if lparen_idx.nil? or rparen_idx.nil?
        nil
      else
        these_tokens[(lparen_idx + 1)..(rparen_idx - 1)]
      end
    end
# Internal: Finds all the tokens that make up the defined type or class
# definition parameters.
#
# these_tokens - An Array of PuppetLint::Lexer::Token objects that make up
#                the defined type or class definition.
#
# Returns an Array of PuppetLint::Lexer::Token objects or nil if it takes
# no parameters.
Finds all the tokens that make up the defined type or class
definition parameters.

An Array of PuppetLint::Lexer::Token objects that make up
the defined type or class definition.

Returns an Array of PuppetLint::Lexer::Token objects or nil if it takes
no parameters.
Finds all the tokens that make up the defined type or class definition parameters . An Array of PuppetLint :: Lexer :: Token objects that make up the defined type or class definition . Returns an Array of PuppetLint :: Lexer :: Token objects or nil if it takes no parameters .
def param_tokens(these_tokens)
      depth = 0
      lparen_idx = nil
      rparen_idx = nil
      these_tokens.each_with_index do |token, i|
        if token.type == :LPAREN
          depth += 1
          lparen_idx = i if depth == 1
        elsif token.type == :RPAREN
          depth -= 1
          if depth == 0
            rparen_idx = i
            break
          end
        end
      end
      if lparen_idx.nil? or rparen_idx.nil?
        nil
      else
        these_tokens[(lparen_idx + 1)..(rparen_idx - 1)]
      end
    end
def param_tokens ( these_tokens ) depth = 0 lparen_idx = nil rparen_idx = nil these_tokens . each_with_index do | token , i | if token . type == :LPAREN depth += 1 lparen_idx = i if depth == 1 elsif token . type == :RPAREN depth -= 1 if depth == 0 rparen_idx = i break end end end if lparen_idx . nil? or rparen_idx . nil? nil else these_tokens [ ( lparen_idx + 1 ) .. ( rparen_idx - 1 ) ] end end
Internal: Finds all the tokens that make up the defined type or class
definition parameters.
Internal : Finds all the tokens that make up the defined type or class definition parameters .
these_tokens