1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/sass/tree/node.rb
nex3 a94b40953a 100% Rcov! Woo-hoo! Yeah!
git-svn-id: svn://hamptoncatlin.com/haml/trunk@325 7063305b-7217-0410-af8c-cdc13e5119b9
2007-01-31 06:38:23 +00:00

28 lines
546 B
Ruby

module Sass
module Tree
class Node
attr_accessor :children
attr_accessor :line
def initialize
@children = []
end
def <<(child)
@children << child
end
def to_s
result = String.new
children.each do |child|
if child.is_a? AttrNode
raise SyntaxError.new('Attributes aren\'t allowed at the root of a document.', child.line)
end
result += "#{child.to_s}\n"
end
result[0...-1]
end
end
end
end