Add a MacRuby-friendly regex syntax #432

Closed
wants to merge 2 commits into
from
View
@@ -51,6 +51,8 @@ def self.quote(str, flags = 0)
UNICODE = /\\#{H}{1,6}[ \t\r\n\f]?/
s = if Sass::Util.ruby1_8?
'\200-\377'
+ elsif Sass::Util.macruby?
+ '\u0080-\uD7FF\uE000-\uFFFD\U00010000-\U0010FFFF'
else
'\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{10000}-\u{10FFFF}'
end
View
@@ -465,6 +465,13 @@ def ruby1_8?
def ruby1_8_6?
ruby1_8? && Sass::Util::RUBY_VERSION[2] < 7
end
+
+ # Whether or not this is running under MacRuby.
+ #
+ # @return [Boolean]
+ def macruby?
+ RUBY_ENGINE == 'macruby'
+ end
# Checks that the encoding of a string is valid in Ruby 1.9
# and cleans up potential encoding gotchas like the UTF-8 BOM.