lib/sass/tree/rule_node.rb in sass-3.4.24 vs lib/sass/tree/rule_node.rb in sass-3.4.25
- old
+ new
@@ -135,12 +135,21 @@
@parsed_rules = nil
return unless @rule.all? {|t| t.is_a?(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, nil, nil, 1)
- # rubocop:disable RescueModifier
- @parsed_rules = parser.parse_selector rescue nil
- # rubocop:enable RescueModifier
+ parser = nil
+ warnings = Sass::Util.silence_warnings do
+ parser = Sass::SCSS::StaticParser.new(@rule.join.strip, nil, nil, 1)
+ # rubocop:disable RescueModifier
+ @parsed_rules = parser.parse_selector rescue nil
+ # rubocop:enable RescueModifier
+
+ $stderr.string
+ 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?
end
end
end