1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Rename Tree::PropNode#indentation to #tabs.

This commit is contained in:
Nathan Weizenbaum 2009-10-15 19:34:33 -07:00
parent ec292b91f7
commit e5205d3e2c

View file

@ -24,7 +24,7 @@ module Sass::Tree
# * The parent property has a value, and thus will be rendered # * The parent property has a value, and thus will be rendered
# #
# @return [Fixnum] # @return [Fixnum]
attr_accessor :indentation attr_accessor :tabs
# @param name [String] See \{#name} # @param name [String] See \{#name}
# @param value [String] See \{#value} # @param value [String] See \{#value}
@ -33,7 +33,7 @@ module Sass::Tree
def initialize(name, value, prop_syntax) def initialize(name, value, prop_syntax)
@name = name @name = name
@value = value @value = value
@indentation = 0 @tabs = 0
@prop_syntax = prop_syntax @prop_syntax = prop_syntax
super() super()
end end
@ -65,7 +65,7 @@ module Sass::Tree
raise Sass::SyntaxError.new("Invalid property: #{declaration.dump} (no value).") raise Sass::SyntaxError.new("Invalid property: #{declaration.dump} (no value).")
end end
to_return = ' ' * (tabs - 1 + indentation) + name + ":" + to_return = ' ' * (tabs - 1 + self.tabs) + name + ":" +
(style == :compressed ? '' : ' ') + value + (style == :compressed ? "" : ";") (style == :compressed ? '' : ' ') + value + (style == :compressed ? "" : ";")
end end
@ -74,7 +74,7 @@ module Sass::Tree
# @param parent_name [String, nil] The name of the parent property, # @param parent_name [String, nil] The name of the parent property,
# or nil if there is none # or nil if there is none
# @param tabs [Fixnum] How deeply this property is nested. # @param tabs [Fixnum] How deeply this property is nested.
# See \{#indentation} # See \{#tabs}
def _cssize(parent) def _cssize(parent)
node = super node = super
result = node.children.dup result = node.children.dup
@ -89,7 +89,7 @@ module Sass::Tree
# @param tabs [Fixnum] The extra indentation to use for this property # @param tabs [Fixnum] The extra indentation to use for this property
def cssize!(parent) def cssize!(parent)
self.name = "#{parent.name}-#{name}" if parent self.name = "#{parent.name}-#{name}" if parent
self.indentation = parent.indentation + (parent.value.empty? 0 ? 1) if parent && style == :nested self.tabs = parent.tabs + (parent.value.empty? ? 0 : 1) if parent && style == :nested
super super
end end