Class: Orbacle::RubyParser
- Inherits:
-
Object
- Object
- Orbacle::RubyParser
- Defined in:
- lib/orbacle/ruby_parser.rb
Constant Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ RubyParser
constructor
A new instance of RubyParser.
- #parse(content) ⇒ Object
Constructor Details
#initialize ⇒ RubyParser
Returns a new instance of RubyParser.
11 12 13 14 15 16 17 18 19 |
# File 'lib/orbacle/ruby_parser.rb', line 11 def initialize @my_parser = Class.new(Parser::Ruby25) do def self.default_parser my_parser = super() my_parser.diagnostics.consumer = nil my_parser end end end |
Instance Method Details
#parse(content) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/orbacle/ruby_parser.rb', line 21 def parse(content) @my_parser.parse(content) rescue Parser::SyntaxError raise SyntaxError rescue ::EncodingError raise EncodingError end |