sassc 2.2.1 → 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 (147) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +18 -0
  4. data/Rakefile +1 -3
  5. data/ext/extconf.rb +13 -5
  6. data/ext/libsass/VERSION +1 -1
  7. data/ext/libsass/include/sass/base.h +2 -1
  8. data/ext/libsass/include/sass/context.h +4 -0
  9. data/ext/libsass/src/MurmurHash2.hpp +91 -0
  10. data/ext/libsass/src/ast.cpp +158 -168
  11. data/ext/libsass/src/ast.hpp +389 -230
  12. data/ext/libsass/src/ast_def_macros.hpp +18 -10
  13. data/ext/libsass/src/ast_fwd_decl.cpp +4 -3
  14. data/ext/libsass/src/ast_fwd_decl.hpp +98 -165
  15. data/ext/libsass/src/ast_helpers.hpp +292 -0
  16. data/ext/libsass/src/ast_sel_cmp.cpp +219 -732
  17. data/ext/libsass/src/ast_sel_super.cpp +539 -0
  18. data/ext/libsass/src/ast_sel_unify.cpp +207 -212
  19. data/ext/libsass/src/ast_sel_weave.cpp +616 -0
  20. data/ext/libsass/src/ast_selectors.cpp +594 -1026
  21. data/ext/libsass/src/ast_selectors.hpp +339 -385
  22. data/ext/libsass/src/ast_supports.cpp +36 -52
  23. data/ext/libsass/src/ast_supports.hpp +29 -29
  24. data/ext/libsass/src/ast_values.cpp +271 -84
  25. data/ext/libsass/src/ast_values.hpp +116 -107
  26. data/ext/libsass/src/backtrace.cpp +9 -9
  27. data/ext/libsass/src/backtrace.hpp +5 -5
  28. data/ext/libsass/src/base64vlq.cpp +2 -2
  29. data/ext/libsass/src/base64vlq.hpp +1 -1
  30. data/ext/libsass/src/bind.cpp +18 -18
  31. data/ext/libsass/src/bind.hpp +1 -1
  32. data/ext/libsass/src/c2ast.cpp +3 -3
  33. data/ext/libsass/src/c2ast.hpp +1 -1
  34. data/ext/libsass/src/cencode.c +4 -6
  35. data/ext/libsass/src/check_nesting.cpp +40 -41
  36. data/ext/libsass/src/check_nesting.hpp +6 -2
  37. data/ext/libsass/src/color_maps.cpp +14 -13
  38. data/ext/libsass/src/color_maps.hpp +1 -9
  39. data/ext/libsass/src/constants.cpp +5 -0
  40. data/ext/libsass/src/constants.hpp +6 -0
  41. data/ext/libsass/src/context.cpp +92 -119
  42. data/ext/libsass/src/context.hpp +41 -53
  43. data/ext/libsass/src/cssize.cpp +66 -149
  44. data/ext/libsass/src/cssize.hpp +17 -23
  45. data/ext/libsass/src/dart_helpers.hpp +199 -0
  46. data/ext/libsass/src/debugger.hpp +451 -295
  47. data/ext/libsass/src/emitter.cpp +15 -16
  48. data/ext/libsass/src/emitter.hpp +10 -12
  49. data/ext/libsass/src/environment.cpp +27 -27
  50. data/ext/libsass/src/environment.hpp +29 -24
  51. data/ext/libsass/src/error_handling.cpp +62 -41
  52. data/ext/libsass/src/error_handling.hpp +61 -51
  53. data/ext/libsass/src/eval.cpp +167 -281
  54. data/ext/libsass/src/eval.hpp +27 -29
  55. data/ext/libsass/src/eval_selectors.cpp +75 -0
  56. data/ext/libsass/src/expand.cpp +275 -222
  57. data/ext/libsass/src/expand.hpp +36 -16
  58. data/ext/libsass/src/extender.cpp +1188 -0
  59. data/ext/libsass/src/extender.hpp +399 -0
  60. data/ext/libsass/src/extension.cpp +43 -0
  61. data/ext/libsass/src/extension.hpp +89 -0
  62. data/ext/libsass/src/file.cpp +81 -72
  63. data/ext/libsass/src/file.hpp +28 -37
  64. data/ext/libsass/src/fn_colors.cpp +20 -18
  65. data/ext/libsass/src/fn_lists.cpp +30 -29
  66. data/ext/libsass/src/fn_maps.cpp +3 -3
  67. data/ext/libsass/src/fn_miscs.cpp +34 -46
  68. data/ext/libsass/src/fn_numbers.cpp +20 -13
  69. data/ext/libsass/src/fn_selectors.cpp +98 -128
  70. data/ext/libsass/src/fn_strings.cpp +47 -33
  71. data/ext/libsass/src/fn_utils.cpp +31 -29
  72. data/ext/libsass/src/fn_utils.hpp +17 -11
  73. data/ext/libsass/src/inspect.cpp +186 -148
  74. data/ext/libsass/src/inspect.hpp +31 -29
  75. data/ext/libsass/src/lexer.cpp +20 -82
  76. data/ext/libsass/src/lexer.hpp +5 -16
  77. data/ext/libsass/src/listize.cpp +23 -37
  78. data/ext/libsass/src/listize.hpp +8 -9
  79. data/ext/libsass/src/mapping.hpp +1 -0
  80. data/ext/libsass/src/memory/allocator.cpp +48 -0
  81. data/ext/libsass/src/memory/allocator.hpp +138 -0
  82. data/ext/libsass/src/memory/config.hpp +20 -0
  83. data/ext/libsass/src/memory/memory_pool.hpp +186 -0
  84. data/ext/libsass/src/memory/{SharedPtr.cpp → shared_ptr.cpp} +2 -2
  85. data/ext/libsass/src/memory/{SharedPtr.hpp → shared_ptr.hpp} +55 -9
  86. data/ext/libsass/src/memory.hpp +12 -0
  87. data/ext/libsass/src/operation.hpp +71 -61
  88. data/ext/libsass/src/operators.cpp +19 -18
  89. data/ext/libsass/src/operators.hpp +11 -11
  90. data/ext/libsass/src/ordered_map.hpp +112 -0
  91. data/ext/libsass/src/output.cpp +45 -64
  92. data/ext/libsass/src/output.hpp +6 -6
  93. data/ext/libsass/src/parser.cpp +512 -700
  94. data/ext/libsass/src/parser.hpp +89 -97
  95. data/ext/libsass/src/parser_selectors.cpp +189 -0
  96. data/ext/libsass/src/permutate.hpp +164 -0
  97. data/ext/libsass/src/plugins.cpp +7 -7
  98. data/ext/libsass/src/plugins.hpp +8 -8
  99. data/ext/libsass/src/position.cpp +7 -26
  100. data/ext/libsass/src/position.hpp +44 -21
  101. data/ext/libsass/src/prelexer.cpp +6 -6
  102. data/ext/libsass/src/remove_placeholders.cpp +55 -56
  103. data/ext/libsass/src/remove_placeholders.hpp +21 -18
  104. data/ext/libsass/src/sass.cpp +16 -15
  105. data/ext/libsass/src/sass.hpp +10 -5
  106. data/ext/libsass/src/sass2scss.cpp +4 -4
  107. data/ext/libsass/src/sass_context.cpp +91 -122
  108. data/ext/libsass/src/sass_context.hpp +2 -2
  109. data/ext/libsass/src/sass_functions.cpp +1 -1
  110. data/ext/libsass/src/sass_values.cpp +8 -11
  111. data/ext/libsass/src/settings.hpp +19 -0
  112. data/ext/libsass/src/source.cpp +69 -0
  113. data/ext/libsass/src/source.hpp +95 -0
  114. data/ext/libsass/src/source_data.hpp +32 -0
  115. data/ext/libsass/src/source_map.cpp +22 -18
  116. data/ext/libsass/src/source_map.hpp +12 -9
  117. data/ext/libsass/src/stylesheet.cpp +22 -0
  118. data/ext/libsass/src/stylesheet.hpp +57 -0
  119. data/ext/libsass/src/to_value.cpp +2 -2
  120. data/ext/libsass/src/to_value.hpp +1 -1
  121. data/ext/libsass/src/units.cpp +24 -22
  122. data/ext/libsass/src/units.hpp +8 -8
  123. data/ext/libsass/src/utf8_string.cpp +9 -10
  124. data/ext/libsass/src/utf8_string.hpp +7 -6
  125. data/ext/libsass/src/util.cpp +48 -50
  126. data/ext/libsass/src/util.hpp +20 -21
  127. data/ext/libsass/src/util_string.cpp +111 -61
  128. data/ext/libsass/src/util_string.hpp +62 -8
  129. data/ext/libsass/src/values.cpp +12 -12
  130. data/lib/sassc/engine.rb +5 -3
  131. data/lib/sassc/functions_handler.rb +8 -8
  132. data/lib/sassc/native.rb +4 -6
  133. data/lib/sassc/script.rb +4 -4
  134. data/lib/sassc/version.rb +1 -1
  135. data/test/functions_test.rb +18 -1
  136. data/test/native_test.rb +4 -4
  137. metadata +29 -15
  138. data/ext/libsass/src/extend.cpp +0 -2132
  139. data/ext/libsass/src/extend.hpp +0 -86
  140. data/ext/libsass/src/node.cpp +0 -322
  141. data/ext/libsass/src/node.hpp +0 -118
  142. data/ext/libsass/src/paths.hpp +0 -71
  143. data/ext/libsass/src/sass_util.cpp +0 -152
  144. data/ext/libsass/src/sass_util.hpp +0 -256
  145. data/ext/libsass/src/subset_map.cpp +0 -58
  146. data/ext/libsass/src/subset_map.hpp +0 -76
  147. data/lib/sassc/native/lib_c.rb +0 -21
