Class: Crisp::Parser
- Inherits:
-
Object
- Object
- Crisp::Parser
- Defined in:
- lib/crisp/parser.rb
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(code) ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
5 6 7 |
# File 'lib/crisp/parser.rb', line 5 def initialize @parser = CrispParser.new end |
Instance Method Details
#parse(code) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/crisp/parser.rb', line 9 def parse(code) ast = @parser.parse(code) raise SyntaxError, "syntax error at : #{@parser.index}" if !ast ast end |