Module: LintFu::Parser

Defined in:
lib/lint_fu/parser.rb

Class Method Summary collapse

Class Method Details

.parse_ruby(filename) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/lint_fu/parser.rb', line 3

def self.parse_ruby(filename)
  contents = File.read(filename)
  sexp = RubyParser.new.parse(contents, filename)
  return sexp
rescue SyntaxError => e
  e2 = SyntaxError.new "In #{filename}: #{e.message}"
  e2.set_backtrace(e.backtrace)
  raise e2
end