Skip to content

Commit

Permalink
Split this to make it easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
rodjek committed Mar 28, 2017
1 parent 2006299 commit 0746c7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/puppet-lint/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ def resource_indexes
#
# Returns a Token object.
def find_resource_type_token(index)
tokens[tokens[0..index].rindex { |token|
token.type == :LBRACE && token.prev_code_token.type != :QMARK
}].prev_code_token
lbrace_idx = tokens[0..index].rindex { |token|
token.type == :LBRACE && token.prev_code_token.type != :QMARK
}
tokens[lbrace_idx].prev_code_token
end

# Internal: Find all the Token objects representing the parameter names in
Expand Down

0 comments on commit 0746c7b

Please sign in to comment.