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/comment_node.rb

31 lines
589 B
Ruby
Raw Normal View History

require 'sass/tree/node'
module Sass::Tree
class CommentNode < Node
attr_accessor :value
def initialize(value, options)
@value = value[2..-1].strip
super(options)
end
def ==(other)
self.value == other.value && super
end
def to_s(tabs = 0, parent_name = nil)
return if @style == :compressed
spaces = ' ' * (tabs - 1)
spaces + "/* " + ([value] + children.map {|c| c.text}).
join(@style == :compact ? ' ' : "\n#{spaces} * ") + " */"
end
protected
def _perform(environment)
self
end
end
end