Class: Vinter::Parser
- Inherits:
-
Object
- Object
- Vinter::Parser
- Defined in:
- lib/vinter/parser.rb
Instance Method Summary collapse
-
#initialize(tokens, source_text = nil) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(tokens, source_text = nil) ⇒ Parser
Returns a new instance of Parser.
3 4 5 6 7 8 9 |
# File 'lib/vinter/parser.rb', line 3 def initialize(tokens, source_text = nil) @tokens = tokens @position = 0 @errors = [] @warnings = [] @source_text = source_text end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/vinter/parser.rb', line 11 def parse result = parse_program { ast: result, errors: @errors, warnings: @warnings } end |