lib/sass/tree/rule_node.rb in sass-3.7.4 vs lib/sass/tree/rule_node.rb in sass-4.0.0.alpha.1

- old
+ new

@@ -38,11 +38,11 @@ # * This node is in a CSS tree # * The style is :nested # * This is a child rule of another rule # * The parent rule has properties, and thus will be rendered # - # @return [Integer] + # @return [Fixnum] attr_accessor :tabs # The entire selector source range for this rule. # @return [Sass::Source::Range] attr_accessor :selector_source_range @@ -118,36 +118,29 @@ # This data is used by e.g. [the FireSass Firebug # extension](https://addons.mozilla.org/en-US/firefox/addon/103988). # # @return [{#to_s => #to_s}] def debug_info - {:filename => filename && - ("file://" + URI::DEFAULT_PARSER.escape(File.expand_path(filename))), + {:filename => filename && ("file://" + Sass::Util.escape_uri(File.expand_path(filename))), :line => line} end # A rule node is invisible if it has only placeholder selectors. def invisible? - resolved_rules.members.all? {|seq| seq.invisible?} + resolved_rules.members.all? {|seq| seq.has_placeholder?} end private def try_to_parse_non_interpolated_rules @parsed_rules = nil - return unless @rule.all? {|t| t.is_a?(String)} + return unless @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 = nil - warnings = Sass.logger.capture do - parser = Sass::SCSS::StaticParser.new( - Sass::Util.strip_except_escapes(@rule.join), nil, nil, 1) - @parsed_rules = parser.parse_selector rescue nil - end - - # If parsing produces a warning, throw away the result so we can parse - # later with the real filename info. - @parsed_rules = nil unless warnings.empty? + parser = Sass::SCSS::StaticParser.new(@rule.join.strip, nil, nil, 1) + # rubocop:disable RescueModifier + @parsed_rules = parser.parse_selector rescue nil + # rubocop:enable RescueModifier end end end