lib/puppet-lint/checks.rb
def load_data(path, content)
    lexer = PuppetLint::Lexer.new
    PuppetLint::Data.path = path
    PuppetLint::Data.manifest_lines = content.split("\n")
    begin
      PuppetLint::Data.tokens = lexer.tokenise(content)
      PuppetLint::Data.parse_control_comments
    rescue PuppetLint::LexerError => e
      problems << {
        :kind     => :error,
        :check    => :syntax,
        :message  => 'Syntax error (try running `puppet parser validate <file>`)',
        :line     => e.line_no,
        :column   => e.column,
        :fullpath => PuppetLint::Data.fullpath,
        :path     => PuppetLint::Data.path,
        :filename => PuppetLint::Data.filename,
      }
      PuppetLint::Data.tokens = []
    end
  end
# Internal: Tokenise the manifest code and prepare it for checking.
#
# path    - The path to the file as passed to puppet-lint as a String.
# content - The String manifest code to be checked.
#
# Returns nothing.
Tokenise the manifest code and prepare it for checking.
path    - The path to the file as passed to puppet-lint as a String.
content - The String manifest code to be checked.

Returns nothing.
Tokenise the manifest code and prepare it for checking . path - The path to the file as passed to puppet - lint as a String . content - The String manifest code to be checked . Returns nothing .
def load_data(path, content)
    lexer = PuppetLint::Lexer.new
    PuppetLint::Data.path = path
    PuppetLint::Data.manifest_lines = content.split("\n")
    begin
      PuppetLint::Data.tokens = lexer.tokenise(content)
      PuppetLint::Data.parse_control_comments
    rescue PuppetLint::LexerError => e
      problems << {
        :kind     => :error,
        :check    => :syntax,
        :message  => 'Syntax error (try running `puppet parser validate <file>`)',
        :line     => e.line_no,
        :column   => e.column,
        :fullpath => PuppetLint::Data.fullpath,
        :path     => PuppetLint::Data.path,
        :filename => PuppetLint::Data.filename,
      }
      PuppetLint::Data.tokens = []
    end
  end
def load_data ( path , content ) lexer = PuppetLint :: Lexer . new PuppetLint :: Data . path = path PuppetLint :: Data . manifest_lines = content . split ( "\n" ) begin PuppetLint :: Data . tokens = lexer . tokenise ( content ) PuppetLint :: Data . parse_control_comments rescue PuppetLint :: LexerError => e problems << { :kind => :error , :check => :syntax , :message => 'Syntax error (try running `puppet parser validate <file>`)' , :line => e . line_no , :column => e . column , :fullpath => PuppetLint :: Data . fullpath , :path => PuppetLint :: Data . path , :filename => PuppetLint :: Data . filename , } PuppetLint :: Data . tokens = [ ] end end
Internal: Tokenise the manifest code and prepare it for checking.
Internal : Tokenise the manifest code and prepare it for checking .
path
content