Skip to content

Commit

Permalink
Made a new CollectionAssembler class.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
moss committed Sep 13, 2012
1 parent 5e7b20a commit 435bcff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/sgf/parser.rb
Expand Up @@ -22,6 +22,7 @@ class Parser
def parse sgf, strict_parsing = true
error_checker = strict_parsing ? StrictErrorChecker.new : LaxErrorChecker.new
@sgf_stream = SgfStream.new(sgf, error_checker)
@assembler = CollectionAssembler.new
@collection = Collection.new
@current_node = @collection.root
@branches = []
Expand Down Expand Up @@ -90,6 +91,11 @@ def property_token_type identity
end
end

class CollectionAssembler
def initialize
end
end

class IdentityToken
def still_inside? char, token_so_far, sgf_stream
char != "["
Expand Down

0 comments on commit 435bcff

Please sign in to comment.