made a simple node for small objects. bad news is that tests pass unchanged

This commit is contained in:
Torsten Ruger 2014-08-19 23:16:40 +03:00
parent 8ff55fdb1f
commit d401327319

View File

@ -42,6 +42,7 @@ module Sof
end
immediate , extended = atts.partition {|a,val| val.is_a?(SimpleNode) }
head += immediate.collect {|a,val| "#{a.to_sof()} => #{val.data}"}.join(", ") + ")"
return SimpleNode.new(head) if( ref.nil? and extended.empty? and head.length < 30 )
node = ObjectNode.new(head , ref)
extended.each do |a , val|
node.add( to_sof_node(a,level + 1) , val )