sassc 2.0.0 → 2.4.0

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