Remove Parser#reset and PullParser#reset

This commit is contained in:
Erik Michaels-Ober 2016-07-09 13:39:51 -07:00 committed by Yorick Peterse
parent c431c2b004
commit 3a89dcffab
No known key found for this signature in database
GPG Key ID: EDD30D2BEB691AC9
3 changed files with 1 additions and 27 deletions

View File

@ -237,14 +237,7 @@ string_body
def initialize(data, options = {})
@data = data
@lexer = Lexer.new(data, options)
reset
end
# Resets the internal state of the parser.
def reset
@line = 1
@lexer.reset_native
end
@ -283,15 +276,6 @@ string_body
raise LL::ParserError, message
end
# @see [LL::Driver#parse]
def parse
retval = super
reset
retval
end
# @param [Array] children
# @return [Oga::XML::Document]
def on_document(children = [])

View File

@ -54,13 +54,9 @@ module Oga
:xml_declaration => XML::XmlDeclaration
}
# @see Oga::XML::Parser#reset
def reset
def initialize(*args)
super
@block = nil
@nesting = []
@node = nil
end
# Parses the input and yields every node to the supplied block.

View File

@ -11,11 +11,5 @@ describe Oga::XML::PullParser do
@parser.node.is_a?(Oga::XML::Element).should == true
end
end
it 'resets the current node after parsing' do
@parser.parse { }
@parser.node.nil?.should == true
end
end
end