sassc 2.3.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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +5 -0
  4. data/ext/libsass/VERSION +1 -1
  5. data/ext/libsass/include/sass/context.h +3 -0
  6. data/ext/libsass/src/MurmurHash2.hpp +91 -0
  7. data/ext/libsass/src/ast.cpp +117 -117
  8. data/ext/libsass/src/ast.hpp +160 -162
  9. data/ext/libsass/src/ast_def_macros.hpp +10 -10
  10. data/ext/libsass/src/ast_fwd_decl.cpp +2 -2
  11. data/ext/libsass/src/ast_fwd_decl.hpp +61 -52
  12. data/ext/libsass/src/ast_helpers.hpp +5 -5
  13. data/ext/libsass/src/ast_sel_cmp.cpp +18 -18
  14. data/ext/libsass/src/ast_sel_super.cpp +52 -52
  15. data/ext/libsass/src/ast_sel_unify.cpp +16 -16
  16. data/ext/libsass/src/ast_sel_weave.cpp +62 -62
  17. data/ext/libsass/src/ast_selectors.cpp +87 -77
  18. data/ext/libsass/src/ast_selectors.hpp +72 -62
  19. data/ext/libsass/src/ast_supports.cpp +35 -35
  20. data/ext/libsass/src/ast_supports.hpp +29 -29
  21. data/ext/libsass/src/ast_values.cpp +58 -58
  22. data/ext/libsass/src/ast_values.hpp +75 -75
  23. data/ext/libsass/src/backtrace.cpp +9 -9
  24. data/ext/libsass/src/backtrace.hpp +5 -5
  25. data/ext/libsass/src/base64vlq.cpp +2 -2
  26. data/ext/libsass/src/base64vlq.hpp +1 -1
  27. data/ext/libsass/src/bind.cpp +17 -17
  28. data/ext/libsass/src/bind.hpp +1 -1
  29. data/ext/libsass/src/c2ast.cpp +3 -3
  30. data/ext/libsass/src/c2ast.hpp +1 -1
  31. data/ext/libsass/src/check_nesting.cpp +36 -36
  32. data/ext/libsass/src/check_nesting.hpp +2 -2
  33. data/ext/libsass/src/color_maps.cpp +5 -5
  34. data/ext/libsass/src/color_maps.hpp +1 -1
  35. data/ext/libsass/src/context.cpp +63 -60
  36. data/ext/libsass/src/context.hpp +33 -33
  37. data/ext/libsass/src/cssize.cpp +30 -29
  38. data/ext/libsass/src/cssize.hpp +13 -13
  39. data/ext/libsass/src/dart_helpers.hpp +5 -5
  40. data/ext/libsass/src/debugger.hpp +127 -128
  41. data/ext/libsass/src/emitter.cpp +12 -12
  42. data/ext/libsass/src/emitter.hpp +10 -10
  43. data/ext/libsass/src/environment.cpp +27 -27
  44. data/ext/libsass/src/environment.hpp +24 -24
  45. data/ext/libsass/src/error_handling.cpp +42 -42
  46. data/ext/libsass/src/error_handling.hpp +38 -50
  47. data/ext/libsass/src/eval.cpp +138 -132
  48. data/ext/libsass/src/eval.hpp +17 -17
  49. data/ext/libsass/src/eval_selectors.cpp +3 -3
  50. data/ext/libsass/src/expand.cpp +70 -64
  51. data/ext/libsass/src/expand.hpp +12 -12
  52. data/ext/libsass/src/extender.cpp +55 -53
  53. data/ext/libsass/src/extender.hpp +14 -14
  54. data/ext/libsass/src/file.cpp +66 -58
  55. data/ext/libsass/src/file.hpp +23 -25
  56. data/ext/libsass/src/fn_colors.cpp +9 -9
  57. data/ext/libsass/src/fn_lists.cpp +18 -18
  58. data/ext/libsass/src/fn_maps.cpp +3 -3
  59. data/ext/libsass/src/fn_miscs.cpp +15 -15
  60. data/ext/libsass/src/fn_numbers.cpp +7 -7
  61. data/ext/libsass/src/fn_selectors.cpp +8 -8
  62. data/ext/libsass/src/fn_strings.cpp +34 -22
  63. data/ext/libsass/src/fn_utils.cpp +29 -26
  64. data/ext/libsass/src/fn_utils.hpp +10 -10
  65. data/ext/libsass/src/inspect.cpp +35 -34
  66. data/ext/libsass/src/inspect.hpp +21 -21
  67. data/ext/libsass/src/lexer.cpp +3 -1
  68. data/ext/libsass/src/listize.cpp +2 -2
  69. data/ext/libsass/src/mapping.hpp +1 -0
  70. data/ext/libsass/src/memory.hpp +12 -0
  71. data/ext/libsass/src/memory/allocator.cpp +48 -0
  72. data/ext/libsass/src/memory/allocator.hpp +138 -0
  73. data/ext/libsass/src/memory/config.hpp +20 -0
  74. data/ext/libsass/src/memory/memory_pool.hpp +186 -0
  75. data/ext/libsass/src/memory/{SharedPtr.cpp → shared_ptr.cpp} +2 -2
  76. data/ext/libsass/src/memory/{SharedPtr.hpp → shared_ptr.hpp} +18 -6
  77. data/ext/libsass/src/operation.hpp +44 -44
  78. data/ext/libsass/src/operators.cpp +18 -18
  79. data/ext/libsass/src/operators.hpp +11 -11
  80. data/ext/libsass/src/ordered_map.hpp +18 -18
  81. data/ext/libsass/src/output.cpp +16 -16
  82. data/ext/libsass/src/output.hpp +5 -5
  83. data/ext/libsass/src/parser.cpp +327 -345
  84. data/ext/libsass/src/parser.hpp +77 -87
  85. data/ext/libsass/src/parser_selectors.cpp +6 -6
  86. data/ext/libsass/src/permutate.hpp +39 -15
  87. data/ext/libsass/src/plugins.cpp +7 -7
  88. data/ext/libsass/src/plugins.hpp +8 -8
  89. data/ext/libsass/src/position.cpp +7 -26
  90. data/ext/libsass/src/position.hpp +44 -21
  91. data/ext/libsass/src/remove_placeholders.cpp +4 -4
  92. data/ext/libsass/src/remove_placeholders.hpp +3 -3
  93. data/ext/libsass/src/sass.cpp +16 -15
  94. data/ext/libsass/src/sass.hpp +9 -5
  95. data/ext/libsass/src/sass_context.cpp +52 -34
  96. data/ext/libsass/src/sass_values.cpp +8 -10
  97. data/ext/libsass/src/settings.hpp +19 -0
  98. data/ext/libsass/src/source.cpp +69 -0
  99. data/ext/libsass/src/source.hpp +95 -0
  100. data/ext/libsass/src/source_data.hpp +32 -0
  101. data/ext/libsass/src/source_map.cpp +22 -18
  102. data/ext/libsass/src/source_map.hpp +12 -9
  103. data/ext/libsass/src/units.cpp +19 -19
  104. data/ext/libsass/src/units.hpp +8 -8
  105. data/ext/libsass/src/utf8_string.cpp +9 -10
  106. data/ext/libsass/src/utf8_string.hpp +7 -6
  107. data/ext/libsass/src/util.cpp +38 -38
  108. data/ext/libsass/src/util.hpp +18 -18
  109. data/ext/libsass/src/util_string.cpp +13 -13
  110. data/ext/libsass/src/util_string.hpp +9 -8
  111. data/ext/libsass/src/values.cpp +12 -12
  112. data/lib/sassc/native.rb +3 -5
  113. data/lib/sassc/version.rb +1 -1
  114. data/test/native_test.rb +4 -4
  115. metadata +14 -5
  116. data/lib/sassc/native/lib_c.rb +0 -21
