sassc 2.0.0 → 2.4.0
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 +4 -4
- data/.gitignore +2 -0
- data/.gitmodules +1 -1
- data/.travis.yml +9 -3
- data/CHANGELOG.md +36 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/README.md +1 -1
- data/Rakefile +43 -7
- data/ext/depend +4 -0
- data/ext/extconf.rb +92 -0
- data/ext/libsass/VERSION +1 -0
- data/ext/libsass/include/sass/base.h +9 -1
- data/ext/libsass/include/sass/context.h +5 -1
- data/ext/libsass/src/MurmurHash2.hpp +91 -0
- data/ext/libsass/src/ast.cpp +755 -2028
- data/ext/libsass/src/ast.hpp +492 -2477
- data/ext/libsass/src/{to_c.cpp → ast2c.cpp} +22 -16
- data/ext/libsass/src/ast2c.hpp +39 -0
- data/ext/libsass/src/ast_def_macros.hpp +70 -10
- data/ext/libsass/src/ast_fwd_decl.cpp +5 -3
- data/ext/libsass/src/ast_fwd_decl.hpp +107 -296
- data/ext/libsass/src/ast_helpers.hpp +292 -0
- data/ext/libsass/src/ast_sel_cmp.cpp +396 -0
- data/ext/libsass/src/ast_sel_super.cpp +539 -0
- data/ext/libsass/src/ast_sel_unify.cpp +275 -0
- data/ext/libsass/src/ast_sel_weave.cpp +616 -0
- data/ext/libsass/src/ast_selectors.cpp +1043 -0
- data/ext/libsass/src/ast_selectors.hpp +522 -0
- data/ext/libsass/src/ast_supports.cpp +114 -0
- data/ext/libsass/src/ast_supports.hpp +121 -0
- data/ext/libsass/src/ast_values.cpp +1154 -0
- data/ext/libsass/src/ast_values.hpp +498 -0
- data/ext/libsass/src/backtrace.cpp +11 -7
- data/ext/libsass/src/backtrace.hpp +5 -5
- data/ext/libsass/src/base64vlq.cpp +5 -2
- data/ext/libsass/src/base64vlq.hpp +1 -1
- data/ext/libsass/src/bind.cpp +35 -34
- data/ext/libsass/src/bind.hpp +3 -1
- data/ext/libsass/src/c2ast.cpp +64 -0
- data/ext/libsass/src/c2ast.hpp +14 -0
- data/ext/libsass/src/cencode.c +4 -6
- data/ext/libsass/src/check_nesting.cpp +83 -88
- data/ext/libsass/src/check_nesting.hpp +39 -34
- data/ext/libsass/src/color_maps.cpp +168 -164
- data/ext/libsass/src/color_maps.hpp +152 -160
- data/ext/libsass/src/constants.cpp +20 -0
- data/ext/libsass/src/constants.hpp +19 -0
- data/ext/libsass/src/context.cpp +104 -121
- data/ext/libsass/src/context.hpp +43 -55
- data/ext/libsass/src/cssize.cpp +103 -188
- data/ext/libsass/src/cssize.hpp +45 -51
- data/ext/libsass/src/dart_helpers.hpp +199 -0
- data/ext/libsass/src/debugger.hpp +524 -361
- data/ext/libsass/src/emitter.cpp +26 -26
- data/ext/libsass/src/emitter.hpp +20 -18
- data/ext/libsass/src/environment.cpp +41 -27
- data/ext/libsass/src/environment.hpp +33 -22
- data/ext/libsass/src/error_handling.cpp +92 -94
- data/ext/libsass/src/error_handling.hpp +73 -50
- data/ext/libsass/src/eval.cpp +380 -515
- data/ext/libsass/src/eval.hpp +64 -57
- data/ext/libsass/src/eval_selectors.cpp +75 -0
- data/ext/libsass/src/expand.cpp +322 -263
- data/ext/libsass/src/expand.hpp +55 -39
- data/ext/libsass/src/extender.cpp +1188 -0
- data/ext/libsass/src/extender.hpp +399 -0
- data/ext/libsass/src/extension.cpp +43 -0
- data/ext/libsass/src/extension.hpp +89 -0
- data/ext/libsass/src/file.cpp +134 -88
- data/ext/libsass/src/file.hpp +28 -37
- data/ext/libsass/src/fn_colors.cpp +596 -0
- data/ext/libsass/src/fn_colors.hpp +85 -0
- data/ext/libsass/src/fn_lists.cpp +285 -0
- data/ext/libsass/src/fn_lists.hpp +34 -0
- data/ext/libsass/src/fn_maps.cpp +94 -0
- data/ext/libsass/src/fn_maps.hpp +30 -0
- data/ext/libsass/src/fn_miscs.cpp +244 -0
- data/ext/libsass/src/fn_miscs.hpp +40 -0
- data/ext/libsass/src/fn_numbers.cpp +227 -0
- data/ext/libsass/src/fn_numbers.hpp +45 -0
- data/ext/libsass/src/fn_selectors.cpp +205 -0
- data/ext/libsass/src/fn_selectors.hpp +35 -0
- data/ext/libsass/src/fn_strings.cpp +268 -0
- data/ext/libsass/src/fn_strings.hpp +34 -0
- data/ext/libsass/src/fn_utils.cpp +158 -0
- data/ext/libsass/src/fn_utils.hpp +62 -0
- data/ext/libsass/src/inspect.cpp +253 -266
- data/ext/libsass/src/inspect.hpp +72 -74
- data/ext/libsass/src/json.cpp +2 -2
- data/ext/libsass/src/lexer.cpp +25 -84
- data/ext/libsass/src/lexer.hpp +5 -16
- data/ext/libsass/src/listize.cpp +27 -43
- data/ext/libsass/src/listize.hpp +14 -11
- data/ext/libsass/src/mapping.hpp +1 -0
- data/ext/libsass/src/memory.hpp +12 -0
- data/ext/libsass/src/memory/allocator.cpp +48 -0
- data/ext/libsass/src/memory/allocator.hpp +138 -0
- data/ext/libsass/src/memory/config.hpp +20 -0
- data/ext/libsass/src/memory/memory_pool.hpp +186 -0
- data/ext/libsass/src/memory/shared_ptr.cpp +33 -0
- data/ext/libsass/src/memory/shared_ptr.hpp +332 -0
- data/ext/libsass/src/operation.hpp +193 -143
- data/ext/libsass/src/operators.cpp +56 -29
- data/ext/libsass/src/operators.hpp +11 -11
- data/ext/libsass/src/ordered_map.hpp +112 -0
- data/ext/libsass/src/output.cpp +59 -75
- data/ext/libsass/src/output.hpp +15 -22
- data/ext/libsass/src/parser.cpp +662 -818
- data/ext/libsass/src/parser.hpp +96 -100
- data/ext/libsass/src/parser_selectors.cpp +189 -0
- data/ext/libsass/src/permutate.hpp +164 -0
- data/ext/libsass/src/plugins.cpp +12 -8
- data/ext/libsass/src/plugins.hpp +8 -8
- data/ext/libsass/src/position.cpp +10 -26
- data/ext/libsass/src/position.hpp +44 -21
- data/ext/libsass/src/prelexer.cpp +14 -8
- data/ext/libsass/src/prelexer.hpp +9 -9
- data/ext/libsass/src/remove_placeholders.cpp +59 -57
- data/ext/libsass/src/remove_placeholders.hpp +20 -18
- data/ext/libsass/src/sass.cpp +25 -18
- data/ext/libsass/src/sass.hpp +22 -14
- data/ext/libsass/src/sass2scss.cpp +49 -18
- data/ext/libsass/src/sass_context.cpp +104 -132
- data/ext/libsass/src/sass_context.hpp +2 -2
- data/ext/libsass/src/sass_functions.cpp +7 -4
- data/ext/libsass/src/sass_functions.hpp +1 -1
- data/ext/libsass/src/sass_values.cpp +26 -21
- data/ext/libsass/src/settings.hpp +19 -0
- data/ext/libsass/src/source.cpp +69 -0
- data/ext/libsass/src/source.hpp +95 -0
- data/ext/libsass/src/source_data.hpp +32 -0
- data/ext/libsass/src/source_map.cpp +27 -20
- data/ext/libsass/src/source_map.hpp +14 -11
- data/ext/libsass/src/stylesheet.cpp +22 -0
- data/ext/libsass/src/stylesheet.hpp +57 -0
- data/ext/libsass/src/to_value.cpp +24 -22
- data/ext/libsass/src/to_value.hpp +18 -22
- data/ext/libsass/src/units.cpp +28 -22
- data/ext/libsass/src/units.hpp +9 -8
- data/ext/libsass/src/utf8/checked.h +12 -10
- data/ext/libsass/src/utf8/core.h +3 -0
- data/ext/libsass/src/utf8_string.cpp +12 -10
- data/ext/libsass/src/utf8_string.hpp +7 -6
- data/ext/libsass/src/util.cpp +97 -107
- data/ext/libsass/src/util.hpp +74 -30
- data/ext/libsass/src/util_string.cpp +125 -0
- data/ext/libsass/src/util_string.hpp +73 -0
- data/ext/libsass/src/values.cpp +33 -24
- data/ext/libsass/src/values.hpp +2 -2
- data/lib/sassc.rb +24 -0
- data/lib/sassc/engine.rb +7 -5
- data/lib/sassc/functions_handler.rb +11 -13
- data/lib/sassc/native.rb +10 -9
- data/lib/sassc/native/native_functions_api.rb +0 -5
- data/lib/sassc/script.rb +4 -6
- data/lib/sassc/version.rb +1 -1
- data/sassc.gemspec +32 -12
- data/test/engine_test.rb +32 -2
- data/test/functions_test.rb +38 -1
- data/test/native_test.rb +4 -4
- metadata +95 -109
- data/ext/Rakefile +0 -3
- data/ext/libsass/.editorconfig +0 -15
- data/ext/libsass/.gitattributes +0 -2
- data/ext/libsass/.github/CONTRIBUTING.md +0 -65
- data/ext/libsass/.github/ISSUE_TEMPLATE.md +0 -54
- data/ext/libsass/.gitignore +0 -85
- data/ext/libsass/.travis.yml +0 -64
- data/ext/libsass/COPYING +0 -25
- data/ext/libsass/GNUmakefile.am +0 -88
- data/ext/libsass/INSTALL +0 -1
- data/ext/libsass/LICENSE +0 -25
- data/ext/libsass/Makefile +0 -351
- data/ext/libsass/Makefile.conf +0 -55
- data/ext/libsass/Readme.md +0 -104
- data/ext/libsass/SECURITY.md +0 -10
- data/ext/libsass/appveyor.yml +0 -91
- data/ext/libsass/configure.ac +0 -138
- data/ext/libsass/contrib/libsass.spec +0 -66
- data/ext/libsass/docs/README.md +0 -20
- data/ext/libsass/docs/api-context-example.md +0 -45
- data/ext/libsass/docs/api-context-internal.md +0 -163
- data/ext/libsass/docs/api-context.md +0 -295
- data/ext/libsass/docs/api-doc.md +0 -215
- data/ext/libsass/docs/api-function-example.md +0 -67
- data/ext/libsass/docs/api-function-internal.md +0 -8
- data/ext/libsass/docs/api-function.md +0 -74
- data/ext/libsass/docs/api-importer-example.md +0 -112
- data/ext/libsass/docs/api-importer-internal.md +0 -20
- data/ext/libsass/docs/api-importer.md +0 -86
- data/ext/libsass/docs/api-value-example.md +0 -55
- data/ext/libsass/docs/api-value-internal.md +0 -76
- data/ext/libsass/docs/api-value.md +0 -154
- data/ext/libsass/docs/build-on-darwin.md +0 -27
- data/ext/libsass/docs/build-on-gentoo.md +0 -55
- data/ext/libsass/docs/build-on-windows.md +0 -139
- data/ext/libsass/docs/build-shared-library.md +0 -35
- data/ext/libsass/docs/build-with-autotools.md +0 -78
- data/ext/libsass/docs/build-with-makefiles.md +0 -68
- data/ext/libsass/docs/build-with-mingw.md +0 -107
- data/ext/libsass/docs/build-with-visual-studio.md +0 -90
- data/ext/libsass/docs/build.md +0 -97
- data/ext/libsass/docs/compatibility-plan.md +0 -48
- data/ext/libsass/docs/contributing.md +0 -17
- data/ext/libsass/docs/custom-functions-internal.md +0 -122
- data/ext/libsass/docs/dev-ast-memory.md +0 -223
- data/ext/libsass/docs/implementations.md +0 -56
- data/ext/libsass/docs/plugins.md +0 -47
- data/ext/libsass/docs/setup-environment.md +0 -68
- data/ext/libsass/docs/source-map-internals.md +0 -51
- data/ext/libsass/docs/trace.md +0 -26
- data/ext/libsass/docs/triage.md +0 -17
- data/ext/libsass/docs/unicode.md +0 -39
- data/ext/libsass/extconf.rb +0 -6
- data/ext/libsass/include/sass/version.h.in +0 -12
- data/ext/libsass/m4/.gitkeep +0 -0
- data/ext/libsass/m4/m4-ax_cxx_compile_stdcxx_11.m4 +0 -167
- data/ext/libsass/res/resource.rc +0 -35
- data/ext/libsass/script/bootstrap +0 -13
- data/ext/libsass/script/branding +0 -10
- data/ext/libsass/script/ci-build-libsass +0 -134
- data/ext/libsass/script/ci-build-plugin +0 -62
- data/ext/libsass/script/ci-install-compiler +0 -6
- data/ext/libsass/script/ci-install-deps +0 -20
- data/ext/libsass/script/ci-report-coverage +0 -42
- data/ext/libsass/script/spec +0 -5
- data/ext/libsass/script/tap-driver +0 -652
- data/ext/libsass/script/tap-runner +0 -1
- data/ext/libsass/script/test-leaks.pl +0 -103
- data/ext/libsass/src/GNUmakefile.am +0 -54
- data/ext/libsass/src/extend.cpp +0 -2130
- data/ext/libsass/src/extend.hpp +0 -86
- data/ext/libsass/src/functions.cpp +0 -2234
- data/ext/libsass/src/functions.hpp +0 -198
- data/ext/libsass/src/memory/SharedPtr.cpp +0 -114
- data/ext/libsass/src/memory/SharedPtr.hpp +0 -206
- data/ext/libsass/src/node.cpp +0 -319
- data/ext/libsass/src/node.hpp +0 -118
- data/ext/libsass/src/paths.hpp +0 -71
- data/ext/libsass/src/sass_util.cpp +0 -149
- data/ext/libsass/src/sass_util.hpp +0 -256
- data/ext/libsass/src/subset_map.cpp +0 -55
- data/ext/libsass/src/subset_map.hpp +0 -76
- data/ext/libsass/src/support/libsass.pc.in +0 -11
- data/ext/libsass/src/to_c.hpp +0 -39
- data/ext/libsass/test/test_node.cpp +0 -94
- data/ext/libsass/test/test_paths.cpp +0 -28
- data/ext/libsass/test/test_selector_difference.cpp +0 -25
- data/ext/libsass/test/test_specificity.cpp +0 -25
- data/ext/libsass/test/test_subset_map.cpp +0 -472
- data/ext/libsass/test/test_superselector.cpp +0 -69
- data/ext/libsass/test/test_unification.cpp +0 -31
- data/ext/libsass/version.sh +0 -10
- data/ext/libsass/win/libsass.sln +0 -39
- data/ext/libsass/win/libsass.sln.DotSettings +0 -9
- data/ext/libsass/win/libsass.targets +0 -118
- data/ext/libsass/win/libsass.vcxproj +0 -188
- data/ext/libsass/win/libsass.vcxproj.filters +0 -357
- data/lib/sassc/native/lib_c.rb +0 -21
- data/lib/tasks/libsass.rb +0 -33
|
@@ -1,63 +1,68 @@
|
|
|
1
1
|
#ifndef SASS_CHECK_NESTING_H
|
|
2
2
|
#define SASS_CHECK_NESTING_H
|
|
3
3
|
|
|
4
|
+
// sass.hpp must go before all system headers to get the
|
|
5
|
+
// __EXTENSIONS__ fix on Solaris.
|
|
6
|
+
#include "sass.hpp"
|
|
4
7
|
#include "ast.hpp"
|
|
5
8
|
#include "operation.hpp"
|
|
9
|
+
#include <vector>
|
|
6
10
|
|
|
7
11
|
namespace Sass {
|
|
8
12
|
|
|
9
|
-
class CheckNesting : public Operation_CRTP<
|
|
13
|
+
class CheckNesting : public Operation_CRTP<Statement*, CheckNesting> {
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
sass::vector<Statement*> parents;
|
|
12
16
|
Backtraces traces;
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
Statement* parent;
|
|
18
|
+
Definition* current_mixin_definition;
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Statement_Ptr visit_children(Statement_Ptr);
|
|
20
|
+
Statement* before(Statement*);
|
|
21
|
+
Statement* visit_children(Statement*);
|
|
19
22
|
|
|
20
23
|
public:
|
|
21
24
|
CheckNesting();
|
|
22
25
|
~CheckNesting() { }
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
Statement* operator()(Block*);
|
|
28
|
+
Statement* operator()(Definition*);
|
|
29
|
+
Statement* operator()(If*);
|
|
27
30
|
|
|
28
31
|
template <typename U>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (this->should_visit(
|
|
32
|
-
|
|
32
|
+
Statement* fallback(U x) {
|
|
33
|
+
Statement* s = Cast<Statement>(x);
|
|
34
|
+
if (s && this->should_visit(s)) {
|
|
35
|
+
Block* b1 = Cast<Block>(s);
|
|
36
|
+
ParentStatement* b2 = Cast<ParentStatement>(s);
|
|
37
|
+
if (b1 || b2) return visit_children(s);
|
|
33
38
|
}
|
|
34
|
-
return
|
|
39
|
+
return s;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
private:
|
|
38
|
-
void invalid_content_parent(
|
|
39
|
-
void invalid_charset_parent(
|
|
40
|
-
void invalid_extend_parent(
|
|
41
|
-
// void invalid_import_parent(
|
|
42
|
-
void invalid_mixin_definition_parent(
|
|
43
|
-
void invalid_function_parent(
|
|
43
|
+
void invalid_content_parent(Statement*, AST_Node*);
|
|
44
|
+
void invalid_charset_parent(Statement*, AST_Node*);
|
|
45
|
+
void invalid_extend_parent(Statement*, AST_Node*);
|
|
46
|
+
// void invalid_import_parent(Statement*);
|
|
47
|
+
void invalid_mixin_definition_parent(Statement*, AST_Node*);
|
|
48
|
+
void invalid_function_parent(Statement*, AST_Node*);
|
|
44
49
|
|
|
45
|
-
void invalid_function_child(
|
|
46
|
-
void invalid_prop_child(
|
|
47
|
-
void invalid_prop_parent(
|
|
48
|
-
void invalid_return_parent(
|
|
49
|
-
void invalid_value_child(
|
|
50
|
+
void invalid_function_child(Statement*);
|
|
51
|
+
void invalid_prop_child(Statement*);
|
|
52
|
+
void invalid_prop_parent(Statement*, AST_Node*);
|
|
53
|
+
void invalid_return_parent(Statement*, AST_Node*);
|
|
54
|
+
void invalid_value_child(AST_Node*);
|
|
50
55
|
|
|
51
|
-
bool is_transparent_parent(
|
|
56
|
+
bool is_transparent_parent(Statement*, Statement*);
|
|
52
57
|
|
|
53
|
-
bool should_visit(
|
|
58
|
+
bool should_visit(Statement*);
|
|
54
59
|
|
|
55
|
-
bool is_charset(
|
|
56
|
-
bool is_mixin(
|
|
57
|
-
bool is_function(
|
|
58
|
-
bool is_root_node(
|
|
59
|
-
bool is_at_root_node(
|
|
60
|
-
bool is_directive_node(
|
|
60
|
+
bool is_charset(Statement*);
|
|
61
|
+
bool is_mixin(Statement*);
|
|
62
|
+
bool is_function(Statement*);
|
|
63
|
+
bool is_root_node(Statement*);
|
|
64
|
+
bool is_at_root_node(Statement*);
|
|
65
|
+
bool is_directive_node(Statement*);
|
|
61
66
|
};
|
|
62
67
|
|
|
63
68
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
// sass.hpp must go before all system headers to get the
|
|
2
|
+
// __EXTENSIONS__ fix on Solaris.
|
|
1
3
|
#include "sass.hpp"
|
|
4
|
+
|
|
2
5
|
#include "ast.hpp"
|
|
3
6
|
#include "color_maps.hpp"
|
|
7
|
+
#include "util_string.hpp"
|
|
4
8
|
|
|
5
9
|
namespace Sass {
|
|
6
10
|
|
|
@@ -158,159 +162,159 @@ namespace Sass {
|
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
namespace Colors {
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
const
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
const
|
|
211
|
-
const
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
const
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
const
|
|
231
|
-
const
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
const
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
const
|
|
291
|
-
const
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
const
|
|
298
|
-
const
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
const
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const
|
|
165
|
+
const SourceSpan color_table("[COLOR TABLE]");
|
|
166
|
+
const Color_RGBA aliceblue(color_table, 240, 248, 255, 1);
|
|
167
|
+
const Color_RGBA antiquewhite(color_table, 250, 235, 215, 1);
|
|
168
|
+
const Color_RGBA cyan(color_table, 0, 255, 255, 1);
|
|
169
|
+
const Color_RGBA aqua(color_table, 0, 255, 255, 1);
|
|
170
|
+
const Color_RGBA aquamarine(color_table, 127, 255, 212, 1);
|
|
171
|
+
const Color_RGBA azure(color_table, 240, 255, 255, 1);
|
|
172
|
+
const Color_RGBA beige(color_table, 245, 245, 220, 1);
|
|
173
|
+
const Color_RGBA bisque(color_table, 255, 228, 196, 1);
|
|
174
|
+
const Color_RGBA black(color_table, 0, 0, 0, 1);
|
|
175
|
+
const Color_RGBA blanchedalmond(color_table, 255, 235, 205, 1);
|
|
176
|
+
const Color_RGBA blue(color_table, 0, 0, 255, 1);
|
|
177
|
+
const Color_RGBA blueviolet(color_table, 138, 43, 226, 1);
|
|
178
|
+
const Color_RGBA brown(color_table, 165, 42, 42, 1);
|
|
179
|
+
const Color_RGBA burlywood(color_table, 222, 184, 135, 1);
|
|
180
|
+
const Color_RGBA cadetblue(color_table, 95, 158, 160, 1);
|
|
181
|
+
const Color_RGBA chartreuse(color_table, 127, 255, 0, 1);
|
|
182
|
+
const Color_RGBA chocolate(color_table, 210, 105, 30, 1);
|
|
183
|
+
const Color_RGBA coral(color_table, 255, 127, 80, 1);
|
|
184
|
+
const Color_RGBA cornflowerblue(color_table, 100, 149, 237, 1);
|
|
185
|
+
const Color_RGBA cornsilk(color_table, 255, 248, 220, 1);
|
|
186
|
+
const Color_RGBA crimson(color_table, 220, 20, 60, 1);
|
|
187
|
+
const Color_RGBA darkblue(color_table, 0, 0, 139, 1);
|
|
188
|
+
const Color_RGBA darkcyan(color_table, 0, 139, 139, 1);
|
|
189
|
+
const Color_RGBA darkgoldenrod(color_table, 184, 134, 11, 1);
|
|
190
|
+
const Color_RGBA darkgray(color_table, 169, 169, 169, 1);
|
|
191
|
+
const Color_RGBA darkgrey(color_table, 169, 169, 169, 1);
|
|
192
|
+
const Color_RGBA darkgreen(color_table, 0, 100, 0, 1);
|
|
193
|
+
const Color_RGBA darkkhaki(color_table, 189, 183, 107, 1);
|
|
194
|
+
const Color_RGBA darkmagenta(color_table, 139, 0, 139, 1);
|
|
195
|
+
const Color_RGBA darkolivegreen(color_table, 85, 107, 47, 1);
|
|
196
|
+
const Color_RGBA darkorange(color_table, 255, 140, 0, 1);
|
|
197
|
+
const Color_RGBA darkorchid(color_table, 153, 50, 204, 1);
|
|
198
|
+
const Color_RGBA darkred(color_table, 139, 0, 0, 1);
|
|
199
|
+
const Color_RGBA darksalmon(color_table, 233, 150, 122, 1);
|
|
200
|
+
const Color_RGBA darkseagreen(color_table, 143, 188, 143, 1);
|
|
201
|
+
const Color_RGBA darkslateblue(color_table, 72, 61, 139, 1);
|
|
202
|
+
const Color_RGBA darkslategray(color_table, 47, 79, 79, 1);
|
|
203
|
+
const Color_RGBA darkslategrey(color_table, 47, 79, 79, 1);
|
|
204
|
+
const Color_RGBA darkturquoise(color_table, 0, 206, 209, 1);
|
|
205
|
+
const Color_RGBA darkviolet(color_table, 148, 0, 211, 1);
|
|
206
|
+
const Color_RGBA deeppink(color_table, 255, 20, 147, 1);
|
|
207
|
+
const Color_RGBA deepskyblue(color_table, 0, 191, 255, 1);
|
|
208
|
+
const Color_RGBA dimgray(color_table, 105, 105, 105, 1);
|
|
209
|
+
const Color_RGBA dimgrey(color_table, 105, 105, 105, 1);
|
|
210
|
+
const Color_RGBA dodgerblue(color_table, 30, 144, 255, 1);
|
|
211
|
+
const Color_RGBA firebrick(color_table, 178, 34, 34, 1);
|
|
212
|
+
const Color_RGBA floralwhite(color_table, 255, 250, 240, 1);
|
|
213
|
+
const Color_RGBA forestgreen(color_table, 34, 139, 34, 1);
|
|
214
|
+
const Color_RGBA magenta(color_table, 255, 0, 255, 1);
|
|
215
|
+
const Color_RGBA fuchsia(color_table, 255, 0, 255, 1);
|
|
216
|
+
const Color_RGBA gainsboro(color_table, 220, 220, 220, 1);
|
|
217
|
+
const Color_RGBA ghostwhite(color_table, 248, 248, 255, 1);
|
|
218
|
+
const Color_RGBA gold(color_table, 255, 215, 0, 1);
|
|
219
|
+
const Color_RGBA goldenrod(color_table, 218, 165, 32, 1);
|
|
220
|
+
const Color_RGBA gray(color_table, 128, 128, 128, 1);
|
|
221
|
+
const Color_RGBA grey(color_table, 128, 128, 128, 1);
|
|
222
|
+
const Color_RGBA green(color_table, 0, 128, 0, 1);
|
|
223
|
+
const Color_RGBA greenyellow(color_table, 173, 255, 47, 1);
|
|
224
|
+
const Color_RGBA honeydew(color_table, 240, 255, 240, 1);
|
|
225
|
+
const Color_RGBA hotpink(color_table, 255, 105, 180, 1);
|
|
226
|
+
const Color_RGBA indianred(color_table, 205, 92, 92, 1);
|
|
227
|
+
const Color_RGBA indigo(color_table, 75, 0, 130, 1);
|
|
228
|
+
const Color_RGBA ivory(color_table, 255, 255, 240, 1);
|
|
229
|
+
const Color_RGBA khaki(color_table, 240, 230, 140, 1);
|
|
230
|
+
const Color_RGBA lavender(color_table, 230, 230, 250, 1);
|
|
231
|
+
const Color_RGBA lavenderblush(color_table, 255, 240, 245, 1);
|
|
232
|
+
const Color_RGBA lawngreen(color_table, 124, 252, 0, 1);
|
|
233
|
+
const Color_RGBA lemonchiffon(color_table, 255, 250, 205, 1);
|
|
234
|
+
const Color_RGBA lightblue(color_table, 173, 216, 230, 1);
|
|
235
|
+
const Color_RGBA lightcoral(color_table, 240, 128, 128, 1);
|
|
236
|
+
const Color_RGBA lightcyan(color_table, 224, 255, 255, 1);
|
|
237
|
+
const Color_RGBA lightgoldenrodyellow(color_table, 250, 250, 210, 1);
|
|
238
|
+
const Color_RGBA lightgray(color_table, 211, 211, 211, 1);
|
|
239
|
+
const Color_RGBA lightgrey(color_table, 211, 211, 211, 1);
|
|
240
|
+
const Color_RGBA lightgreen(color_table, 144, 238, 144, 1);
|
|
241
|
+
const Color_RGBA lightpink(color_table, 255, 182, 193, 1);
|
|
242
|
+
const Color_RGBA lightsalmon(color_table, 255, 160, 122, 1);
|
|
243
|
+
const Color_RGBA lightseagreen(color_table, 32, 178, 170, 1);
|
|
244
|
+
const Color_RGBA lightskyblue(color_table, 135, 206, 250, 1);
|
|
245
|
+
const Color_RGBA lightslategray(color_table, 119, 136, 153, 1);
|
|
246
|
+
const Color_RGBA lightslategrey(color_table, 119, 136, 153, 1);
|
|
247
|
+
const Color_RGBA lightsteelblue(color_table, 176, 196, 222, 1);
|
|
248
|
+
const Color_RGBA lightyellow(color_table, 255, 255, 224, 1);
|
|
249
|
+
const Color_RGBA lime(color_table, 0, 255, 0, 1);
|
|
250
|
+
const Color_RGBA limegreen(color_table, 50, 205, 50, 1);
|
|
251
|
+
const Color_RGBA linen(color_table, 250, 240, 230, 1);
|
|
252
|
+
const Color_RGBA maroon(color_table, 128, 0, 0, 1);
|
|
253
|
+
const Color_RGBA mediumaquamarine(color_table, 102, 205, 170, 1);
|
|
254
|
+
const Color_RGBA mediumblue(color_table, 0, 0, 205, 1);
|
|
255
|
+
const Color_RGBA mediumorchid(color_table, 186, 85, 211, 1);
|
|
256
|
+
const Color_RGBA mediumpurple(color_table, 147, 112, 219, 1);
|
|
257
|
+
const Color_RGBA mediumseagreen(color_table, 60, 179, 113, 1);
|
|
258
|
+
const Color_RGBA mediumslateblue(color_table, 123, 104, 238, 1);
|
|
259
|
+
const Color_RGBA mediumspringgreen(color_table, 0, 250, 154, 1);
|
|
260
|
+
const Color_RGBA mediumturquoise(color_table, 72, 209, 204, 1);
|
|
261
|
+
const Color_RGBA mediumvioletred(color_table, 199, 21, 133, 1);
|
|
262
|
+
const Color_RGBA midnightblue(color_table, 25, 25, 112, 1);
|
|
263
|
+
const Color_RGBA mintcream(color_table, 245, 255, 250, 1);
|
|
264
|
+
const Color_RGBA mistyrose(color_table, 255, 228, 225, 1);
|
|
265
|
+
const Color_RGBA moccasin(color_table, 255, 228, 181, 1);
|
|
266
|
+
const Color_RGBA navajowhite(color_table, 255, 222, 173, 1);
|
|
267
|
+
const Color_RGBA navy(color_table, 0, 0, 128, 1);
|
|
268
|
+
const Color_RGBA oldlace(color_table, 253, 245, 230, 1);
|
|
269
|
+
const Color_RGBA olive(color_table, 128, 128, 0, 1);
|
|
270
|
+
const Color_RGBA olivedrab(color_table, 107, 142, 35, 1);
|
|
271
|
+
const Color_RGBA orange(color_table, 255, 165, 0, 1);
|
|
272
|
+
const Color_RGBA orangered(color_table, 255, 69, 0, 1);
|
|
273
|
+
const Color_RGBA orchid(color_table, 218, 112, 214, 1);
|
|
274
|
+
const Color_RGBA palegoldenrod(color_table, 238, 232, 170, 1);
|
|
275
|
+
const Color_RGBA palegreen(color_table, 152, 251, 152, 1);
|
|
276
|
+
const Color_RGBA paleturquoise(color_table, 175, 238, 238, 1);
|
|
277
|
+
const Color_RGBA palevioletred(color_table, 219, 112, 147, 1);
|
|
278
|
+
const Color_RGBA papayawhip(color_table, 255, 239, 213, 1);
|
|
279
|
+
const Color_RGBA peachpuff(color_table, 255, 218, 185, 1);
|
|
280
|
+
const Color_RGBA peru(color_table, 205, 133, 63, 1);
|
|
281
|
+
const Color_RGBA pink(color_table, 255, 192, 203, 1);
|
|
282
|
+
const Color_RGBA plum(color_table, 221, 160, 221, 1);
|
|
283
|
+
const Color_RGBA powderblue(color_table, 176, 224, 230, 1);
|
|
284
|
+
const Color_RGBA purple(color_table, 128, 0, 128, 1);
|
|
285
|
+
const Color_RGBA red(color_table, 255, 0, 0, 1);
|
|
286
|
+
const Color_RGBA rosybrown(color_table, 188, 143, 143, 1);
|
|
287
|
+
const Color_RGBA royalblue(color_table, 65, 105, 225, 1);
|
|
288
|
+
const Color_RGBA saddlebrown(color_table, 139, 69, 19, 1);
|
|
289
|
+
const Color_RGBA salmon(color_table, 250, 128, 114, 1);
|
|
290
|
+
const Color_RGBA sandybrown(color_table, 244, 164, 96, 1);
|
|
291
|
+
const Color_RGBA seagreen(color_table, 46, 139, 87, 1);
|
|
292
|
+
const Color_RGBA seashell(color_table, 255, 245, 238, 1);
|
|
293
|
+
const Color_RGBA sienna(color_table, 160, 82, 45, 1);
|
|
294
|
+
const Color_RGBA silver(color_table, 192, 192, 192, 1);
|
|
295
|
+
const Color_RGBA skyblue(color_table, 135, 206, 235, 1);
|
|
296
|
+
const Color_RGBA slateblue(color_table, 106, 90, 205, 1);
|
|
297
|
+
const Color_RGBA slategray(color_table, 112, 128, 144, 1);
|
|
298
|
+
const Color_RGBA slategrey(color_table, 112, 128, 144, 1);
|
|
299
|
+
const Color_RGBA snow(color_table, 255, 250, 250, 1);
|
|
300
|
+
const Color_RGBA springgreen(color_table, 0, 255, 127, 1);
|
|
301
|
+
const Color_RGBA steelblue(color_table, 70, 130, 180, 1);
|
|
302
|
+
const Color_RGBA tan(color_table, 210, 180, 140, 1);
|
|
303
|
+
const Color_RGBA teal(color_table, 0, 128, 128, 1);
|
|
304
|
+
const Color_RGBA thistle(color_table, 216, 191, 216, 1);
|
|
305
|
+
const Color_RGBA tomato(color_table, 255, 99, 71, 1);
|
|
306
|
+
const Color_RGBA turquoise(color_table, 64, 224, 208, 1);
|
|
307
|
+
const Color_RGBA violet(color_table, 238, 130, 238, 1);
|
|
308
|
+
const Color_RGBA wheat(color_table, 245, 222, 179, 1);
|
|
309
|
+
const Color_RGBA white(color_table, 255, 255, 255, 1);
|
|
310
|
+
const Color_RGBA whitesmoke(color_table, 245, 245, 245, 1);
|
|
311
|
+
const Color_RGBA yellow(color_table, 255, 255, 0, 1);
|
|
312
|
+
const Color_RGBA yellowgreen(color_table, 154, 205, 50, 1);
|
|
313
|
+
const Color_RGBA rebeccapurple(color_table, 102, 51, 153, 1);
|
|
314
|
+
const Color_RGBA transparent(color_table, 0, 0, 0, 0);
|
|
311
315
|
}
|
|
312
316
|
|
|
313
|
-
const std::
|
|
317
|
+
static const auto* const colors_to_names = new std::unordered_map<int, const char*> {
|
|
314
318
|
{ 240 * 0x10000 + 248 * 0x100 + 255, ColorNames::aliceblue },
|
|
315
319
|
{ 250 * 0x10000 + 235 * 0x100 + 215, ColorNames::antiquewhite },
|
|
316
320
|
{ 0 * 0x10000 + 255 * 0x100 + 255, ColorNames::cyan },
|
|
@@ -452,7 +456,7 @@ namespace Sass {
|
|
|
452
456
|
{ 102 * 0x10000 + 51 * 0x100 + 153, ColorNames::rebeccapurple }
|
|
453
457
|
};
|
|
454
458
|
|
|
455
|
-
const std::
|
|
459
|
+
static const auto *const names_to_colors = new std::unordered_map<sass::string, const Color_RGBA*>
|
|
456
460
|
{
|
|
457
461
|
{ ColorNames::aliceblue, &Colors::aliceblue },
|
|
458
462
|
{ ColorNames::antiquewhite, &Colors::antiquewhite },
|
|
@@ -605,31 +609,31 @@ namespace Sass {
|
|
|
605
609
|
{ ColorNames::transparent, &Colors::transparent }
|
|
606
610
|
};
|
|
607
611
|
|
|
608
|
-
|
|
612
|
+
const Color_RGBA* name_to_color(const char* key)
|
|
609
613
|
{
|
|
610
|
-
return name_to_color(
|
|
614
|
+
return name_to_color(sass::string(key));
|
|
611
615
|
}
|
|
612
616
|
|
|
613
|
-
|
|
617
|
+
const Color_RGBA* name_to_color(const sass::string& key)
|
|
614
618
|
{
|
|
615
619
|
// case insensitive lookup. See #2462
|
|
616
|
-
|
|
617
|
-
|
|
620
|
+
sass::string lower = key;
|
|
621
|
+
Util::ascii_str_tolower(&lower);
|
|
618
622
|
|
|
619
|
-
auto p = names_to_colors
|
|
620
|
-
if (p != names_to_colors
|
|
623
|
+
auto p = names_to_colors->find(lower);
|
|
624
|
+
if (p != names_to_colors->end()) {
|
|
621
625
|
return p->second;
|
|
622
626
|
}
|
|
623
|
-
return
|
|
627
|
+
return nullptr;
|
|
624
628
|
}
|
|
625
629
|
|
|
626
630
|
const char* color_to_name(const int key)
|
|
627
631
|
{
|
|
628
|
-
auto p = colors_to_names
|
|
629
|
-
if (p != colors_to_names
|
|
632
|
+
auto p = colors_to_names->find(key);
|
|
633
|
+
if (p != colors_to_names->end()) {
|
|
630
634
|
return p->second;
|
|
631
635
|
}
|
|
632
|
-
return
|
|
636
|
+
return nullptr;
|
|
633
637
|
}
|
|
634
638
|
|
|
635
639
|
const char* color_to_name(const double key)
|
|
@@ -637,7 +641,7 @@ namespace Sass {
|
|
|
637
641
|
return color_to_name((int)key);
|
|
638
642
|
}
|
|
639
643
|
|
|
640
|
-
const char* color_to_name(const
|
|
644
|
+
const char* color_to_name(const Color_RGBA& c)
|
|
641
645
|
{
|
|
642
646
|
double key = c.r() * 0x10000
|
|
643
647
|
+ c.g() * 0x100
|