summaryrefslogtreecommitdiff
path: root/lib/rexml/parsers/lightparser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/parsers/lightparser.rb')
-rw-r--r--lib/rexml/parsers/lightparser.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/rexml/parsers/lightparser.rb b/lib/rexml/parsers/lightparser.rb
index e2f083bc8e..8c555f7960 100644
--- a/lib/rexml/parsers/lightparser.rb
+++ b/lib/rexml/parsers/lightparser.rb
@@ -16,25 +16,25 @@ module REXML
end
def parse
- root = context = REXML::Light::Node.new([ :document ])
+ root = context = [ :document ]
while true
event = @parser.pull
case event[0]
when :end_document
break
when :end_doctype
- context = context.parent
+ context = context[1]
when :start_element, :start_doctype
- new_node = REXML::Light::Node.new(event)
+ new_node = event
context << new_node
- new_node.parent = context
+ new_node[1,0] = [context]
context = new_node
when :end_element, :end_doctype
- context = context.parent
+ context = context[1]
else
- new_node = REXML::Light::Node.new(event)
+ new_node = event
context << new_node
- new_node.parent = context
+ new_node[1,0] = [context]
end
end
root