Skip to content

Commit 435bcff

Browse files
committed
Made a new CollectionAssembler class.
The idea is that Parser will handle reading and interpreting the stream, and CollectionAssembler will handle building the collection based on the events it gets from the parser.
1 parent 5e7b20a commit 435bcff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/sgf/parser.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Parser
2222
def parse sgf, strict_parsing = true
2323
error_checker = strict_parsing ? StrictErrorChecker.new : LaxErrorChecker.new
2424
@sgf_stream = SgfStream.new(sgf, error_checker)
25+
@assembler = CollectionAssembler.new
2526
@collection = Collection.new
2627
@current_node = @collection.root
2728
@branches = []
@@ -90,6 +91,11 @@ def property_token_type identity
9091
end
9192
end
9293

94+
class CollectionAssembler
95+
def initialize
96+
end
97+
end
98+
9399
class IdentityToken
94100
def still_inside? char, token_so_far, sgf_stream
95101
char != "["

0 commit comments

Comments
 (0)