Use IO in print_visitor, and add to_s method.

This commit is contained in:
2018-07-25 14:04:27 -07:00
parent df2a00fd66
commit fbb0da9e44
3 changed files with 17 additions and 11 deletions

View File

@@ -7,6 +7,6 @@ module Chalk
tokens = lexer.lex(File.read("test.txt"))
trees = parser.parse?(tokens)
trees.try do |trees|
trees.each &.accept(PrintVisitor.new)
trees.each { |tree| puts tree }
end
end