sassc 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/libsass/ast.cpp +124 -43
- data/ext/libsass/ast.hpp +15 -7
- data/ext/libsass/bind.cpp +57 -10
- data/ext/libsass/context.cpp +9 -7
- data/ext/libsass/contextualize.cpp +7 -0
- data/ext/libsass/contextualize_eval.cpp +1 -1
- data/ext/libsass/debugger.hpp +27 -70
- data/ext/libsass/emitter.cpp +5 -2
- data/ext/libsass/emitter.hpp +7 -1
- data/ext/libsass/eval.cpp +27 -13
- data/ext/libsass/expand.cpp +2 -2
- data/ext/libsass/functions.cpp +34 -9
- data/ext/libsass/functions.hpp +2 -0
- data/ext/libsass/inspect.cpp +111 -39
- data/ext/libsass/lexer.cpp +8 -8
- data/ext/libsass/lexer.hpp +8 -8
- data/ext/libsass/output.cpp +13 -5
- data/ext/libsass/parser.cpp +185 -46
- data/ext/libsass/parser.hpp +4 -0
- data/ext/libsass/prelexer.cpp +58 -7
- data/ext/libsass/prelexer.hpp +20 -2
- data/ext/libsass/sass_values.cpp +1 -1
- data/ext/libsass/sass_values.h +1 -1
- data/ext/libsass/to_string.cpp +3 -3
- data/ext/libsass/to_string.hpp +2 -1
- data/ext/libsass/units.cpp +134 -34
- data/ext/libsass/units.hpp +78 -4
- data/ext/libsass/util.cpp +8 -10
- data/ext/libsass/util.hpp +1 -1
- data/lib/sassc/engine.rb +7 -3
- data/lib/sassc/version.rb +1 -1
- data/test/native_test.rb +1 -1
- data/test/output_style_test.rb +7 -0
- metadata +2 -2
data/ext/libsass/util.cpp
CHANGED
@@ -262,21 +262,15 @@ namespace Sass {
|
|
262
262
|
{
|
263
263
|
bool ws = false;
|
264
264
|
bool esc = false;
|
265
|
-
char inside_str = 0;
|
266
265
|
string text = "";
|
267
|
-
for(
|
266
|
+
for(const char& i : str) {
|
268
267
|
if (!esc && i == '\\') {
|
269
268
|
esc = true;
|
269
|
+
ws = false;
|
270
270
|
text += i;
|
271
271
|
} else if (esc) {
|
272
272
|
esc = false;
|
273
|
-
|
274
|
-
} else if (!inside_str && (i == '"' || i == '\'')) {
|
275
|
-
inside_str = i;
|
276
|
-
text += i;
|
277
|
-
} else if (inside_str) {
|
278
|
-
if (i == inside_str)
|
279
|
-
inside_str = false;
|
273
|
+
ws = false;
|
280
274
|
text += i;
|
281
275
|
} else if (
|
282
276
|
i == ' ' ||
|
@@ -401,7 +395,7 @@ namespace Sass {
|
|
401
395
|
|
402
396
|
}
|
403
397
|
|
404
|
-
string quote(const string& s, char q)
|
398
|
+
string quote(const string& s, char q, bool keep_linefeed_whitespace)
|
405
399
|
{
|
406
400
|
|
407
401
|
// autodetect with fallback to given quote
|
@@ -430,6 +424,10 @@ namespace Sass {
|
|
430
424
|
if (cp == 10) {
|
431
425
|
quoted.push_back('\\');
|
432
426
|
quoted.push_back('a');
|
427
|
+
// we hope we can remove this flag once we figure out
|
428
|
+
// why ruby sass has these different output behaviors
|
429
|
+
if (keep_linefeed_whitespace)
|
430
|
+
quoted.push_back(' ');
|
433
431
|
} else if (cp < 127) {
|
434
432
|
quoted.push_back((char) cp);
|
435
433
|
} else {
|
data/ext/libsass/util.hpp
CHANGED
@@ -21,7 +21,7 @@ namespace Sass {
|
|
21
21
|
string comment_to_string(const string& text);
|
22
22
|
string normalize_wspace(const string& str);
|
23
23
|
|
24
|
-
string quote(const string&, char q = 0);
|
24
|
+
string quote(const string&, char q = 0, bool keep_linefeed_whitespace = false);
|
25
25
|
string unquote(const string&, char* q = 0);
|
26
26
|
char detect_best_quotemark(const char* s, char qm = '"');
|
27
27
|
|
data/lib/sassc/engine.rb
CHANGED
@@ -77,9 +77,13 @@ module SassC
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def output_style
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
@output_style ||= begin
|
81
|
+
style = @options.fetch(:style, :sass_style_nested).to_s
|
82
|
+
style = "sass_style_#{style}" unless style.include?("sass_style_")
|
83
|
+
style = style.to_sym
|
84
|
+
raise InvalidStyleError unless Native::SassOutputStyle.symbols.include?(style)
|
85
|
+
style
|
86
|
+
end
|
83
87
|
end
|
84
88
|
|
85
89
|
def load_paths
|
data/lib/sassc/version.rb
CHANGED
data/test/native_test.rb
CHANGED
data/test/output_style_test.rb
CHANGED
@@ -91,6 +91,13 @@ CSS
|
|
91
91
|
def test_compressed_output
|
92
92
|
engine = Engine.new(input_scss, style: :sass_style_compressed)
|
93
93
|
assert_equal <<-CSS, engine.render
|
94
|
+
#main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
|
95
|
+
CSS
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_short_output_style_names
|
99
|
+
engine = Engine.new(input_scss, style: :compressed)
|
100
|
+
assert_equal <<-CSS, engine.render
|
94
101
|
#main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
|
95
102
|
CSS
|
96
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sassc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Boland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|