@@ -2,7 +2,7 @@
2
2
  #include <iostream>
3
3
  #include <typeinfo>
4
4
 
5
- #include "SharedPtr.hpp"
5
+ #include "shared_ptr.hpp"
6
6
  #include "../ast_fwd_decl.hpp"
7
7
 
8
8
  #ifdef DEBUG_SHARED_PTR
@@ -26,7 +26,7 @@ namespace Sass {
26
26
  }
27
27
  }
28
28
  }
29
- std::vector<SharedObj*> SharedObj::all;
29
+ sass::vector<SharedObj*> SharedObj::all;
30
30
  #endif
31
31
 
32
32
  bool SharedObj::taint = false;
@@ -3,6 +3,8 @@
3
3
 
4
4
  #include "sass/base.h"
5
5
 
6
+ #include "../sass.hpp"
7
+ #include "allocator.hpp"
6
8
  #include <cstddef>
7
9
  #include <iostream>
8
10
  #include <string>
@@ -15,6 +17,7 @@
15
17
 
16
18
  namespace Sass {
17
19
 
20
+ // Forward declaration
18
21
  class SharedPtr;
19
22
 
20
23
  ///////////////////////////////////////////////////////////////////////////////
@@ -76,12 +79,12 @@ namespace Sass {
76
79
 
77
80
  #ifdef DEBUG_SHARED_PTR
78
81
  static void dumpMemLeaks();
79
- SharedObj* trace(std::string file, size_t line) {
82
+ SharedObj* trace(sass::string file, size_t line) {
80
83
  this->file = file;
81
84
  this->line = line;
82
85
  return this;
83
86
  }
84
- std::string getDbgFile() { return file; }
87
+ sass::string getDbgFile() { return file; }
85
88
  size_t getDbgLine() { return line; }
86
89
  void setDbg(bool dbg) { this->dbg = dbg; }
87
90
  size_t getRefCount() const { return refcount; }
@@ -89,7 +92,16 @@ namespace Sass {
89
92
 
90
93
  static void setTaint(bool val) { taint = val; }
91
94
 
92
- virtual std::string to_string() const = 0;
95
+ #ifdef SASS_CUSTOM_ALLOCATOR
96
+ inline void* operator new(size_t nbytes) {
97
+ return allocateMem(nbytes);
98
+ }
99
+ inline void operator delete(void* ptr) {
100
+ return deallocateMem(ptr);
101
+ }
102
+ #endif
103
+
104
+ virtual sass::string to_string() const = 0;
93
105
  protected:
94
106
  friend class SharedPtr;
95
107
  friend class Memory_Manager;
@@ -97,10 +109,10 @@ namespace Sass {
97
109
  bool detached;
98
110
  static bool taint;
99
111
  #ifdef DEBUG_SHARED_PTR
100
- std::string file;
112
+ sass::string file;
101
113
  size_t line;
102
114
  bool dbg = false;
103
- static std::vector<SharedObj*> all;
115
+ static sass::vector<SharedObj*> all;
104
116
  #endif
105
117
  };
106
118
 
@@ -205,7 +217,7 @@ namespace Sass {
205
217
  SharedPtr::operator=(static_cast<const SharedImpl<T>&>(rhs)));
206
218
  }
207
219
 
208
- operator std::string() const {
220
+ operator sass::string() const {
209
221
  if (node) return node->to_string();
210
222
  return "null";
211
223
  }
@@ -19,13 +19,13 @@ namespace Sass {
19
19
  #define ATTACH_ABSTRACT_CRTP_PERFORM_METHODS()\
20
20
  virtual void perform(Operation<void>* op) = 0; \
21
21
  virtual Value* perform(Operation<Value*>* op) = 0; \
22
- virtual std::string perform(Operation<std::string>* op) = 0; \
22
+ virtual sass::string perform(Operation<sass::string>* op) = 0; \
23
23
  virtual AST_Node* perform(Operation<AST_Node*>* op) = 0; \
24
24
  virtual Selector* perform(Operation<Selector*>* op) = 0; \
25
25
  virtual Statement* perform(Operation<Statement*>* op) = 0; \
26
26
  virtual Expression* perform(Operation<Expression*>* op) = 0; \
27
27
  virtual union Sass_Value* perform(Operation<union Sass_Value*>* op) = 0; \
28
- virtual Supports_Condition* perform(Operation<Supports_Condition*>* op) = 0; \
28
+ virtual SupportsCondition* perform(Operation<SupportsCondition*>* op) = 0; \
29
29
 
30
30
  // you must add operators to every class
31
31
  // ensures `this` of actual instance type
@@ -34,13 +34,13 @@ namespace Sass {
34
34
  #define ATTACH_CRTP_PERFORM_METHODS()\
35
35
  virtual void perform(Operation<void>* op) override { return (*op)(this); } \
36
36
  virtual Value* perform(Operation<Value*>* op) override { return (*op)(this); } \
37
- virtual std::string perform(Operation<std::string>* op) override { return (*op)(this); } \
37
+ virtual sass::string perform(Operation<sass::string>* op) override { return (*op)(this); } \
38
38
  virtual AST_Node* perform(Operation<AST_Node*>* op) override { return (*op)(this); } \
39
39
  virtual Selector* perform(Operation<Selector*>* op) override { return (*op)(this); } \
40
40
  virtual Statement* perform(Operation<Statement*>* op) override { return (*op)(this); } \
41
41
  virtual Expression* perform(Operation<Expression*>* op) override { return (*op)(this); } \
42
42
  virtual union Sass_Value* perform(Operation<union Sass_Value*>* op) override { return (*op)(this); } \
43
- virtual Supports_Condition* perform(Operation<Supports_Condition*>* op) override { return (*op)(this); } \
43
+ virtual SupportsCondition* perform(Operation<SupportsCondition*>* op) override { return (*op)(this); } \
44
44
 
45
45
  template<typename T>
46
46
  class Operation {
@@ -48,28 +48,28 @@ namespace Sass {
48
48
  virtual T operator()(AST_Node* x) = 0;
49
49
  // statements
50
50
  virtual T operator()(Block* x) = 0;
51
- virtual T operator()(Ruleset* x) = 0;
51
+ virtual T operator()(StyleRule* x) = 0;
52
52
  virtual T operator()(Bubble* x) = 0;
53
53
  virtual T operator()(Trace* x) = 0;
54
- virtual T operator()(Supports_Block* x) = 0;
54
+ virtual T operator()(SupportsRule* x) = 0;
55
55
  virtual T operator()(MediaRule* x) = 0;
56
56
  virtual T operator()(CssMediaRule* x) = 0;
57
57
  virtual T operator()(CssMediaQuery* x) = 0;
58
- virtual T operator()(At_Root_Block* x) = 0;
59
- virtual T operator()(Directive* x) = 0;
58
+ virtual T operator()(AtRootRule* x) = 0;
59
+ virtual T operator()(AtRule* x) = 0;
60
60
  virtual T operator()(Keyframe_Rule* x) = 0;
61
61
  virtual T operator()(Declaration* x) = 0;
62
62
  virtual T operator()(Assignment* x) = 0;
63
63
  virtual T operator()(Import* x) = 0;
64
64
  virtual T operator()(Import_Stub* x) = 0;
65
- virtual T operator()(Warning* x) = 0;
66
- virtual T operator()(Error* x) = 0;
67
- virtual T operator()(Debug* x) = 0;
65
+ virtual T operator()(WarningRule* x) = 0;
66
+ virtual T operator()(ErrorRule* x) = 0;
67
+ virtual T operator()(DebugRule* x) = 0;
68
68
  virtual T operator()(Comment* x) = 0;
69
69
  virtual T operator()(If* x) = 0;
70
- virtual T operator()(For* x) = 0;
71
- virtual T operator()(Each* x) = 0;
72
- virtual T operator()(While* x) = 0;
70
+ virtual T operator()(ForRule* x) = 0;
71
+ virtual T operator()(EachRule* x) = 0;
72
+ virtual T operator()(WhileRule* x) = 0;
73
73
  virtual T operator()(Return* x) = 0;
74
74
  virtual T operator()(Content* x) = 0;
75
75
  virtual T operator()(ExtendRule* x) = 0;
@@ -94,10 +94,10 @@ namespace Sass {
94
94
  virtual T operator()(String_Schema* x) = 0;
95
95
  virtual T operator()(String_Quoted* x) = 0;
96
96
  virtual T operator()(String_Constant* x) = 0;
97
- virtual T operator()(Supports_Condition* x) = 0;
98
- virtual T operator()(Supports_Operator* x) = 0;
99
- virtual T operator()(Supports_Negation* x) = 0;
100
- virtual T operator()(Supports_Declaration* x) = 0;
97
+ virtual T operator()(SupportsCondition* x) = 0;
98
+ virtual T operator()(SupportsOperation* x) = 0;
99
+ virtual T operator()(SupportsNegation* x) = 0;
100
+ virtual T operator()(SupportsDeclaration* x) = 0;
101
101
  virtual T operator()(Supports_Interpolation* x) = 0;
102
102
  virtual T operator()(Media_Query* x) = 0;
103
103
  virtual T operator()(Media_Query_Expression* x) = 0;
@@ -110,12 +110,12 @@ namespace Sass {
110
110
  virtual T operator()(Arguments* x) = 0;
111
111
  // selectors
112
112
  virtual T operator()(Selector_Schema* x) = 0;
113
- virtual T operator()(Placeholder_Selector* x) = 0;
114
- virtual T operator()(Type_Selector* x) = 0;
115
- virtual T operator()(Class_Selector* x) = 0;
116
- virtual T operator()(Id_Selector* x) = 0;
117
- virtual T operator()(Attribute_Selector* x) = 0;
118
- virtual T operator()(Pseudo_Selector* x) = 0;
113
+ virtual T operator()(PlaceholderSelector* x) = 0;
114
+ virtual T operator()(TypeSelector* x) = 0;
115
+ virtual T operator()(ClassSelector* x) = 0;
116
+ virtual T operator()(IDSelector* x) = 0;
117
+ virtual T operator()(AttributeSelector* x) = 0;
118
+ virtual T operator()(PseudoSelector* x) = 0;
119
119
  virtual T operator()(SelectorComponent* x) = 0;
120
120
  virtual T operator()(SelectorCombinator* x) = 0;
121
121
  virtual T operator()(CompoundSelector* x) = 0;
@@ -134,28 +134,28 @@ namespace Sass {
134
134
  T operator()(AST_Node* x) { return static_cast<D*>(this)->fallback(x); }
135
135
  // statements
136
136
  T operator()(Block* x) { return static_cast<D*>(this)->fallback(x); }
137
- T operator()(Ruleset* x) { return static_cast<D*>(this)->fallback(x); }
137
+ T operator()(StyleRule* x) { return static_cast<D*>(this)->fallback(x); }
138
138
  T operator()(Bubble* x) { return static_cast<D*>(this)->fallback(x); }
139
139
  T operator()(Trace* x) { return static_cast<D*>(this)->fallback(x); }
140
- T operator()(Supports_Block* x) { return static_cast<D*>(this)->fallback(x); }
140
+ T operator()(SupportsRule* x) { return static_cast<D*>(this)->fallback(x); }
141
141
  T operator()(MediaRule* x) { return static_cast<D*>(this)->fallback(x); }
142
142
  T operator()(CssMediaRule* x) { return static_cast<D*>(this)->fallback(x); }
143
143
  T operator()(CssMediaQuery* x) { return static_cast<D*>(this)->fallback(x); }
144
- T operator()(At_Root_Block* x) { return static_cast<D*>(this)->fallback(x); }
145
- T operator()(Directive* x) { return static_cast<D*>(this)->fallback(x); }
144
+ T operator()(AtRootRule* x) { return static_cast<D*>(this)->fallback(x); }
145
+ T operator()(AtRule* x) { return static_cast<D*>(this)->fallback(x); }
146
146
  T operator()(Keyframe_Rule* x) { return static_cast<D*>(this)->fallback(x); }
147
147
  T operator()(Declaration* x) { return static_cast<D*>(this)->fallback(x); }
148
148
  T operator()(Assignment* x) { return static_cast<D*>(this)->fallback(x); }
149
149
  T operator()(Import* x) { return static_cast<D*>(this)->fallback(x); }
150
150
  T operator()(Import_Stub* x) { return static_cast<D*>(this)->fallback(x); }
151
- T operator()(Warning* x) { return static_cast<D*>(this)->fallback(x); }
152
- T operator()(Error* x) { return static_cast<D*>(this)->fallback(x); }
153
- T operator()(Debug* x) { return static_cast<D*>(this)->fallback(x); }
151
+ T operator()(WarningRule* x) { return static_cast<D*>(this)->fallback(x); }
152
+ T operator()(ErrorRule* x) { return static_cast<D*>(this)->fallback(x); }
153
+ T operator()(DebugRule* x) { return static_cast<D*>(this)->fallback(x); }
154
154
  T operator()(Comment* x) { return static_cast<D*>(this)->fallback(x); }
155
155
  T operator()(If* x) { return static_cast<D*>(this)->fallback(x); }
156
- T operator()(For* x) { return static_cast<D*>(this)->fallback(x); }
157
- T operator()(Each* x) { return static_cast<D*>(this)->fallback(x); }
158
- T operator()(While* x) { return static_cast<D*>(this)->fallback(x); }
156
+ T operator()(ForRule* x) { return static_cast<D*>(this)->fallback(x); }
157
+ T operator()(EachRule* x) { return static_cast<D*>(this)->fallback(x); }
158
+ T operator()(WhileRule* x) { return static_cast<D*>(this)->fallback(x); }
159
159
  T operator()(Return* x) { return static_cast<D*>(this)->fallback(x); }
160
160
  T operator()(Content* x) { return static_cast<D*>(this)->fallback(x); }
161
161
  T operator()(ExtendRule* x) { return static_cast<D*>(this)->fallback(x); }
@@ -180,10 +180,10 @@ namespace Sass {
180
180
  T operator()(String_Schema* x) { return static_cast<D*>(this)->fallback(x); }
181
181
  T operator()(String_Constant* x) { return static_cast<D*>(this)->fallback(x); }
182
182
  T operator()(String_Quoted* x) { return static_cast<D*>(this)->fallback(x); }
183
- T operator()(Supports_Condition* x) { return static_cast<D*>(this)->fallback(x); }
184
- T operator()(Supports_Operator* x) { return static_cast<D*>(this)->fallback(x); }
185
- T operator()(Supports_Negation* x) { return static_cast<D*>(this)->fallback(x); }
186
- T operator()(Supports_Declaration* x) { return static_cast<D*>(this)->fallback(x); }
183
+ T operator()(SupportsCondition* x) { return static_cast<D*>(this)->fallback(x); }
184
+ T operator()(SupportsOperation* x) { return static_cast<D*>(this)->fallback(x); }
185
+ T operator()(SupportsNegation* x) { return static_cast<D*>(this)->fallback(x); }
186
+ T operator()(SupportsDeclaration* x) { return static_cast<D*>(this)->fallback(x); }
187
187
  T operator()(Supports_Interpolation* x) { return static_cast<D*>(this)->fallback(x); }
188
188
  T operator()(Media_Query* x) { return static_cast<D*>(this)->fallback(x); }
189
189
  T operator()(Media_Query_Expression* x) { return static_cast<D*>(this)->fallback(x); }
@@ -196,12 +196,12 @@ namespace Sass {
196
196
  T operator()(Arguments* x) { return static_cast<D*>(this)->fallback(x); }
197
197
  // selectors
198
198
  T operator()(Selector_Schema* x) { return static_cast<D*>(this)->fallback(x); }
199
- T operator()(Placeholder_Selector* x) { return static_cast<D*>(this)->fallback(x); }
200
- T operator()(Type_Selector* x) { return static_cast<D*>(this)->fallback(x); }
201
- T operator()(Class_Selector* x) { return static_cast<D*>(this)->fallback(x); }
202
- T operator()(Id_Selector* x) { return static_cast<D*>(this)->fallback(x); }
203
- T operator()(Attribute_Selector* x) { return static_cast<D*>(this)->fallback(x); }
204
- T operator()(Pseudo_Selector* x) { return static_cast<D*>(this)->fallback(x); }
199
+ T operator()(PlaceholderSelector* x) { return static_cast<D*>(this)->fallback(x); }
200
+ T operator()(TypeSelector* x) { return static_cast<D*>(this)->fallback(x); }
201
+ T operator()(ClassSelector* x) { return static_cast<D*>(this)->fallback(x); }
202
+ T operator()(IDSelector* x) { return static_cast<D*>(this)->fallback(x); }
203
+ T operator()(AttributeSelector* x) { return static_cast<D*>(this)->fallback(x); }
204
+ T operator()(PseudoSelector* x) { return static_cast<D*>(this)->fallback(x); }
205
205
  T operator()(SelectorComponent* x) { return static_cast<D*>(this)->fallback(x); }
206
206
  T operator()(SelectorCombinator* x) { return static_cast<D*>(this)->fallback(x); }
207
207
  T operator()(CompoundSelector* x) { return static_cast<D*>(this)->fallback(x); }
@@ -31,7 +31,7 @@ namespace Sass {
31
31
  };
32
32
 
33
33
  /* static function, has no pstate or traces */
34
- bool eq(Expression_Obj lhs, Expression_Obj rhs)
34
+ bool eq(ExpressionObj lhs, ExpressionObj rhs)
35
35
  {
36
36
  // operation is undefined if one is not a number
37
37
  if (!lhs || !rhs) throw Exception::UndefinedOperation(lhs, rhs, Sass_OP::EQ);
@@ -40,7 +40,7 @@ namespace Sass {
40
40
  }
41
41
 
42
42
  /* static function, throws OperationError, has no pstate or traces */
43
- bool cmp(Expression_Obj lhs, Expression_Obj rhs, const Sass_OP op)
43
+ bool cmp(ExpressionObj lhs, ExpressionObj rhs, const Sass_OP op)
44
44
  {
45
45
  // can only compare numbers!?
46
46
  Number_Obj l = Cast<Number>(lhs);
@@ -52,14 +52,14 @@ namespace Sass {
52
52
  }
53
53
 
54
54
  /* static functions, throws OperationError, has no pstate or traces */
55
- bool lt(Expression_Obj lhs, Expression_Obj rhs) { return cmp(lhs, rhs, Sass_OP::LT); }
56
- bool neq(Expression_Obj lhs, Expression_Obj rhs) { return eq(lhs, rhs) == false; }
57
- bool gt(Expression_Obj lhs, Expression_Obj rhs) { return !cmp(lhs, rhs, Sass_OP::GT) && neq(lhs, rhs); }
58
- bool lte(Expression_Obj lhs, Expression_Obj rhs) { return cmp(lhs, rhs, Sass_OP::LTE) || eq(lhs, rhs); }
59
- bool gte(Expression_Obj lhs, Expression_Obj rhs) { return !cmp(lhs, rhs, Sass_OP::GTE) || eq(lhs, rhs); }
55
+ bool lt(ExpressionObj lhs, ExpressionObj rhs) { return cmp(lhs, rhs, Sass_OP::LT); }
56
+ bool neq(ExpressionObj lhs, ExpressionObj rhs) { return eq(lhs, rhs) == false; }
57
+ bool gt(ExpressionObj lhs, ExpressionObj rhs) { return !cmp(lhs, rhs, Sass_OP::GT) && neq(lhs, rhs); }
58
+ bool lte(ExpressionObj lhs, ExpressionObj rhs) { return cmp(lhs, rhs, Sass_OP::LTE) || eq(lhs, rhs); }
59
+ bool gte(ExpressionObj lhs, ExpressionObj rhs) { return !cmp(lhs, rhs, Sass_OP::GTE) || eq(lhs, rhs); }
60
60
 
61
61
  /* colour math deprecation warning */
62
- void op_color_deprecation(enum Sass_OP op, std::string lsh, std::string rhs, const ParserState& pstate)
62
+ void op_color_deprecation(enum Sass_OP op, sass::string lsh, sass::string rhs, const SourceSpan& pstate)
63
63
  {
64
64
  deprecated(
65
65
  "The operation `" + lsh + " " + sass_op_to_name(op) + " " + rhs +
@@ -70,20 +70,20 @@ namespace Sass {
70
70
  }
71
71
 
72
72
  /* static function, throws OperationError, has no traces but optional pstate for returned value */
73
- Value* op_strings(Sass::Operand operand, Value& lhs, Value& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
73
+ Value* op_strings(Sass::Operand operand, Value& lhs, Value& rhs, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed)
74
74
  {
75
75
  enum Sass_OP op = operand.operand;
76
76
 
77
77
  String_Quoted* lqstr = Cast<String_Quoted>(&lhs);
78
78
  String_Quoted* rqstr = Cast<String_Quoted>(&rhs);
79
79
 
80
- std::string lstr(lqstr ? lqstr->value() : lhs.to_string(opt));
81
- std::string rstr(rqstr ? rqstr->value() : rhs.to_string(opt));
80
+ sass::string lstr(lqstr ? lqstr->value() : lhs.to_string(opt));
81
+ sass::string rstr(rqstr ? rqstr->value() : rhs.to_string(opt));
82
82
 
83
83
  if (Cast<Null>(&lhs)) throw Exception::InvalidNullOperation(&lhs, &rhs, op);
84
84
  if (Cast<Null>(&rhs)) throw Exception::InvalidNullOperation(&lhs, &rhs, op);
85
85
 
86
- std::string sep;
86
+ sass::string sep;
87
87
  switch (op) {
88
88
  case Sass_OP::ADD: sep = ""; break;
89
89
  case Sass_OP::SUB: sep = "-"; break;
@@ -121,7 +121,7 @@ namespace Sass {
121
121
 
122
122
  /* ToDo: allow to operate also with hsla colors */
123
123
  /* static function, throws OperationError, has no traces but optional pstate for returned value */
124
- Value* op_colors(enum Sass_OP op, const Color_RGBA& lhs, const Color_RGBA& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
124
+ Value* op_colors(enum Sass_OP op, const Color_RGBA& lhs, const Color_RGBA& rhs, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed)
125
125
  {
126
126
 
127
127
  if (lhs.a() != rhs.a()) {
@@ -142,7 +142,7 @@ namespace Sass {
142
142
  }
143
143
 
144
144
  /* static function, throws OperationError, has no traces but optional pstate for returned value */
145
- Value* op_numbers(enum Sass_OP op, const Number& lhs, const Number& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
145
+ Value* op_numbers(enum Sass_OP op, const Number& lhs, const Number& rhs, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed)
146
146
  {
147
147
  double lval = lhs.value();
148
148
  double rval = rhs.value();
@@ -152,7 +152,7 @@ namespace Sass {
152
152
  }
153
153
 
154
154
  if (op == Sass_OP::DIV && rval == 0) {
155
- std::string result(lval ? "Infinity" : "NaN");
155
+ sass::string result(lval ? "Infinity" : "NaN");
156
156
  return SASS_MEMORY_NEW(String_Quoted, pstate, result);
157
157
  }
158
158
 
@@ -212,7 +212,7 @@ namespace Sass {
212
212
  }
213
213
 
214
214
  /* static function, throws OperationError, has no traces but optional pstate for returned value */
215
- Value* op_number_color(enum Sass_OP op, const Number& lhs, const Color_RGBA& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
215
+ Value* op_number_color(enum Sass_OP op, const Number& lhs, const Color_RGBA& rhs, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed)
216
216
  {
217
217
  double lval = lhs.value();
218
218
 
@@ -229,7 +229,7 @@ namespace Sass {
229
229
  }
230
230
  case Sass_OP::SUB:
231
231
  case Sass_OP::DIV: {
232
- std::string color(rhs.to_string(opt));
232
+ sass::string color(rhs.to_string(opt));
233
233
  op_color_deprecation(op, lhs.to_string(), color, pstate);
234
234
  return SASS_MEMORY_NEW(String_Quoted,
235
235
  pstate,
@@ -243,7 +243,7 @@ namespace Sass {
243
243
  }
244
244
 
245
245
  /* static function, throws OperationError, has no traces but optional pstate for returned value */
246
- Value* op_color_number(enum Sass_OP op, const Color_RGBA& lhs, const Number& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
246
+ Value* op_color_number(enum Sass_OP op, const Color_RGBA& lhs, const Number& rhs, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed)
247
247
  {
248
248
  double rval = rhs.value();
249
249
 
@@ -9,19 +9,19 @@ namespace Sass {
9
9
  namespace Operators {
10
10
 
11
11
  // equality operator using AST Node operator==
12
- bool eq(Expression_Obj, Expression_Obj);
13
- bool neq(Expression_Obj, Expression_Obj);
12
+ bool eq(ExpressionObj, ExpressionObj);
13
+ bool neq(ExpressionObj, ExpressionObj);
14
14
  // specific operators based on cmp and eq
15
- bool lt(Expression_Obj, Expression_Obj);
16
- bool gt(Expression_Obj, Expression_Obj);
17
- bool lte(Expression_Obj, Expression_Obj);
18
- bool gte(Expression_Obj, Expression_Obj);
15
+ bool lt(ExpressionObj, ExpressionObj);
16
+ bool gt(ExpressionObj, ExpressionObj);
17
+ bool lte(ExpressionObj, ExpressionObj);
18
+ bool gte(ExpressionObj, ExpressionObj);
19
19
  // arithmetic for all the combinations that matter
20
- Value* op_strings(Sass::Operand, Value&, Value&, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed = false);
21
- Value* op_colors(enum Sass_OP, const Color_RGBA&, const Color_RGBA&, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed = false);
22
- Value* op_numbers(enum Sass_OP, const Number&, const Number&, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed = false);
23
- Value* op_number_color(enum Sass_OP, const Number&, const Color_RGBA&, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed = false);
24
- Value* op_color_number(enum Sass_OP, const Color_RGBA&, const Number&, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed = false);
20
+ Value* op_strings(Sass::Operand, Value&, Value&, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed = false);
21
+ Value* op_colors(enum Sass_OP, const Color_RGBA&, const Color_RGBA&, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed = false);
22
+ Value* op_numbers(enum Sass_OP, const Number&, const Number&, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed = false);
23
+ Value* op_number_color(enum Sass_OP, const Number&, const Color_RGBA&, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed = false);
24
+ Value* op_color_number(enum Sass_OP, const Color_RGBA&, const Number&, struct Sass_Inspect_Options opt, const SourceSpan& pstate, bool delayed = false);
25
25
 
26
26
  };
27
27
 
@@ -5,7 +5,7 @@ namespace Sass {
5
5
 
6
6
  // ##########################################################################
7
7
  // Very simple and limited container for insert ordered hash map.
8
- // Piggy-back implementation on std::unordered_map and std::vector
8
+ // Piggy-back implementation on std::unordered_map and sass::vector
9
9
  // ##########################################################################
10
10
  template<
11
11
  class Key,
@@ -26,8 +26,8 @@ namespace Sass {
26
26
  map_type _map;
27
27
 
28
28
  // Keep insertion order
29
- std::vector<Key> _keys;
30
- std::vector<T> _values;
29
+ sass::vector<Key> _keys;
30
+ sass::vector<T> _values;
31
31
 
32
32
  const KeyEqual _keyEqual;
33
33
 
@@ -81,8 +81,8 @@ namespace Sass {
81
81
  return false;
82
82
  }
83
83
 
84
- const std::vector<Key>& keys() const { return _keys; }
85
- const std::vector<T>& values() const { return _values; }
84
+ const sass::vector<Key>& keys() const { return _keys; }
85
+ const sass::vector<T>& values() const { return _values; }
86
86
 
87
87
  const T& get(const Key& key) {
88
88
  if (hasKey(key)) {
@@ -91,19 +91,19 @@ namespace Sass {
91
91
  throw std::runtime_error("Key does not exist");
92
92
  }
93
93
 
94
- using iterator = typename std::vector<Key>::iterator;
95
- using const_iterator = typename std::vector<Key>::const_iterator;
96
- using reverse_iterator = typename std::vector<Key>::reverse_iterator;
97
- using const_reverse_iterator = typename std::vector<Key>::const_reverse_iterator;
98
-
99
- typename std::vector<Key>::iterator end() { return _keys.end(); }
100
- typename std::vector<Key>::iterator begin() { return _keys.begin(); }
101
- typename std::vector<Key>::reverse_iterator rend() { return _keys.rend(); }
102
- typename std::vector<Key>::reverse_iterator rbegin() { return _keys.rbegin(); }
103
- typename std::vector<Key>::const_iterator end() const { return _keys.end(); }
104
- typename std::vector<Key>::const_iterator begin() const { return _keys.begin(); }
105
- typename std::vector<Key>::const_reverse_iterator rend() const { return _keys.rend(); }
106
- typename std::vector<Key>::const_reverse_iterator rbegin() const { return _keys.rbegin(); }
94
+ using iterator = typename sass::vector<Key>::iterator;
95
+ using const_iterator = typename sass::vector<Key>::const_iterator;
96
+ using reverse_iterator = typename sass::vector<Key>::reverse_iterator;
97
+ using const_reverse_iterator = typename sass::vector<Key>::const_reverse_iterator;
98
+
99
+ typename sass::vector<Key>::iterator end() { return _keys.end(); }
100
+ typename sass::vector<Key>::iterator begin() { return _keys.begin(); }
101
+ typename sass::vector<Key>::reverse_iterator rend() { return _keys.rend(); }
102
+ typename sass::vector<Key>::reverse_iterator rbegin() { return _keys.rbegin(); }
103
+ typename sass::vector<Key>::const_iterator end() const { return _keys.end(); }
104
+ typename sass::vector<Key>::const_iterator begin() const { return _keys.begin(); }
105
+ typename sass::vector<Key>::const_reverse_iterator rend() const { return _keys.rend(); }
106
+ typename sass::vector<Key>::const_reverse_iterator rbegin() const { return _keys.rbegin(); }
107
107
 
108
108
  };
109
109