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 ad6188d1fe Adding Sass syntax errors.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@317 7063305b-7217-0410-af8c-cdc13e5119b9
2007-01-28 10:14:15 +00:00

28 lines
541 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.', @line)
end
result += "#{child.to_s}\n"
end
result[0...-1]
end
end
end
end