@@ -13,13 +13,13 @@ namespace Sass {
13
13
 
14
14
  namespace Exception {
15
15
 
16
- Base::Base(ParserState pstate, std::string msg, Backtraces traces)
17
- : std::runtime_error(msg), msg(msg),
16
+ Base::Base(SourceSpan pstate, sass::string msg, Backtraces traces)
17
+ : std::runtime_error(msg.c_str()), msg(msg),
18
18
  prefix("Error"), pstate(pstate), traces(traces)
19
19
  { }
20
20
 
21
- InvalidSass::InvalidSass(ParserState pstate, Backtraces traces, std::string msg, char* owned_src)
22
- : Base(pstate, msg, traces), owned_src(owned_src)
21
+ InvalidSass::InvalidSass(SourceSpan pstate, Backtraces traces, sass::string msg)
22
+ : Base(pstate, msg, traces)
23
23
  { }
24
24
 
25
25
 
@@ -31,14 +31,14 @@ namespace Sass {
31
31
  "\"" + parent->to_string(Sass_Inspect_Options()) + "\"";
32
32
  }
33
33
 
34
- InvalidVarKwdType::InvalidVarKwdType(ParserState pstate, Backtraces traces, std::string name, const Argument* arg)
34
+ InvalidVarKwdType::InvalidVarKwdType(SourceSpan pstate, Backtraces traces, sass::string name, const Argument* arg)
35
35
  : Base(pstate, def_msg, traces), name(name), arg(arg)
36
36
  {
37
37
  msg = "Variable keyword argument map must have string keys.\n" +
38
38
  name + " is not a string in " + arg->to_string() + ".";
39
39
  }
40
40
 
41
- InvalidArgumentType::InvalidArgumentType(ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string type, const Value* value)
41
+ InvalidArgumentType::InvalidArgumentType(SourceSpan pstate, Backtraces traces, sass::string fn, sass::string arg, sass::string type, const Value* value)
42
42
  : Base(pstate, def_msg, traces), fn(fn), arg(arg), type(type), value(value)
43
43
  {
44
44
  msg = arg + ": \"";
@@ -46,17 +46,17 @@ namespace Sass {
46
46
  msg += "\" is not a " + type + " for `" + fn + "'";
47
47
  }
48
48
 
49
- MissingArgument::MissingArgument(ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string fntype)
49
+ MissingArgument::MissingArgument(SourceSpan pstate, Backtraces traces, sass::string fn, sass::string arg, sass::string fntype)
50
50
  : Base(pstate, def_msg, traces), fn(fn), arg(arg), fntype(fntype)
51
51
  {
52
52
  msg = fntype + " " + fn + " is missing argument " + arg + ".";
53
53
  }
54
54
 
55
- InvalidSyntax::InvalidSyntax(ParserState pstate, Backtraces traces, std::string msg)
55
+ InvalidSyntax::InvalidSyntax(SourceSpan pstate, Backtraces traces, sass::string msg)
56
56
  : Base(pstate, msg, traces)
57
57
  { }
58
58
 
59
- NestingLimitError::NestingLimitError(ParserState pstate, Backtraces traces, std::string msg)
59
+ NestingLimitError::NestingLimitError(SourceSpan pstate, Backtraces traces, sass::string msg)
60
60
  : Base(pstate, msg, traces)
61
61
  { }
62
62
 
@@ -66,7 +66,7 @@ namespace Sass {
66
66
  msg = "Duplicate key " + dup.get_duplicate_key()->inspect() + " in map (" + org.inspect() + ").";
67
67
  }
68
68
 
69
- TypeMismatch::TypeMismatch(Backtraces traces, const Expression& var, const std::string type)
69
+ TypeMismatch::TypeMismatch(Backtraces traces, const Expression& var, const sass::string type)
70
70
  : Base(var.pstate(), def_msg, traces), var(var), type(type)
71
71
  {
72
72
  msg = var.to_string() + " is not an " + type + ".";
@@ -91,7 +91,7 @@ namespace Sass {
91
91
 
92
92
  IncompatibleUnits::IncompatibleUnits(const UnitType lhs, const UnitType rhs)
93
93
  {
94
- msg = std::string("Incompatible units: '") + unit_to_string(rhs) + "' and '" + unit_to_string(lhs) + "'.";
94
+ msg = sass::string("Incompatible units: '") + unit_to_string(rhs) + "' and '" + unit_to_string(lhs) + "'.";
95
95
  }
96
96
 
97
97
  AlphaChannelsNotEqual::AlphaChannelsNotEqual(const Expression* lhs, const Expression* rhs, enum Sass_OP op)
@@ -125,58 +125,79 @@ namespace Sass {
125
125
  msg = def_op_null_msg + ": \"" + lhs->inspect() + " " + sass_op_to_name(op) + " " + rhs->inspect() + "\".";
126
126
  }
127
127
 
128
- SassValueError::SassValueError(Backtraces traces, ParserState pstate, OperationError& err)
128
+ SassValueError::SassValueError(Backtraces traces, SourceSpan pstate, OperationError& err)
129
129
  : Base(pstate, err.what(), traces)
130
130
  {
131
131
  msg = err.what();
132
132
  prefix = err.errtype();
133
133
  }
134
134
 
135
+ TopLevelParent::TopLevelParent(Backtraces traces, SourceSpan pstate)
136
+ : Base(pstate, "Top-level selectors may not contain the parent selector \"&\".", traces)
137
+ {
138
+
139
+ }
140
+
141
+ UnsatisfiedExtend::UnsatisfiedExtend(Backtraces traces, Extension extension)
142
+ : Base(extension.target->pstate(), "The target selector was not found.\n"
143
+ "Use \"@extend " + extension.target->to_string() + " !optional\" to avoid this error.", traces)
144
+ {
145
+
146
+ }
147
+
148
+ ExtendAcrossMedia::ExtendAcrossMedia(Backtraces traces, Extension extension)
149
+ : Base(extension.target->pstate(), "You may not @extend selectors across media queries.\n"
150
+ "Use \"@extend " + extension.target->to_string() + " !optional\" to avoid this error.", traces)
151
+ {
152
+
153
+ }
154
+
155
+
135
156
  }
136
157
 
137
158
 
138
- void warn(std::string msg, ParserState pstate)
159
+ void warn(sass::string msg, SourceSpan pstate)
139
160
  {
140
161
  std::cerr << "Warning: " << msg << std::endl;
141
162
  }
142
163
 
143
- void warning(std::string msg, ParserState pstate)
164
+ void warning(sass::string msg, SourceSpan pstate)
144
165
  {
145
- std::string cwd(Sass::File::get_cwd());
146
- std::string abs_path(Sass::File::rel2abs(pstate.path, cwd, cwd));
147
- std::string rel_path(Sass::File::abs2rel(pstate.path, cwd, cwd));
148
- std::string output_path(Sass::File::path_for_console(rel_path, abs_path, pstate.path));
166
+ sass::string cwd(Sass::File::get_cwd());
167
+ sass::string abs_path(Sass::File::rel2abs(pstate.getPath(), cwd, cwd));
168
+ sass::string rel_path(Sass::File::abs2rel(pstate.getPath(), cwd, cwd));
169
+ sass::string output_path(Sass::File::path_for_console(rel_path, abs_path, pstate.getPath()));
149
170
 
150
- std::cerr << "WARNING on line " << pstate.line+1 << ", column " << pstate.column+1 << " of " << output_path << ":" << std::endl;
171
+ std::cerr << "WARNING on line " << pstate.getLine() << ", column " << pstate.getColumn() << " of " << output_path << ":" << std::endl;
151
172
  std::cerr << msg << std::endl << std::endl;
152
173
  }
153
174
 
154
- void warn(std::string msg, ParserState pstate, Backtrace* bt)
175
+ void warn(sass::string msg, SourceSpan pstate, Backtrace* bt)
155
176
  {
156
177
  warn(msg, pstate);
157
178
  }
158
179
 
159
- void deprecated_function(std::string msg, ParserState pstate)
180
+ void deprecated_function(sass::string msg, SourceSpan pstate)
160
181
  {
161
- std::string cwd(Sass::File::get_cwd());
162
- std::string abs_path(Sass::File::rel2abs(pstate.path, cwd, cwd));
163
- std::string rel_path(Sass::File::abs2rel(pstate.path, cwd, cwd));
164
- std::string output_path(Sass::File::path_for_console(rel_path, abs_path, pstate.path));
182
+ sass::string cwd(Sass::File::get_cwd());
183
+ sass::string abs_path(Sass::File::rel2abs(pstate.getPath(), cwd, cwd));
184
+ sass::string rel_path(Sass::File::abs2rel(pstate.getPath(), cwd, cwd));
185
+ sass::string output_path(Sass::File::path_for_console(rel_path, abs_path, pstate.getPath()));
165
186
 
166
187
  std::cerr << "DEPRECATION WARNING: " << msg << std::endl;
167
188
  std::cerr << "will be an error in future versions of Sass." << std::endl;
168
- std::cerr << " on line " << pstate.line+1 << " of " << output_path << std::endl;
189
+ std::cerr << " on line " << pstate.getLine() << " of " << output_path << std::endl;
169
190
  }
170
191
 
171
- void deprecated(std::string msg, std::string msg2, bool with_column, ParserState pstate)
192
+ void deprecated(sass::string msg, sass::string msg2, bool with_column, SourceSpan pstate)
172
193
  {
173
- std::string cwd(Sass::File::get_cwd());
174
- std::string abs_path(Sass::File::rel2abs(pstate.path, cwd, cwd));
175
- std::string rel_path(Sass::File::abs2rel(pstate.path, cwd, cwd));
176
- std::string output_path(Sass::File::path_for_console(rel_path, pstate.path, pstate.path));
194
+ sass::string cwd(Sass::File::get_cwd());
195
+ sass::string abs_path(Sass::File::rel2abs(pstate.getPath(), cwd, cwd));
196
+ sass::string rel_path(Sass::File::abs2rel(pstate.getPath(), cwd, cwd));
197
+ sass::string output_path(Sass::File::path_for_console(rel_path, pstate.getPath(), pstate.getPath()));
177
198
 
178
- std::cerr << "DEPRECATION WARNING on line " << pstate.line + 1;
179
- if (with_column) std::cerr << ", column " << pstate.column + pstate.offset.column + 1;
199
+ std::cerr << "DEPRECATION WARNING on line " << pstate.getLine();
200
+ // if (with_column) std::cerr << ", column " << pstate.column + pstate.offset.column + 1;
180
201
  if (output_path.length()) std::cerr << " of " << output_path;
181
202
  std::cerr << ":" << std::endl;
182
203
  std::cerr << msg << std::endl;
@@ -184,26 +205,26 @@ namespace Sass {
184
205
  std::cerr << std::endl;
185
206
  }
186
207
 
187
- void deprecated_bind(std::string msg, ParserState pstate)
208
+ void deprecated_bind(sass::string msg, SourceSpan pstate)
188
209
  {
189
- std::string cwd(Sass::File::get_cwd());
190
- std::string abs_path(Sass::File::rel2abs(pstate.path, cwd, cwd));
191
- std::string rel_path(Sass::File::abs2rel(pstate.path, cwd, cwd));
192
- std::string output_path(Sass::File::path_for_console(rel_path, abs_path, pstate.path));
210
+ sass::string cwd(Sass::File::get_cwd());
211
+ sass::string abs_path(Sass::File::rel2abs(pstate.getPath(), cwd, cwd));
212
+ sass::string rel_path(Sass::File::abs2rel(pstate.getPath(), cwd, cwd));
213
+ sass::string output_path(Sass::File::path_for_console(rel_path, abs_path, pstate.getPath()));
193
214
 
194
215
  std::cerr << "WARNING: " << msg << std::endl;
195
- std::cerr << " on line " << pstate.line+1 << " of " << output_path << std::endl;
216
+ std::cerr << " on line " << pstate.getLine() << " of " << output_path << std::endl;
196
217
  std::cerr << "This will be an error in future versions of Sass." << std::endl;
197
218
  }
198
219
 
199
220
  // should be replaced with error with backtraces
200
- void coreError(std::string msg, ParserState pstate)
221
+ void coreError(sass::string msg, SourceSpan pstate)
201
222
  {
202
223
  Backtraces traces;
203
224
  throw Exception::InvalidSyntax(pstate, traces, msg);
204
225
  }
205
226
 
206
- void error(std::string msg, ParserState pstate, Backtraces& traces)
227
+ void error(sass::string msg, SourceSpan pstate, Backtraces& traces)
207
228
  {
208
229
  traces.push_back(Backtrace(pstate));
209
230
  throw Exception::InvalidSyntax(pstate, traces, msg);
@@ -1,6 +1,10 @@
1
1
  #ifndef SASS_ERROR_HANDLING_H
2
2
  #define SASS_ERROR_HANDLING_H
3
3
 
4
+ // sass.hpp must go before all system headers to get the
5
+ // __EXTENSIONS__ fix on Solaris.
6
+ #include "sass.hpp"
7
+
4
8
  #include <string>
5
9
  #include <sstream>
6
10
  #include <stdexcept>
@@ -16,20 +20,20 @@ namespace Sass {
16
20
 
17
21
  namespace Exception {
18
22
 
19
- const std::string def_msg = "Invalid sass detected";
20
- const std::string def_op_msg = "Undefined operation";
21
- const std::string def_op_null_msg = "Invalid null operation";
22
- const std::string def_nesting_limit = "Code too deeply neested";
23
+ const sass::string def_msg = "Invalid sass detected";
24
+ const sass::string def_op_msg = "Undefined operation";
25
+ const sass::string def_op_null_msg = "Invalid null operation";
26
+ const sass::string def_nesting_limit = "Code too deeply nested";
23
27
 
24
28
  class Base : public std::runtime_error {
25
29
  protected:
26
- std::string msg;
27
- std::string prefix;
30
+ sass::string msg;
31
+ sass::string prefix;
28
32
  public:
29
- ParserState pstate;
33
+ SourceSpan pstate;
30
34
  Backtraces traces;
31
35
  public:
32
- Base(ParserState pstate, std::string msg, Backtraces traces);
36
+ Base(SourceSpan pstate, sass::string msg, Backtraces traces);
33
37
  virtual const char* errtype() const { return prefix.c_str(); }
34
38
  virtual const char* what() const throw() { return msg.c_str(); }
35
39
  virtual ~Base() throw() {};
@@ -37,20 +41,8 @@ namespace Sass {
37
41
 
38
42
  class InvalidSass : public Base {
39
43
  public:
40
- InvalidSass(InvalidSass& other) : Base(other), owned_src(other.owned_src) {
41
- // Assumes that `this` will outlive `other`.
42
- other.owned_src = nullptr;
43
- }
44
-
45
- // Required because the copy constructor's argument is not const.
46
- // Can't use `std::move` here because we build on Visual Studio 2013.
47
- InvalidSass(InvalidSass &&other) : Base(other), owned_src(other.owned_src) {
48
- other.owned_src = nullptr;
49
- }
50
-
51
- InvalidSass(ParserState pstate, Backtraces traces, std::string msg, char* owned_src = nullptr);
52
- virtual ~InvalidSass() throw() { sass_free_memory(owned_src); };
53
- char *owned_src;
44
+ InvalidSass(SourceSpan pstate, Backtraces traces, sass::string msg);
45
+ virtual ~InvalidSass() throw() {};
54
46
  };
55
47
 
56
48
  class InvalidParent : public Base {
@@ -64,43 +56,43 @@ namespace Sass {
64
56
 
65
57
  class MissingArgument : public Base {
66
58
  protected:
67
- std::string fn;
68
- std::string arg;
69
- std::string fntype;
59
+ sass::string fn;
60
+ sass::string arg;
61
+ sass::string fntype;
70
62
  public:
71
- MissingArgument(ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string fntype);
63
+ MissingArgument(SourceSpan pstate, Backtraces traces, sass::string fn, sass::string arg, sass::string fntype);
72
64
  virtual ~MissingArgument() throw() {};
73
65
  };
74
66
 
75
67
  class InvalidArgumentType : public Base {
76
68
  protected:
77
- std::string fn;
78
- std::string arg;
79
- std::string type;
69
+ sass::string fn;
70
+ sass::string arg;
71
+ sass::string type;
80
72
  const Value* value;
81
73
  public:
82
- InvalidArgumentType(ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string type, const Value* value = 0);
74
+ InvalidArgumentType(SourceSpan pstate, Backtraces traces, sass::string fn, sass::string arg, sass::string type, const Value* value = 0);
83
75
  virtual ~InvalidArgumentType() throw() {};
84
76
  };
85
77
 
86
78
  class InvalidVarKwdType : public Base {
87
79
  protected:
88
- std::string name;
80
+ sass::string name;
89
81
  const Argument* arg;
90
82
  public:
91
- InvalidVarKwdType(ParserState pstate, Backtraces traces, std::string name, const Argument* arg = 0);
83
+ InvalidVarKwdType(SourceSpan pstate, Backtraces traces, sass::string name, const Argument* arg = 0);
92
84
  virtual ~InvalidVarKwdType() throw() {};
93
85
  };
94
86
 
95
87
  class InvalidSyntax : public Base {
96
88
  public:
97
- InvalidSyntax(ParserState pstate, Backtraces traces, std::string msg);
89
+ InvalidSyntax(SourceSpan pstate, Backtraces traces, sass::string msg);
98
90
  virtual ~InvalidSyntax() throw() {};
99
91
  };
100
92
 
101
93
  class NestingLimitError : public Base {
102
94
  public:
103
- NestingLimitError(ParserState pstate, Backtraces traces, std::string msg = def_nesting_limit);
95
+ NestingLimitError(SourceSpan pstate, Backtraces traces, sass::string msg = def_nesting_limit);
104
96
  virtual ~NestingLimitError() throw() {};
105
97
  };
106
98
 
@@ -117,9 +109,9 @@ namespace Sass {
117
109
  class TypeMismatch : public Base {
118
110
  protected:
119
111
  const Expression& var;
120
- const std::string type;
112
+ const sass::string type;
121
113
  public:
122
- TypeMismatch(Backtraces traces, const Expression& var, const std::string type);
114
+ TypeMismatch(Backtraces traces, const Expression& var, const sass::string type);
123
115
  virtual const char* errtype() const { return "Error"; }
124
116
  virtual ~TypeMismatch() throw() {};
125
117
  };
@@ -145,10 +137,10 @@ namespace Sass {
145
137
  /* common virtual base class (has no pstate or trace) */
146
138
  class OperationError : public std::runtime_error {
147
139
  protected:
148
- std::string msg;
140
+ sass::string msg;
149
141
  public:
150
- OperationError(std::string msg = def_op_msg)
151
- : std::runtime_error(msg), msg(msg)
142
+ OperationError(sass::string msg = def_op_msg)
143
+ : std::runtime_error(msg.c_str()), msg(msg)
152
144
  {};
153
145
  public:
154
146
  virtual const char* errtype() const { return "Error"; }
@@ -205,24 +197,42 @@ namespace Sass {
205
197
  };
206
198
 
207
199
  class SassValueError : public Base {
208
- public:
209
- SassValueError(Backtraces traces, ParserState pstate, OperationError& err);
210
- virtual ~SassValueError() throw() {};
200
+ public:
201
+ SassValueError(Backtraces traces, SourceSpan pstate, OperationError& err);
202
+ virtual ~SassValueError() throw() {};
203
+ };
204
+
205
+ class TopLevelParent : public Base {
206
+ public:
207
+ TopLevelParent(Backtraces traces, SourceSpan pstate);
208
+ virtual ~TopLevelParent() throw() {};
209
+ };
210
+
211
+ class UnsatisfiedExtend : public Base {
212
+ public:
213
+ UnsatisfiedExtend(Backtraces traces, Extension extension);
214
+ virtual ~UnsatisfiedExtend() throw() {};
215
+ };
216
+
217
+ class ExtendAcrossMedia : public Base {
218
+ public:
219
+ ExtendAcrossMedia(Backtraces traces, Extension extension);
220
+ virtual ~ExtendAcrossMedia() throw() {};
211
221
  };
212
222
 
213
223
  }
214
224
 
215
- void warn(std::string msg, ParserState pstate);
216
- void warn(std::string msg, ParserState pstate, Backtrace* bt);
217
- void warning(std::string msg, ParserState pstate);
225
+ void warn(sass::string msg, SourceSpan pstate);
226
+ void warn(sass::string msg, SourceSpan pstate, Backtrace* bt);
227
+ void warning(sass::string msg, SourceSpan pstate);
218
228
 
219
- void deprecated_function(std::string msg, ParserState pstate);
220
- void deprecated(std::string msg, std::string msg2, bool with_column, ParserState pstate);
221
- void deprecated_bind(std::string msg, ParserState pstate);
222
- // void deprecated(std::string msg, ParserState pstate, Backtrace* bt);
229
+ void deprecated_function(sass::string msg, SourceSpan pstate);
230
+ void deprecated(sass::string msg, sass::string msg2, bool with_column, SourceSpan pstate);
231
+ void deprecated_bind(sass::string msg, SourceSpan pstate);
232
+ // void deprecated(sass::string msg, SourceSpan pstate, Backtrace* bt);
223
233
 
224
- void coreError(std::string msg, ParserState pstate);
225
- void error(std::string msg, ParserState pstate, Backtraces& traces);
234
+ void coreError(sass::string msg, SourceSpan pstate);
235
+ void error(sass::string msg, SourceSpan pstate, Backtraces& traces);
226
236
 
227
237
  }
228
238