sassc 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.gitmodules +3 -0
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +24 -0
- data/Rakefile +21 -0
- data/ext/libsass/.editorconfig +15 -0
- data/ext/libsass/.gitattributes +2 -0
- data/ext/libsass/.gitignore +61 -0
- data/ext/libsass/.travis.yml +38 -0
- data/ext/libsass/COPYING +25 -0
- data/ext/libsass/INSTALL +1 -0
- data/ext/libsass/LICENSE +25 -0
- data/ext/libsass/Makefile +223 -0
- data/ext/libsass/Makefile.am +145 -0
- data/ext/libsass/Readme.md +93 -0
- data/ext/libsass/appveyor.yml +76 -0
- data/ext/libsass/ast.cpp +581 -0
- data/ext/libsass/ast.hpp +1949 -0
- data/ext/libsass/ast_def_macros.hpp +16 -0
- data/ext/libsass/ast_factory.hpp +87 -0
- data/ext/libsass/ast_fwd_decl.hpp +72 -0
- data/ext/libsass/b64/cencode.h +32 -0
- data/ext/libsass/b64/encode.h +77 -0
- data/ext/libsass/backtrace.hpp +81 -0
- data/ext/libsass/base64vlq.cpp +43 -0
- data/ext/libsass/base64vlq.hpp +28 -0
- data/ext/libsass/bind.cpp +187 -0
- data/ext/libsass/bind.hpp +18 -0
- data/ext/libsass/cencode.c +102 -0
- data/ext/libsass/color_names.hpp +324 -0
- data/ext/libsass/configure.ac +130 -0
- data/ext/libsass/constants.cpp +144 -0
- data/ext/libsass/constants.hpp +145 -0
- data/ext/libsass/context.cpp +507 -0
- data/ext/libsass/context.hpp +150 -0
- data/ext/libsass/contextualize.cpp +157 -0
- data/ext/libsass/contextualize.hpp +65 -0
- data/ext/libsass/copy_c_str.cpp +13 -0
- data/ext/libsass/copy_c_str.hpp +5 -0
- data/ext/libsass/debug.hpp +39 -0
- data/ext/libsass/environment.hpp +75 -0
- data/ext/libsass/error_handling.cpp +28 -0
- data/ext/libsass/error_handling.hpp +28 -0
- data/ext/libsass/eval.cpp +1149 -0
- data/ext/libsass/eval.hpp +80 -0
- data/ext/libsass/expand.cpp +430 -0
- data/ext/libsass/expand.hpp +77 -0
- data/ext/libsass/extconf.rb +6 -0
- data/ext/libsass/extend.cpp +1962 -0
- data/ext/libsass/extend.hpp +50 -0
- data/ext/libsass/file.cpp +291 -0
- data/ext/libsass/file.hpp +18 -0
- data/ext/libsass/functions.cpp +1565 -0
- data/ext/libsass/functions.hpp +187 -0
- data/ext/libsass/inspect.cpp +727 -0
- data/ext/libsass/inspect.hpp +108 -0
- data/ext/libsass/json.cpp +1411 -0
- data/ext/libsass/json.hpp +117 -0
- data/ext/libsass/kwd_arg_macros.hpp +23 -0
- data/ext/libsass/m4/.gitkeep +0 -0
- data/ext/libsass/mapping.hpp +17 -0
- data/ext/libsass/memory_manager.hpp +54 -0
- data/ext/libsass/node.cpp +251 -0
- data/ext/libsass/node.hpp +122 -0
- data/ext/libsass/operation.hpp +153 -0
- data/ext/libsass/output_compressed.cpp +401 -0
- data/ext/libsass/output_compressed.hpp +95 -0
- data/ext/libsass/output_nested.cpp +364 -0
- data/ext/libsass/output_nested.hpp +108 -0
- data/ext/libsass/parser.cpp +2016 -0
- data/ext/libsass/parser.hpp +264 -0
- data/ext/libsass/paths.hpp +69 -0
- data/ext/libsass/position.hpp +22 -0
- data/ext/libsass/posix/getopt.c +562 -0
- data/ext/libsass/posix/getopt.h +95 -0
- data/ext/libsass/prelexer.cpp +688 -0
- data/ext/libsass/prelexer.hpp +513 -0
- data/ext/libsass/remove_placeholders.cpp +59 -0
- data/ext/libsass/remove_placeholders.hpp +43 -0
- data/ext/libsass/res/resource.rc +35 -0
- data/ext/libsass/sass.cpp +33 -0
- data/ext/libsass/sass.h +60 -0
- data/ext/libsass/sass2scss.cpp +834 -0
- data/ext/libsass/sass2scss.h +110 -0
- data/ext/libsass/sass_context.cpp +709 -0
- data/ext/libsass/sass_context.h +120 -0
- data/ext/libsass/sass_functions.cpp +137 -0
- data/ext/libsass/sass_functions.h +90 -0
- data/ext/libsass/sass_interface.cpp +277 -0
- data/ext/libsass/sass_interface.h +97 -0
- data/ext/libsass/sass_util.cpp +136 -0
- data/ext/libsass/sass_util.hpp +259 -0
- data/ext/libsass/sass_values.cpp +337 -0
- data/ext/libsass/sass_values.h +124 -0
- data/ext/libsass/script/bootstrap +10 -0
- data/ext/libsass/script/branding +10 -0
- data/ext/libsass/script/ci-build-libsass +72 -0
- data/ext/libsass/script/ci-install-compiler +4 -0
- data/ext/libsass/script/ci-install-deps +19 -0
- data/ext/libsass/script/ci-report-coverage +25 -0
- data/ext/libsass/script/coveralls-debug +32 -0
- data/ext/libsass/script/spec +5 -0
- data/ext/libsass/script/tap-driver +652 -0
- data/ext/libsass/script/tap-runner +1 -0
- data/ext/libsass/source_map.cpp +133 -0
- data/ext/libsass/source_map.hpp +46 -0
- data/ext/libsass/subset_map.hpp +145 -0
- data/ext/libsass/support/libsass.pc.in +11 -0
- data/ext/libsass/test-driver +127 -0
- data/ext/libsass/test/test_node.cpp +98 -0
- data/ext/libsass/test/test_paths.cpp +29 -0
- data/ext/libsass/test/test_selector_difference.cpp +28 -0
- data/ext/libsass/test/test_specificity.cpp +28 -0
- data/ext/libsass/test/test_subset_map.cpp +472 -0
- data/ext/libsass/test/test_superselector.cpp +71 -0
- data/ext/libsass/test/test_unification.cpp +33 -0
- data/ext/libsass/to_c.cpp +61 -0
- data/ext/libsass/to_c.hpp +44 -0
- data/ext/libsass/to_string.cpp +29 -0
- data/ext/libsass/to_string.hpp +32 -0
- data/ext/libsass/token.hpp +32 -0
- data/ext/libsass/units.cpp +54 -0
- data/ext/libsass/units.hpp +10 -0
- data/ext/libsass/utf8.h +34 -0
- data/ext/libsass/utf8/checked.h +327 -0
- data/ext/libsass/utf8/core.h +329 -0
- data/ext/libsass/utf8/unchecked.h +228 -0
- data/ext/libsass/utf8_string.cpp +102 -0
- data/ext/libsass/utf8_string.hpp +36 -0
- data/ext/libsass/util.cpp +189 -0
- data/ext/libsass/util.hpp +26 -0
- data/ext/libsass/win/libsass.filters +291 -0
- data/ext/libsass/win/libsass.sln +28 -0
- data/ext/libsass/win/libsass.vcxproj +255 -0
- data/lib/sassc.rb +6 -0
- data/lib/sassc/engine.rb +13 -0
- data/lib/sassc/native.rb +44 -0
- data/lib/sassc/native/native_context_api.rb +140 -0
- data/lib/sassc/native/native_functions_api.rb +41 -0
- data/lib/sassc/native/sass_input_style.rb +11 -0
- data/lib/sassc/native/sass_output_style.rb +10 -0
- data/lib/sassc/native/sass_value.rb +95 -0
- data/lib/sassc/native/string_list.rb +8 -0
- data/lib/sassc/version.rb +3 -0
- data/sassc.gemspec +43 -0
- data/test/smoke_test.rb +171 -0
- data/test/test_helper.rb +4 -0
- metadata +281 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#ifndef SASS_UTF8_STRING
|
|
2
|
+
#define SASS_UTF8_STRING
|
|
3
|
+
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <vector>
|
|
6
|
+
#include <cstdlib>
|
|
7
|
+
#include <cmath>
|
|
8
|
+
|
|
9
|
+
#include "utf8.h"
|
|
10
|
+
|
|
11
|
+
namespace Sass {
|
|
12
|
+
namespace UTF_8 {
|
|
13
|
+
using std::string;
|
|
14
|
+
|
|
15
|
+
// naming conventions:
|
|
16
|
+
// offset: raw byte offset (0 based)
|
|
17
|
+
// position: code point offset (0 based)
|
|
18
|
+
// index: code point offset (1 based or negative)
|
|
19
|
+
|
|
20
|
+
// function that will count the number of code points (utf-8 characters) from the given beginning to the given end
|
|
21
|
+
size_t code_point_count(const string& str, size_t start, size_t end) {
|
|
22
|
+
return utf8::distance(str.begin() + start, str.begin() + end);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
size_t code_point_count(const string& str) {
|
|
26
|
+
return utf8::distance(str.begin(), str.end());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// function that will return the byte offset at a code point position
|
|
30
|
+
size_t offset_at_position(const string& str, size_t position) {
|
|
31
|
+
string::const_iterator it = str.begin();
|
|
32
|
+
utf8::advance(it, position, str.end());
|
|
33
|
+
return distance(str.begin(), it);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// function that returns number of bytes in a character at offset
|
|
37
|
+
size_t code_point_size_at_offset(const string& str, size_t offset) {
|
|
38
|
+
// get iterator from string and forward by offset
|
|
39
|
+
string::const_iterator stop = str.begin() + offset;
|
|
40
|
+
// check if beyond boundary
|
|
41
|
+
if (stop == str.end()) return 0;
|
|
42
|
+
// advance by one code point
|
|
43
|
+
utf8::advance(stop, 1, str.end());
|
|
44
|
+
// calculate offset for code point
|
|
45
|
+
return stop - str.begin() - offset;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// function that will return a normalized index, given a crazy one
|
|
49
|
+
size_t normalize_index(int index, size_t len) {
|
|
50
|
+
long signed_len = static_cast<long>(len);
|
|
51
|
+
// assuming the index is 1-based
|
|
52
|
+
// we are returning a 0-based index
|
|
53
|
+
if (index > 0 && index <= signed_len) {
|
|
54
|
+
// positive and within string length
|
|
55
|
+
return index-1;
|
|
56
|
+
}
|
|
57
|
+
else if (index > signed_len) {
|
|
58
|
+
// positive and past string length
|
|
59
|
+
return len;
|
|
60
|
+
}
|
|
61
|
+
else if (index == 0) {
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
else if (std::abs((double)index) <= signed_len) {
|
|
65
|
+
// negative and within string length
|
|
66
|
+
return index + signed_len;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// negative and past string length
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// utf16 functions
|
|
75
|
+
using std::wstring;
|
|
76
|
+
|
|
77
|
+
// convert from utf16/wide string to utf8 string
|
|
78
|
+
string convert_from_utf16(const wstring& utf16)
|
|
79
|
+
{
|
|
80
|
+
string utf8;
|
|
81
|
+
// pre-allocate expected memory
|
|
82
|
+
utf8.reserve(sizeof(utf16)/2);
|
|
83
|
+
utf8::utf16to8(utf16.begin(), utf16.end(),
|
|
84
|
+
back_inserter(utf8));
|
|
85
|
+
return utf8;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// convert from utf8 string to utf16/wide string
|
|
89
|
+
wstring convert_to_utf16(const string& utf8)
|
|
90
|
+
{
|
|
91
|
+
wstring utf16;
|
|
92
|
+
// pre-allocate expected memory
|
|
93
|
+
utf16.reserve(code_point_count(utf8)*2);
|
|
94
|
+
utf8::utf8to16(utf8.begin(), utf8.end(),
|
|
95
|
+
back_inserter(utf16));
|
|
96
|
+
return utf16;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#endif
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#ifndef SASS_UTF8_STRING
|
|
2
|
+
#define SASS_UTF8_STRING
|
|
3
|
+
|
|
4
|
+
#include <string>
|
|
5
|
+
|
|
6
|
+
namespace Sass {
|
|
7
|
+
namespace UTF_8 {
|
|
8
|
+
|
|
9
|
+
// naming conventions:
|
|
10
|
+
// offset: raw byte offset (0 based)
|
|
11
|
+
// position: code point offset (0 based)
|
|
12
|
+
// index: code point offset (1 based or negative)
|
|
13
|
+
|
|
14
|
+
// function that will count the number of code points (utf-8 characters) from the beginning to the given end
|
|
15
|
+
size_t code_point_count(const string& str, size_t start, size_t end);
|
|
16
|
+
size_t code_point_count(const string& str);
|
|
17
|
+
|
|
18
|
+
// function that will return the byte offset of a code point in a
|
|
19
|
+
size_t offset_at_position(const string& str, size_t position);
|
|
20
|
+
|
|
21
|
+
// function that returns number of bytes in a character in a string
|
|
22
|
+
size_t code_point_size_at_offset(const string& str, size_t offset);
|
|
23
|
+
|
|
24
|
+
// function that will return a normalized index, given a crazy one
|
|
25
|
+
size_t normalize_index(int index, size_t len);
|
|
26
|
+
|
|
27
|
+
#ifdef _WIN32
|
|
28
|
+
// functions to handle unicode paths on windows
|
|
29
|
+
string convert_from_utf16(const wstring& wstr);
|
|
30
|
+
wstring convert_to_utf16(const string& str);
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#endif
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
#include "util.hpp"
|
|
2
|
+
|
|
3
|
+
namespace Sass {
|
|
4
|
+
namespace Util {
|
|
5
|
+
using std::string;
|
|
6
|
+
|
|
7
|
+
string normalize_underscores(const string& str) {
|
|
8
|
+
string normalized = str;
|
|
9
|
+
for(size_t i = 0, L = normalized.length(); i < L; ++i) {
|
|
10
|
+
if(normalized[i] == '_') {
|
|
11
|
+
normalized[i] = '-';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return normalized;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
string normalize_decimals(const string& str) {
|
|
18
|
+
string prefix = "0";
|
|
19
|
+
string normalized = str;
|
|
20
|
+
|
|
21
|
+
return normalized[0] == '.' ? normalized.insert(0, prefix) : normalized;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// compress a color sixtuplet if possible
|
|
25
|
+
// input: "#CC9900" -> output: "#C90"
|
|
26
|
+
string normalize_sixtuplet(const string& col) {
|
|
27
|
+
if(
|
|
28
|
+
col.substr(1, 1) == col.substr(2, 1) &&
|
|
29
|
+
col.substr(3, 1) == col.substr(4, 1) &&
|
|
30
|
+
col.substr(5, 1) == col.substr(6, 1)
|
|
31
|
+
) {
|
|
32
|
+
return string("#" + col.substr(1, 1)
|
|
33
|
+
+ col.substr(3, 1)
|
|
34
|
+
+ col.substr(5, 1));
|
|
35
|
+
} else {
|
|
36
|
+
return string(col);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
bool isPrintable(Ruleset* r) {
|
|
41
|
+
if (r == NULL) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Block* b = r->block();
|
|
46
|
+
|
|
47
|
+
bool hasSelectors = static_cast<Selector_List*>(r->selector())->length() > 0;
|
|
48
|
+
|
|
49
|
+
if (!hasSelectors) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
bool hasDeclarations = false;
|
|
54
|
+
bool hasPrintableChildBlocks = false;
|
|
55
|
+
for (size_t i = 0, L = b->length(); i < L; ++i) {
|
|
56
|
+
Statement* stm = (*b)[i];
|
|
57
|
+
if (dynamic_cast<Has_Block*>(stm)) {
|
|
58
|
+
Block* pChildBlock = ((Has_Block*)stm)->block();
|
|
59
|
+
if (isPrintable(pChildBlock)) {
|
|
60
|
+
hasPrintableChildBlocks = true;
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
hasDeclarations = true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (hasDeclarations || hasPrintableChildBlocks) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
bool isPrintable(Feature_Block* f) {
|
|
75
|
+
if (f == NULL) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Block* b = f->block();
|
|
80
|
+
|
|
81
|
+
bool hasSelectors = f->selector() && static_cast<Selector_List*>(f->selector())->length() > 0;
|
|
82
|
+
|
|
83
|
+
bool hasDeclarations = false;
|
|
84
|
+
bool hasPrintableChildBlocks = false;
|
|
85
|
+
for (size_t i = 0, L = b->length(); i < L; ++i) {
|
|
86
|
+
Statement* stm = (*b)[i];
|
|
87
|
+
if (!stm->is_hoistable() && f->selector() != NULL && !hasSelectors) {
|
|
88
|
+
// If a statement isn't hoistable, the selectors apply to it. If there are no selectors (a selector list of length 0),
|
|
89
|
+
// then those statements aren't considered printable. That means there was a placeholder that was removed. If the selector
|
|
90
|
+
// is NULL, then that means there was never a wrapping selector and it is printable (think of a top level media block with
|
|
91
|
+
// a declaration in it).
|
|
92
|
+
}
|
|
93
|
+
else if (typeid(*stm) == typeid(Declaration) || typeid(*stm) == typeid(At_Rule)) {
|
|
94
|
+
hasDeclarations = true;
|
|
95
|
+
}
|
|
96
|
+
else if (dynamic_cast<Has_Block*>(stm)) {
|
|
97
|
+
Block* pChildBlock = ((Has_Block*)stm)->block();
|
|
98
|
+
if (isPrintable(pChildBlock)) {
|
|
99
|
+
hasPrintableChildBlocks = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (hasDeclarations || hasPrintableChildBlocks) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
bool isPrintable(Media_Block* m) {
|
|
112
|
+
if (m == NULL) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Block* b = m->block();
|
|
117
|
+
|
|
118
|
+
bool hasSelectors = m->selector() && static_cast<Selector_List*>(m->selector())->length() > 0;
|
|
119
|
+
|
|
120
|
+
bool hasDeclarations = false;
|
|
121
|
+
bool hasPrintableChildBlocks = false;
|
|
122
|
+
for (size_t i = 0, L = b->length(); i < L; ++i) {
|
|
123
|
+
Statement* stm = (*b)[i];
|
|
124
|
+
if (!stm->is_hoistable() && m->selector() != NULL && !hasSelectors) {
|
|
125
|
+
// If a statement isn't hoistable, the selectors apply to it. If there are no selectors (a selector list of length 0),
|
|
126
|
+
// then those statements aren't considered printable. That means there was a placeholder that was removed. If the selector
|
|
127
|
+
// is NULL, then that means there was never a wrapping selector and it is printable (think of a top level media block with
|
|
128
|
+
// a declaration in it).
|
|
129
|
+
}
|
|
130
|
+
else if (typeid(*stm) == typeid(Declaration) || typeid(*stm) == typeid(At_Rule)) {
|
|
131
|
+
hasDeclarations = true;
|
|
132
|
+
}
|
|
133
|
+
else if (dynamic_cast<Has_Block*>(stm)) {
|
|
134
|
+
Block* pChildBlock = ((Has_Block*)stm)->block();
|
|
135
|
+
if (isPrintable(pChildBlock)) {
|
|
136
|
+
hasPrintableChildBlocks = true;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (hasDeclarations || hasPrintableChildBlocks) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
bool isPrintable(Block* b) {
|
|
149
|
+
if (b == NULL) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
for (size_t i = 0, L = b->length(); i < L; ++i) {
|
|
154
|
+
Statement* stm = (*b)[i];
|
|
155
|
+
if (typeid(*stm) == typeid(Declaration) || typeid(*stm) == typeid(At_Rule)) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
else if (typeid(*stm) == typeid(Ruleset)) {
|
|
159
|
+
Ruleset* r = (Ruleset*) stm;
|
|
160
|
+
if (isPrintable(r)) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else if (typeid(*stm) == typeid(Feature_Block)) {
|
|
165
|
+
Feature_Block* f = (Feature_Block*) stm;
|
|
166
|
+
if (isPrintable(f)) {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else if (typeid(*stm) == typeid(Media_Block)) {
|
|
171
|
+
Media_Block* m = (Media_Block*) stm;
|
|
172
|
+
if (isPrintable(m)) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else if (dynamic_cast<Has_Block*>(stm) && isPrintable(((Has_Block*)stm)->block())) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
bool isAscii(int ch) {
|
|
185
|
+
return ch >= 0 && ch < 128;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#ifndef SASS_UTIL
|
|
2
|
+
#define SASS_UTIL
|
|
3
|
+
|
|
4
|
+
#ifndef SASS_AST
|
|
5
|
+
#include "ast.hpp"
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#include <string>
|
|
9
|
+
namespace Sass {
|
|
10
|
+
namespace Util {
|
|
11
|
+
|
|
12
|
+
std::string normalize_underscores(const std::string& str);
|
|
13
|
+
std::string normalize_decimals(const std::string& str);
|
|
14
|
+
std::string normalize_sixtuplet(const std::string& col);
|
|
15
|
+
|
|
16
|
+
bool containsAnyPrintableStatements(Block* b);
|
|
17
|
+
|
|
18
|
+
bool isPrintable(Ruleset* r);
|
|
19
|
+
bool isPrintable(Feature_Block* r);
|
|
20
|
+
bool isPrintable(Media_Block* r);
|
|
21
|
+
bool isPrintable(Block* b);
|
|
22
|
+
bool isAscii(int ch);
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
#endif
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<ItemGroup>
|
|
4
|
+
<Filter Include="Source Files">
|
|
5
|
+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
6
|
+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
7
|
+
</Filter>
|
|
8
|
+
<Filter Include="Header Files">
|
|
9
|
+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
10
|
+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
|
11
|
+
</Filter>
|
|
12
|
+
<Filter Include="Resource Files">
|
|
13
|
+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
14
|
+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
15
|
+
</Filter>
|
|
16
|
+
</ItemGroup>
|
|
17
|
+
<ItemGroup>
|
|
18
|
+
<ClCompile Include="..\sassc\sassc.c">
|
|
19
|
+
<Filter>Source Files</Filter>
|
|
20
|
+
</ClCompile>
|
|
21
|
+
<ClCompile Include="..\posix\getopt.c">
|
|
22
|
+
<Filter>Source Files</Filter>
|
|
23
|
+
</ClCompile>
|
|
24
|
+
<ClCompile Include="..\ast.cpp">
|
|
25
|
+
<Filter>Source Files</Filter>
|
|
26
|
+
</ClCompile>
|
|
27
|
+
<ClCompile Include="..\base64vlq.cpp">
|
|
28
|
+
<Filter>Source Files</Filter>
|
|
29
|
+
</ClCompile>
|
|
30
|
+
<ClCompile Include="..\bind.cpp">
|
|
31
|
+
<Filter>Source Files</Filter>
|
|
32
|
+
</ClCompile>
|
|
33
|
+
<ClCompile Include="..\constants.cpp">
|
|
34
|
+
<Filter>Source Files</Filter>
|
|
35
|
+
</ClCompile>
|
|
36
|
+
<ClCompile Include="..\context.cpp">
|
|
37
|
+
<Filter>Source Files</Filter>
|
|
38
|
+
</ClCompile>
|
|
39
|
+
<ClCompile Include="..\contextualize.cpp">
|
|
40
|
+
<Filter>Source Files</Filter>
|
|
41
|
+
</ClCompile>
|
|
42
|
+
<ClCompile Include="..\copy_c_str.cpp">
|
|
43
|
+
<Filter>Source Files</Filter>
|
|
44
|
+
</ClCompile>
|
|
45
|
+
<ClCompile Include="..\error_handling.cpp">
|
|
46
|
+
<Filter>Source Files</Filter>
|
|
47
|
+
</ClCompile>
|
|
48
|
+
<ClCompile Include="..\eval.cpp">
|
|
49
|
+
<Filter>Source Files</Filter>
|
|
50
|
+
</ClCompile>
|
|
51
|
+
<ClCompile Include="..\expand.cpp">
|
|
52
|
+
<Filter>Source Files</Filter>
|
|
53
|
+
</ClCompile>
|
|
54
|
+
<ClCompile Include="..\extend.cpp">
|
|
55
|
+
<Filter>Source Files</Filter>
|
|
56
|
+
</ClCompile>
|
|
57
|
+
<ClCompile Include="..\file.cpp">
|
|
58
|
+
<Filter>Source Files</Filter>
|
|
59
|
+
</ClCompile>
|
|
60
|
+
<ClCompile Include="..\functions.cpp">
|
|
61
|
+
<Filter>Source Files</Filter>
|
|
62
|
+
</ClCompile>
|
|
63
|
+
<ClCompile Include="..\inspect.cpp">
|
|
64
|
+
<Filter>Source Files</Filter>
|
|
65
|
+
</ClCompile>
|
|
66
|
+
<ClCompile Include="..\node.cpp">
|
|
67
|
+
<Filter>Source Files</Filter>
|
|
68
|
+
</ClCompile>
|
|
69
|
+
<ClCompile Include="..\output_compressed.cpp">
|
|
70
|
+
<Filter>Source Files</Filter>
|
|
71
|
+
</ClCompile>
|
|
72
|
+
<ClCompile Include="..\output_nested.cpp">
|
|
73
|
+
<Filter>Source Files</Filter>
|
|
74
|
+
</ClCompile>
|
|
75
|
+
<ClCompile Include="..\parser.cpp">
|
|
76
|
+
<Filter>Source Files</Filter>
|
|
77
|
+
</ClCompile>
|
|
78
|
+
<ClCompile Include="..\prelexer.cpp">
|
|
79
|
+
<Filter>Source Files</Filter>
|
|
80
|
+
</ClCompile>
|
|
81
|
+
<ClCompile Include="..\remove_placeholders.cpp">
|
|
82
|
+
<Filter>Source Files</Filter>
|
|
83
|
+
</ClCompile>
|
|
84
|
+
<ClCompile Include="..\sass.cpp">
|
|
85
|
+
<Filter>Source Files</Filter>
|
|
86
|
+
</ClCompile>
|
|
87
|
+
<ClCompile Include="..\sass_interface.cpp">
|
|
88
|
+
<Filter>Source Files</Filter>
|
|
89
|
+
</ClCompile>
|
|
90
|
+
<ClCompile Include="..\sass_util.cpp">
|
|
91
|
+
<Filter>Source Files</Filter>
|
|
92
|
+
</ClCompile>
|
|
93
|
+
<ClCompile Include="..\sass2scss.cpp">
|
|
94
|
+
<Filter>Source Files</Filter>
|
|
95
|
+
</ClCompile>
|
|
96
|
+
<ClCompile Include="..\source_map.cpp">
|
|
97
|
+
<Filter>Source Files</Filter>
|
|
98
|
+
</ClCompile>
|
|
99
|
+
<ClCompile Include="..\to_c.cpp">
|
|
100
|
+
<Filter>Source Files</Filter>
|
|
101
|
+
</ClCompile>
|
|
102
|
+
<ClCompile Include="..\to_string.cpp">
|
|
103
|
+
<Filter>Source Files</Filter>
|
|
104
|
+
</ClCompile>
|
|
105
|
+
<ClCompile Include="..\units.cpp">
|
|
106
|
+
<Filter>Source Files</Filter>
|
|
107
|
+
</ClCompile>
|
|
108
|
+
<ClCompile Include="..\utf8_string.cpp">
|
|
109
|
+
<Filter>Source Files</Filter>
|
|
110
|
+
</ClCompile>
|
|
111
|
+
<ClCompile Include="..\util.cpp">
|
|
112
|
+
<Filter>Source Files</Filter>
|
|
113
|
+
</ClCompile>
|
|
114
|
+
<ClCompile Include="..\cencode.c">
|
|
115
|
+
<Filter>Source Files</Filter>
|
|
116
|
+
</ClCompile>
|
|
117
|
+
<ClCompile Include="..\json.cpp">
|
|
118
|
+
<Filter>Source Files</Filter>
|
|
119
|
+
</ClCompile>
|
|
120
|
+
<ClCompile Include="..\sass_context.cpp">
|
|
121
|
+
<Filter>Source Files</Filter>
|
|
122
|
+
</ClCompile>
|
|
123
|
+
<ClCompile Include="..\sass_functions.cpp">
|
|
124
|
+
<Filter>Source Files</Filter>
|
|
125
|
+
</ClCompile>
|
|
126
|
+
<ClCompile Include="..\sass_values.cpp">
|
|
127
|
+
<Filter>Source Files</Filter>
|
|
128
|
+
</ClCompile>
|
|
129
|
+
</ItemGroup>
|
|
130
|
+
<ItemGroup>
|
|
131
|
+
<ClInclude Include="..\utf8\checked.h">
|
|
132
|
+
<Filter>Header Files</Filter>
|
|
133
|
+
</ClInclude>
|
|
134
|
+
<ClInclude Include="..\utf8\core.h">
|
|
135
|
+
<Filter>Header Files</Filter>
|
|
136
|
+
</ClInclude>
|
|
137
|
+
<ClInclude Include="..\utf8\unchecked.h">
|
|
138
|
+
<Filter>Header Files</Filter>
|
|
139
|
+
</ClInclude>
|
|
140
|
+
<ClInclude Include="..\ast.hpp">
|
|
141
|
+
<Filter>Header Files</Filter>
|
|
142
|
+
</ClInclude>
|
|
143
|
+
<ClInclude Include="..\ast_def_macros.hpp">
|
|
144
|
+
<Filter>Header Files</Filter>
|
|
145
|
+
</ClInclude>
|
|
146
|
+
<ClInclude Include="..\ast_factory.hpp">
|
|
147
|
+
<Filter>Header Files</Filter>
|
|
148
|
+
</ClInclude>
|
|
149
|
+
<ClInclude Include="..\ast_fwd_decl.hpp">
|
|
150
|
+
<Filter>Header Files</Filter>
|
|
151
|
+
</ClInclude>
|
|
152
|
+
<ClInclude Include="..\backtrace.hpp">
|
|
153
|
+
<Filter>Header Files</Filter>
|
|
154
|
+
</ClInclude>
|
|
155
|
+
<ClInclude Include="..\base64vlq.hpp">
|
|
156
|
+
<Filter>Header Files</Filter>
|
|
157
|
+
</ClInclude>
|
|
158
|
+
<ClInclude Include="..\bind.hpp">
|
|
159
|
+
<Filter>Header Files</Filter>
|
|
160
|
+
</ClInclude>
|
|
161
|
+
<ClInclude Include="..\color_names.hpp">
|
|
162
|
+
<Filter>Header Files</Filter>
|
|
163
|
+
</ClInclude>
|
|
164
|
+
<ClInclude Include="..\constants.hpp">
|
|
165
|
+
<Filter>Header Files</Filter>
|
|
166
|
+
</ClInclude>
|
|
167
|
+
<ClInclude Include="..\context.hpp">
|
|
168
|
+
<Filter>Header Files</Filter>
|
|
169
|
+
</ClInclude>
|
|
170
|
+
<ClInclude Include="..\contextualize.hpp">
|
|
171
|
+
<Filter>Header Files</Filter>
|
|
172
|
+
</ClInclude>
|
|
173
|
+
<ClInclude Include="..\copy_c_str.hpp">
|
|
174
|
+
<Filter>Header Files</Filter>
|
|
175
|
+
</ClInclude>
|
|
176
|
+
<ClInclude Include="..\debug.hpp">
|
|
177
|
+
<Filter>Header Files</Filter>
|
|
178
|
+
</ClInclude>
|
|
179
|
+
<ClInclude Include="..\environment.hpp">
|
|
180
|
+
<Filter>Header Files</Filter>
|
|
181
|
+
</ClInclude>
|
|
182
|
+
<ClInclude Include="..\error_handling.hpp">
|
|
183
|
+
<Filter>Header Files</Filter>
|
|
184
|
+
</ClInclude>
|
|
185
|
+
<ClInclude Include="..\eval.hpp">
|
|
186
|
+
<Filter>Header Files</Filter>
|
|
187
|
+
</ClInclude>
|
|
188
|
+
<ClInclude Include="..\expand.hpp">
|
|
189
|
+
<Filter>Header Files</Filter>
|
|
190
|
+
</ClInclude>
|
|
191
|
+
<ClInclude Include="..\extend.hpp">
|
|
192
|
+
<Filter>Header Files</Filter>
|
|
193
|
+
</ClInclude>
|
|
194
|
+
<ClInclude Include="..\file.hpp">
|
|
195
|
+
<Filter>Header Files</Filter>
|
|
196
|
+
</ClInclude>
|
|
197
|
+
<ClInclude Include="..\functions.hpp">
|
|
198
|
+
<Filter>Header Files</Filter>
|
|
199
|
+
</ClInclude>
|
|
200
|
+
<ClInclude Include="..\inspect.hpp">
|
|
201
|
+
<Filter>Header Files</Filter>
|
|
202
|
+
</ClInclude>
|
|
203
|
+
<ClInclude Include="..\kwd_arg_macros.hpp">
|
|
204
|
+
<Filter>Header Files</Filter>
|
|
205
|
+
</ClInclude>
|
|
206
|
+
<ClInclude Include="..\mapping.hpp">
|
|
207
|
+
<Filter>Header Files</Filter>
|
|
208
|
+
</ClInclude>
|
|
209
|
+
<ClInclude Include="..\memory_manager.hpp">
|
|
210
|
+
<Filter>Header Files</Filter>
|
|
211
|
+
</ClInclude>
|
|
212
|
+
<ClInclude Include="..\node.hpp">
|
|
213
|
+
<Filter>Header Files</Filter>
|
|
214
|
+
</ClInclude>
|
|
215
|
+
<ClInclude Include="..\operation.hpp">
|
|
216
|
+
<Filter>Header Files</Filter>
|
|
217
|
+
</ClInclude>
|
|
218
|
+
<ClInclude Include="..\output_compressed.hpp">
|
|
219
|
+
<Filter>Header Files</Filter>
|
|
220
|
+
</ClInclude>
|
|
221
|
+
<ClInclude Include="..\output_nested.hpp">
|
|
222
|
+
<Filter>Header Files</Filter>
|
|
223
|
+
</ClInclude>
|
|
224
|
+
<ClInclude Include="..\parser.hpp">
|
|
225
|
+
<Filter>Header Files</Filter>
|
|
226
|
+
</ClInclude>
|
|
227
|
+
<ClInclude Include="..\paths.hpp">
|
|
228
|
+
<Filter>Header Files</Filter>
|
|
229
|
+
</ClInclude>
|
|
230
|
+
<ClInclude Include="..\position.hpp">
|
|
231
|
+
<Filter>Header Files</Filter>
|
|
232
|
+
</ClInclude>
|
|
233
|
+
<ClInclude Include="..\prelexer.hpp">
|
|
234
|
+
<Filter>Header Files</Filter>
|
|
235
|
+
</ClInclude>
|
|
236
|
+
<ClInclude Include="..\remove_placeholders.hpp">
|
|
237
|
+
<Filter>Header Files</Filter>
|
|
238
|
+
</ClInclude>
|
|
239
|
+
<ClInclude Include="..\sass.h">
|
|
240
|
+
<Filter>Header Files</Filter>
|
|
241
|
+
</ClInclude>
|
|
242
|
+
<ClInclude Include="..\sass_interface.h">
|
|
243
|
+
<Filter>Header Files</Filter>
|
|
244
|
+
</ClInclude>
|
|
245
|
+
<ClInclude Include="..\sass_util.hpp">
|
|
246
|
+
<Filter>Header Files</Filter>
|
|
247
|
+
</ClInclude>
|
|
248
|
+
<ClInclude Include="..\sass2scss.h">
|
|
249
|
+
<Filter>Header Files</Filter>
|
|
250
|
+
</ClInclude>
|
|
251
|
+
<ClInclude Include="..\source_map.hpp">
|
|
252
|
+
<Filter>Header Files</Filter>
|
|
253
|
+
</ClInclude>
|
|
254
|
+
<ClInclude Include="..\subset_map.hpp">
|
|
255
|
+
<Filter>Header Files</Filter>
|
|
256
|
+
</ClInclude>
|
|
257
|
+
<ClInclude Include="..\to_c.hpp">
|
|
258
|
+
<Filter>Header Files</Filter>
|
|
259
|
+
</ClInclude>
|
|
260
|
+
<ClInclude Include="..\to_string.hpp">
|
|
261
|
+
<Filter>Header Files</Filter>
|
|
262
|
+
</ClInclude>
|
|
263
|
+
<ClInclude Include="..\token.hpp">
|
|
264
|
+
<Filter>Header Files</Filter>
|
|
265
|
+
</ClInclude>
|
|
266
|
+
<ClInclude Include="..\units.hpp">
|
|
267
|
+
<Filter>Header Files</Filter>
|
|
268
|
+
</ClInclude>
|
|
269
|
+
<ClInclude Include="..\utf8.h">
|
|
270
|
+
<Filter>Header Files</Filter>
|
|
271
|
+
</ClInclude>
|
|
272
|
+
<ClInclude Include="..\utf8_string.hpp">
|
|
273
|
+
<Filter>Header Files</Filter>
|
|
274
|
+
</ClInclude>
|
|
275
|
+
<ClInclude Include="..\util.hpp">
|
|
276
|
+
<Filter>Header Files</Filter>
|
|
277
|
+
</ClInclude>
|
|
278
|
+
<ClInclude Include="..\json.hpp">
|
|
279
|
+
<Filter>Header Files</Filter>
|
|
280
|
+
</ClInclude>
|
|
281
|
+
<ClInclude Include="..\sass_context.h">
|
|
282
|
+
<Filter>Header Files</Filter>
|
|
283
|
+
</ClInclude>
|
|
284
|
+
<ClInclude Include="..\sass_functions.h">
|
|
285
|
+
<Filter>Header Files</Filter>
|
|
286
|
+
</ClInclude>
|
|
287
|
+
<ClInclude Include="..\sass_values.h">
|
|
288
|
+
<Filter>Header Files</Filter>
|
|
289
|
+
</ClInclude>
|
|
290
|
+
</ItemGroup>
|
|
291
|
+
</Project>
|