Class: Hind::Parser
- Inherits:
-
Object
- Object
- Hind::Parser
- Defined in:
- lib/hind/parser.rb
Instance Method Summary collapse
-
#initialize(code) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(code) ⇒ Parser
5 6 7 |
# File 'lib/hind/parser.rb', line 5 def initialize(code) @code = code end |
Instance Method Details
#parse ⇒ Object
9 10 11 12 13 14 |
# File 'lib/hind/parser.rb', line 9 def parse result = Prism.parse(@code) raise "Parse error: #{result.errors}" unless result.success? result.value end |