Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#after_bracket_tokensObject



11
12
13
# File 'lib/puppet-lint/plugins/tools.rb', line 11

def after_bracket_tokens
  %i[RBRACK RPAREN SEMIC COMMA COLON DOT NEWLINE DQMID DQPOST LBRACK HEREDOC_MID HEREDOC_POST]
end

#is_single_space(token) ⇒ Object



3
4
5
# File 'lib/puppet-lint/plugins/tools.rb', line 3

def is_single_space(token)
  token.type == :WHITESPACE && token.value == ' '
end

#new_single_spaceObject



7
8
9
# File 'lib/puppet-lint/plugins/tools.rb', line 7

def new_single_space
  PuppetLint::Lexer::Token.new(:WHITESPACE, ' ', 0, 0)
end

#next_non_space_token(token) ⇒ Object



21
22
23
24
25
# File 'lib/puppet-lint/plugins/tools.rb', line 21

def next_non_space_token(token)
  while token = token.next_token
    return token unless %i[WHITESPACE INDENT NEWLINE].include?(token.type)
  end
end

#prev_non_space_token(token) ⇒ Object



15
16
17
18
19
# File 'lib/puppet-lint/plugins/tools.rb', line 15

def prev_non_space_token(token)
  while token = token.prev_token
    return token unless %i[WHITESPACE INDENT NEWLINE].include?(token.type)
  end
end