From a023b35e7846f173026f60fcac1ee2ba7d0a57c6 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Sat, 14 Feb 2015 22:52:17 +0100 Subject: [PATCH] Fixed the pull parser for the XML LL parser. --- lib/oga/xml/parser.rll | 11 +++++++++++ lib/oga/xml/pull_parser.rb | 4 +--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/oga/xml/parser.rll b/lib/oga/xml/parser.rll index 6e7870c..1e48560 100644 --- a/lib/oga/xml/parser.rll +++ b/lib/oga/xml/parser.rll @@ -262,6 +262,17 @@ string_body_follow yield [-1, -1] end + ## + # @see [LL::Driver#parse] + # + def parse + retval = super + + reset + + return retval + end + ## # @param [Array] children # @return [Oga::XML::Document] diff --git a/lib/oga/xml/pull_parser.rb b/lib/oga/xml/pull_parser.rb index c2242bd..ae78fcb 100644 --- a/lib/oga/xml/pull_parser.rb +++ b/lib/oga/xml/pull_parser.rb @@ -84,9 +84,7 @@ module Oga def parse(&block) @block = block - yyparse(self, :yield_next_token) - - reset + super return end