lib/sass/tree/rule_node.rb in sass-3.2.0.alpha.11 vs lib/sass/tree/rule_node.rb in sass-3.2.0.alpha.21
- old
+ new
@@ -48,10 +48,17 @@
# This is only set in a CSS tree.
#
# @return [Boolean]
attr_accessor :group_end
+ # The stack trace.
+ # This is only readable in a CSS tree as it is written during the perform step
+ # and only when the :trace_selectors option is set.
+ #
+ # @return [Array<String>]
+ attr_accessor :stack_trace
+
# @param rule [Array<String, Sass::Script::Node>]
# The CSS rule. See \{#rule}
def initialize(rule)
merged = Sass::Util.merge_adjacent_strings(rule)
@rule = Sass::Util.strip_string_array(merged)
@@ -113,22 +120,17 @@
def debug_info
{:filename => filename && ("file://" + URI.escape(File.expand_path(filename))),
:line => self.line}
end
- # Returns sub nodes that are not tree children.
- def subnodes
- rule.select{|r| r.is_a?(Sass::Script::Node)}
- end
-
private
def try_to_parse_non_interpolated_rules
if @rule.all? {|t| t.kind_of?(String)}
# We don't use real filename/line info because we don't have it yet.
# When we get it, we'll set it on the parsed rules if possible.
- parser = Sass::SCSS::StaticParser.new(@rule.join.strip, 1)
- @parsed_rules = parser.parse_selector('') rescue nil
+ parser = Sass::SCSS::StaticParser.new(@rule.join.strip, '', 1)
+ @parsed_rules = parser.parse_selector rescue nil
end
end
end
end