Skip to content

Commit b277462

Browse files
authored
Fix function call name token type in function_indexes method
Currently, the method `function_indexes` in `lib/puppet-lint/data.rb` doesn't work and only returns empty arrays. This is because, when iterating over the `token` array, tokens are skipped if their type does not equal `:NAME` but tokens that represent function call declarations have the type `:FUNCTION_NAME` and are skipped during iteration.
1 parent b5ec443 commit b277462

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet-lint/data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def function_indexes
386386
@function_indexes ||= begin
387387
functions = []
388388
tokens.each_with_index do |token, token_idx|
389-
next unless token.type == :NAME
389+
next unless token.type == :FUNCTION_NAME
390390
next unless token_idx.zero? ||
391391
(token_idx == 1 && tokens[0].type == :WHITESPACE) ||
392392
[:NEWLINE, :INDENT].include?(token.prev_token.type) ||

0 commit comments

Comments
 (0)