summaryrefslogtreecommitdiff
path: root/lib/psych/tree_builder.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-29 10:23:55 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-29 10:23:55 -0700
commit26eee0cd258ef47d595e9ae44e06ccf4d71ced56 (patch)
tree3632e3d2930c740ae05348c643837e22d41d8e5d /lib/psych/tree_builder.rb
parent75fdcc42bb2ce2abb206f01b8e90729dedc8286c (diff)
downloadpsych-26eee0cd258ef47d595e9ae44e06ccf4d71ced56.tar.gz
testing implcit document ends
Diffstat (limited to 'lib/psych/tree_builder.rb')
-rw-r--r--lib/psych/tree_builder.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/psych/tree_builder.rb b/lib/psych/tree_builder.rb
index efbeaf9..089ee96 100644
--- a/lib/psych/tree_builder.rb
+++ b/lib/psych/tree_builder.rb
@@ -17,7 +17,6 @@ module Psych
end
%w{
- Document
Sequence
Mapping
}.each do |node|
@@ -28,12 +27,22 @@ module Psych
@stack.push n
end
- def end_#{node.downcase}(*args)
+ def end_#{node.downcase}
@stack.pop
end
}
end
+ def start_document(*args)
+ n = Nodes::Document.new(*args)
+ @stack.last.children << n
+ @stack.push n
+ end
+
+ def end_document implicit_end
+ @stack.pop.implicit_end = implicit_end
+ end
+
def start_stream encoding
@stack.push Nodes::Stream.new(encoding)
end