sassc 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -55,9 +55,9 @@ namespace Sass {
55
55
  // Abstract base class for all abstract syntax tree nodes.
56
56
  //////////////////////////////////////////////////////////
57
57
  class AST_Node : public SharedObj {
58
- ADD_PROPERTY(ParserState, pstate)
58
+ ADD_PROPERTY(SourceSpan, pstate)
59
59
  public:
60
- AST_Node(ParserState pstate)
60
+ AST_Node(SourceSpan pstate)
61
61
  : pstate_(pstate)
62
62
  { }
63
63
  AST_Node(const AST_Node* ptr)
@@ -66,7 +66,7 @@ namespace Sass {
66
66
 
67
67
  // allow implicit conversion to string
68
68
  // needed for by SharedPtr implementation
69
- operator std::string() {
69
+ operator sass::string() {
70
70
  return to_string();
71
71
  }
72
72
 
@@ -74,27 +74,25 @@ namespace Sass {
74
74
 
75
75
  virtual ~AST_Node() = 0;
76
76
  virtual size_t hash() const { return 0; }
77
- virtual std::string inspect() const { return to_string({ INSPECT, 5 }); }
78
- virtual std::string to_sass() const { return to_string({ TO_SASS, 5 }); }
79
- virtual std::string to_string(Sass_Inspect_Options opt) const;
80
- virtual std::string to_css(Sass_Inspect_Options opt) const;
81
- virtual std::string to_string() const;
77
+ virtual sass::string inspect() const { return to_string({ INSPECT, 5 }); }
78
+ virtual sass::string to_sass() const { return to_string({ TO_SASS, 5 }); }
79
+ virtual sass::string to_string(Sass_Inspect_Options opt) const;
80
+ virtual sass::string to_css(Sass_Inspect_Options opt) const;
81
+ virtual sass::string to_string() const;
82
82
  virtual void cloneChildren() {};
83
83
  // generic find function (not fully implemented yet)
84
- // ToDo: add specific implementions to all children
84
+ // ToDo: add specific implementations to all children
85
85
  virtual bool find ( bool (*f)(AST_Node_Obj) ) { return f(this); };
86
- void update_pstate(const ParserState& pstate);
87
- Offset off() { return pstate(); }
88
- Position pos() { return pstate(); }
86
+ void update_pstate(const SourceSpan& pstate);
89
87
 
90
- // Some obects are not meant to be compared
91
- // ToDo: maybe fallback to pointer comparison?
88
+ // Some objects are not meant to be compared
89
+ // ToDo: maybe fall-back to pointer comparison?
92
90
  virtual bool operator== (const AST_Node& rhs) const {
93
91
  throw std::runtime_error("operator== not implemented");
94
92
  }
95
93
 
96
94
  // We can give some reasonable implementations by using
97
- // inverst operators on the specialized implementations
95
+ // invert operators on the specialized implementations
98
96
  virtual bool operator!= (const AST_Node& rhs) const {
99
97
  // Unequal if not equal
100
98
  return !(*this == rhs);
@@ -153,13 +151,13 @@ namespace Sass {
153
151
  ADD_PROPERTY(bool, is_interpolant)
154
152
  ADD_PROPERTY(Type, concrete_type)
155
153
  public:
156
- Expression(ParserState pstate, bool d = false, bool e = false, bool i = false, Type ct = NONE);
154
+ Expression(SourceSpan pstate, bool d = false, bool e = false, bool i = false, Type ct = NONE);
157
155
  virtual operator bool() { return true; }
158
156
  virtual ~Expression() { }
159
157
  virtual bool is_invisible() const { return false; }
160
158
 
161
- virtual std::string type() const { return ""; }
162
- static std::string type_name() { return ""; }
159
+ virtual sass::string type() const { return ""; }
160
+ static sass::string type_name() { return ""; }
163
161
 
164
162
  virtual bool is_false() { return false; }
165
163
  // virtual bool is_true() { return !is_false(); }
@@ -184,17 +182,17 @@ namespace Sass {
184
182
 
185
183
  namespace std {
186
184
  template<>
187
- struct hash<Sass::Expression_Obj>
185
+ struct hash<Sass::ExpressionObj>
188
186
  {
189
- size_t operator()(Sass::Expression_Obj s) const
187
+ size_t operator()(Sass::ExpressionObj s) const
190
188
  {
191
189
  return s->hash();
192
190
  }
193
191
  };
194
192
  template<>
195
- struct equal_to<Sass::Expression_Obj>
193
+ struct equal_to<Sass::ExpressionObj>
196
194
  {
197
- bool operator()( Sass::Expression_Obj lhs, Sass::Expression_Obj rhs) const
195
+ bool operator()( Sass::ExpressionObj lhs, Sass::ExpressionObj rhs) const
198
196
  {
199
197
  return lhs->hash() == rhs->hash();
200
198
  }
@@ -210,7 +208,7 @@ namespace Sass {
210
208
  /////////////////////////////////////////////////////////////////////////////
211
209
  template <typename T>
212
210
  class Vectorized {
213
- std::vector<T> elements_;
211
+ sass::vector<T> elements_;
214
212
  protected:
215
213
  mutable size_t hash_;
216
214
  void reset_hash() { hash_ = 0; }
@@ -218,7 +216,7 @@ namespace Sass {
218
216
  public:
219
217
  Vectorized(size_t s = 0) : hash_(0)
220
218
  { elements_.reserve(s); }
221
- Vectorized(std::vector<T> vec) :
219
+ Vectorized(sass::vector<T> vec) :
222
220
  elements_(std::move(vec)),
223
221
  hash_(0)
224
222
  {}
@@ -248,23 +246,23 @@ namespace Sass {
248
246
  const T& get(size_t i) const { return elements_[i]; }
249
247
  const T& operator[](size_t i) const { return elements_[i]; }
250
248
 
251
- // Implicitly get the std::vector from our object
252
- // Makes the Vector directly assignable to std::vector
249
+ // Implicitly get the sass::vector from our object
250
+ // Makes the Vector directly assignable to sass::vector
253
251
  // You are responsible to make a copy if needed
254
252
  // Note: since this returns the real object, we can't
255
253
  // Note: guarantee that the hash will not get out of sync
256
- operator std::vector<T>&() { return elements_; }
257
- operator const std::vector<T>&() const { return elements_; }
254
+ operator sass::vector<T>&() { return elements_; }
255
+ operator const sass::vector<T>&() const { return elements_; }
258
256
 
259
- // Explicitly request all elements as a real std::vector
257
+ // Explicitly request all elements as a real sass::vector
260
258
  // You are responsible to make a copy if needed
261
259
  // Note: since this returns the real object, we can't
262
260
  // Note: guarantee that the hash will not get out of sync
263
- std::vector<T>& elements() { return elements_; }
264
- const std::vector<T>& elements() const { return elements_; }
261
+ sass::vector<T>& elements() { return elements_; }
262
+ const sass::vector<T>& elements() const { return elements_; }
265
263
 
266
264
  // Insert all items from compatible vector
267
- void concat(const std::vector<T>& v)
265
+ void concat(const sass::vector<T>& v)
268
266
  {
269
267
  if (!v.empty()) reset_hash();
270
268
  elements().insert(end(), v.begin(), v.end());
@@ -320,7 +318,7 @@ namespace Sass {
320
318
  }
321
319
 
322
320
  // This might be better implemented as `operator=`?
323
- void elements(std::vector<T> e) {
321
+ void elements(sass::vector<T> e) {
324
322
  reset_hash();
325
323
  elements_ = std::move(e);
326
324
  }
@@ -336,17 +334,17 @@ namespace Sass {
336
334
  }
337
335
 
338
336
  template <typename P, typename V>
339
- typename std::vector<T>::iterator insert(P position, const V& val) {
337
+ typename sass::vector<T>::iterator insert(P position, const V& val) {
340
338
  reset_hash();
341
339
  return elements_.insert(position, val);
342
340
  }
343
341
 
344
- typename std::vector<T>::iterator end() { return elements_.end(); }
345
- typename std::vector<T>::iterator begin() { return elements_.begin(); }
346
- typename std::vector<T>::const_iterator end() const { return elements_.end(); }
347
- typename std::vector<T>::const_iterator begin() const { return elements_.begin(); }
348
- typename std::vector<T>::iterator erase(typename std::vector<T>::iterator el) { reset_hash(); return elements_.erase(el); }
349
- typename std::vector<T>::const_iterator erase(typename std::vector<T>::const_iterator el) { reset_hash(); return elements_.erase(el); }
342
+ typename sass::vector<T>::iterator end() { return elements_.end(); }
343
+ typename sass::vector<T>::iterator begin() { return elements_.begin(); }
344
+ typename sass::vector<T>::const_iterator end() const { return elements_.end(); }
345
+ typename sass::vector<T>::const_iterator begin() const { return elements_.begin(); }
346
+ typename sass::vector<T>::iterator erase(typename sass::vector<T>::iterator el) { reset_hash(); return elements_.erase(el); }
347
+ typename sass::vector<T>::const_iterator erase(typename sass::vector<T>::const_iterator el) { reset_hash(); return elements_.erase(el); }
350
348
 
351
349
  };
352
350
  template <typename T>
@@ -354,7 +352,7 @@ namespace Sass {
354
352
 
355
353
  /////////////////////////////////////////////////////////////////////////////
356
354
  // Mixin class for AST nodes that should behave like a hash table. Uses an
357
- // extra <std::vector> internally to maintain insertion order for interation.
355
+ // extra <sass::vector> internally to maintain insertion order for interation.
358
356
  /////////////////////////////////////////////////////////////////////////////
359
357
  template <typename K, typename T, typename U>
360
358
  class Hashed {
@@ -363,8 +361,8 @@ namespace Sass {
363
361
  K, T, ObjHash, ObjEquality
364
362
  > elements_;
365
363
 
366
- std::vector<K> _keys;
367
- std::vector<T> _values;
364
+ sass::vector<K> _keys;
365
+ sass::vector<T> _values;
368
366
  protected:
369
367
  mutable size_t hash_;
370
368
  K duplicate_key_;
@@ -437,13 +435,13 @@ namespace Sass {
437
435
  K, T, ObjHash, ObjEquality
438
436
  >& pairs() const { return elements_; }
439
437
 
440
- const std::vector<K>& keys() const { return _keys; }
441
- const std::vector<T>& values() const { return _values; }
438
+ const sass::vector<K>& keys() const { return _keys; }
439
+ const sass::vector<T>& values() const { return _values; }
442
440
 
443
- // std::unordered_map<Expression_Obj, Expression_Obj>::iterator end() { return elements_.end(); }
444
- // std::unordered_map<Expression_Obj, Expression_Obj>::iterator begin() { return elements_.begin(); }
445
- // std::unordered_map<Expression_Obj, Expression_Obj>::const_iterator end() const { return elements_.end(); }
446
- // std::unordered_map<Expression_Obj, Expression_Obj>::const_iterator begin() const { return elements_.begin(); }
441
+ // std::unordered_map<ExpressionObj, ExpressionObj>::iterator end() { return elements_.end(); }
442
+ // std::unordered_map<ExpressionObj, ExpressionObj>::iterator begin() { return elements_.begin(); }
443
+ // std::unordered_map<ExpressionObj, ExpressionObj>::const_iterator end() const { return elements_.end(); }
444
+ // std::unordered_map<ExpressionObj, ExpressionObj>::const_iterator begin() const { return elements_.begin(); }
447
445
 
448
446
  };
449
447
  template <typename K, typename T, typename U>
@@ -486,7 +484,7 @@ namespace Sass {
486
484
  ADD_PROPERTY(size_t, tabs)
487
485
  ADD_PROPERTY(bool, group_end)
488
486
  public:
489
- Statement(ParserState pstate, Type st = NONE, size_t t = 0);
487
+ Statement(SourceSpan pstate, Type st = NONE, size_t t = 0);
490
488
  virtual ~Statement() = 0; // virtual destructor
491
489
  // needed for rearranging nested rulesets during CSS emission
492
490
  virtual bool bubbles();
@@ -505,7 +503,7 @@ namespace Sass {
505
503
  protected:
506
504
  void adjust_after_pushing(Statement_Obj s) override {}
507
505
  public:
508
- Block(ParserState pstate, size_t s = 0, bool r = false);
506
+ Block(SourceSpan pstate, size_t s = 0, bool r = false);
509
507
  bool isInvisible() const;
510
508
  bool has_content() override;
511
509
  ATTACH_AST_OPERATIONS(Block)
@@ -515,28 +513,28 @@ namespace Sass {
515
513
  ////////////////////////////////////////////////////////////////////////
516
514
  // Abstract base class for statements that contain blocks of statements.
517
515
  ////////////////////////////////////////////////////////////////////////
518
- class Has_Block : public Statement {
516
+ class ParentStatement : public Statement {
519
517
  ADD_PROPERTY(Block_Obj, block)
520
518
  public:
521
- Has_Block(ParserState pstate, Block_Obj b);
522
- Has_Block(const Has_Block* ptr); // copy constructor
523
- virtual ~Has_Block() = 0; // virtual destructor
519
+ ParentStatement(SourceSpan pstate, Block_Obj b);
520
+ ParentStatement(const ParentStatement* ptr); // copy constructor
521
+ virtual ~ParentStatement() = 0; // virtual destructor
524
522
  virtual bool has_content() override;
525
523
  };
526
- inline Has_Block::~Has_Block() { }
524
+ inline ParentStatement::~ParentStatement() { }
527
525
 
528
526
  /////////////////////////////////////////////////////////////////////////////
529
527
  // Rulesets (i.e., sets of styles headed by a selector and containing a block
530
528
  // of style declarations.
531
529
  /////////////////////////////////////////////////////////////////////////////
532
- class Ruleset final : public Has_Block {
530
+ class StyleRule final : public ParentStatement {
533
531
  ADD_PROPERTY(SelectorListObj, selector)
534
532
  ADD_PROPERTY(Selector_Schema_Obj, schema)
535
533
  ADD_PROPERTY(bool, is_root);
536
534
  public:
537
- Ruleset(ParserState pstate, SelectorListObj s = {}, Block_Obj b = {});
535
+ StyleRule(SourceSpan pstate, SelectorListObj s = {}, Block_Obj b = {});
538
536
  bool is_invisible() const override;
539
- ATTACH_AST_OPERATIONS(Ruleset)
537
+ ATTACH_AST_OPERATIONS(StyleRule)
540
538
  ATTACH_CRTP_PERFORM_METHODS()
541
539
  };
542
540
 
@@ -547,7 +545,7 @@ namespace Sass {
547
545
  ADD_PROPERTY(Statement_Obj, node)
548
546
  ADD_PROPERTY(bool, group_end)
549
547
  public:
550
- Bubble(ParserState pstate, Statement_Obj n, Statement_Obj g = {}, size_t t = 0);
548
+ Bubble(SourceSpan pstate, Statement_Obj n, Statement_Obj g = {}, size_t t = 0);
551
549
  bool bubbles() override;
552
550
  ATTACH_AST_OPERATIONS(Bubble)
553
551
  ATTACH_CRTP_PERFORM_METHODS()
@@ -556,11 +554,11 @@ namespace Sass {
556
554
  /////////////////
557
555
  // Trace.
558
556
  /////////////////
559
- class Trace final : public Has_Block {
557
+ class Trace final : public ParentStatement {
560
558
  ADD_CONSTREF(char, type)
561
- ADD_CONSTREF(std::string, name)
559
+ ADD_CONSTREF(sass::string, name)
562
560
  public:
563
- Trace(ParserState pstate, std::string n, Block_Obj b = {}, char type = 'm');
561
+ Trace(SourceSpan pstate, sass::string n, Block_Obj b = {}, char type = 'm');
564
562
  ATTACH_AST_OPERATIONS(Trace)
565
563
  ATTACH_CRTP_PERFORM_METHODS()
566
564
  };
@@ -569,28 +567,28 @@ namespace Sass {
569
567
  // At-rules -- arbitrary directives beginning with "@" that may have an
570
568
  // optional statement block.
571
569
  ///////////////////////////////////////////////////////////////////////
572
- class Directive final : public Has_Block {
573
- ADD_CONSTREF(std::string, keyword)
570
+ class AtRule final : public ParentStatement {
571
+ ADD_CONSTREF(sass::string, keyword)
574
572
  ADD_PROPERTY(SelectorListObj, selector)
575
- ADD_PROPERTY(Expression_Obj, value)
573
+ ADD_PROPERTY(ExpressionObj, value)
576
574
  public:
577
- Directive(ParserState pstate, std::string kwd, SelectorListObj sel = {}, Block_Obj b = {}, Expression_Obj val = {});
575
+ AtRule(SourceSpan pstate, sass::string kwd, SelectorListObj sel = {}, Block_Obj b = {}, ExpressionObj val = {});
578
576
  bool bubbles() override;
579
577
  bool is_media();
580
578
  bool is_keyframes();
581
- ATTACH_AST_OPERATIONS(Directive)
579
+ ATTACH_AST_OPERATIONS(AtRule)
582
580
  ATTACH_CRTP_PERFORM_METHODS()
583
581
  };
584
582
 
585
583
  ///////////////////////////////////////////////////////////////////////
586
584
  // Keyframe-rules -- the child blocks of "@keyframes" nodes.
587
585
  ///////////////////////////////////////////////////////////////////////
588
- class Keyframe_Rule final : public Has_Block {
586
+ class Keyframe_Rule final : public ParentStatement {
589
587
  // according to css spec, this should be <keyframes-name>
590
588
  // <keyframes-name> = <custom-ident> | <string>
591
589
  ADD_PROPERTY(SelectorListObj, name)
592
590
  public:
593
- Keyframe_Rule(ParserState pstate, Block_Obj b);
591
+ Keyframe_Rule(SourceSpan pstate, Block_Obj b);
594
592
  ATTACH_AST_OPERATIONS(Keyframe_Rule)
595
593
  ATTACH_CRTP_PERFORM_METHODS()
596
594
  };
@@ -598,14 +596,14 @@ namespace Sass {
598
596
  ////////////////////////////////////////////////////////////////////////
599
597
  // Declarations -- style rules consisting of a property name and values.
600
598
  ////////////////////////////////////////////////////////////////////////
601
- class Declaration final : public Has_Block {
599
+ class Declaration final : public ParentStatement {
602
600
  ADD_PROPERTY(String_Obj, property)
603
- ADD_PROPERTY(Expression_Obj, value)
601
+ ADD_PROPERTY(ExpressionObj, value)
604
602
  ADD_PROPERTY(bool, is_important)
605
603
  ADD_PROPERTY(bool, is_custom_property)
606
604
  ADD_PROPERTY(bool, is_indented)
607
605
  public:
608
- Declaration(ParserState pstate, String_Obj prop, Expression_Obj val, bool i = false, bool c = false, Block_Obj b = {});
606
+ Declaration(SourceSpan pstate, String_Obj prop, ExpressionObj val, bool i = false, bool c = false, Block_Obj b = {});
609
607
  bool is_invisible() const override;
610
608
  ATTACH_AST_OPERATIONS(Declaration)
611
609
  ATTACH_CRTP_PERFORM_METHODS()
@@ -615,12 +613,12 @@ namespace Sass {
615
613
  // Assignments -- variable and value.
616
614
  /////////////////////////////////////
617
615
  class Assignment final : public Statement {
618
- ADD_CONSTREF(std::string, variable)
619
- ADD_PROPERTY(Expression_Obj, value)
616
+ ADD_CONSTREF(sass::string, variable)
617
+ ADD_PROPERTY(ExpressionObj, value)
620
618
  ADD_PROPERTY(bool, is_default)
621
619
  ADD_PROPERTY(bool, is_global)
622
620
  public:
623
- Assignment(ParserState pstate, std::string var, Expression_Obj val, bool is_default = false, bool is_global = false);
621
+ Assignment(SourceSpan pstate, sass::string var, ExpressionObj val, bool is_default = false, bool is_global = false);
624
622
  ATTACH_AST_OPERATIONS(Assignment)
625
623
  ATTACH_CRTP_PERFORM_METHODS()
626
624
  };
@@ -630,13 +628,13 @@ namespace Sass {
630
628
  // necessary to store a list of each in an Import node.
631
629
  ////////////////////////////////////////////////////////////////////////////
632
630
  class Import final : public Statement {
633
- std::vector<Expression_Obj> urls_;
634
- std::vector<Include> incs_;
631
+ sass::vector<ExpressionObj> urls_;
632
+ sass::vector<Include> incs_;
635
633
  ADD_PROPERTY(List_Obj, import_queries);
636
634
  public:
637
- Import(ParserState pstate);
638
- std::vector<Include>& incs();
639
- std::vector<Expression_Obj>& urls();
635
+ Import(SourceSpan pstate);
636
+ sass::vector<Include>& incs();
637
+ sass::vector<ExpressionObj>& urls();
640
638
  ATTACH_AST_OPERATIONS(Import)
641
639
  ATTACH_CRTP_PERFORM_METHODS()
642
640
  };
@@ -646,10 +644,10 @@ namespace Sass {
646
644
  class Import_Stub final : public Statement {
647
645
  Include resource_;
648
646
  public:
649
- Import_Stub(ParserState pstate, Include res);
647
+ Import_Stub(SourceSpan pstate, Include res);
650
648
  Include resource();
651
- std::string imp_path();
652
- std::string abs_path();
649
+ sass::string imp_path();
650
+ sass::string abs_path();
653
651
  ATTACH_AST_OPERATIONS(Import_Stub)
654
652
  ATTACH_CRTP_PERFORM_METHODS()
655
653
  };
@@ -657,33 +655,33 @@ namespace Sass {
657
655
  //////////////////////////////
658
656
  // The Sass `@warn` directive.
659
657
  //////////////////////////////
660
- class Warning final : public Statement {
661
- ADD_PROPERTY(Expression_Obj, message)
658
+ class WarningRule final : public Statement {
659
+ ADD_PROPERTY(ExpressionObj, message)
662
660
  public:
663
- Warning(ParserState pstate, Expression_Obj msg);
664
- ATTACH_AST_OPERATIONS(Warning)
661
+ WarningRule(SourceSpan pstate, ExpressionObj msg);
662
+ ATTACH_AST_OPERATIONS(WarningRule)
665
663
  ATTACH_CRTP_PERFORM_METHODS()
666
664
  };
667
665
 
668
666
  ///////////////////////////////
669
667
  // The Sass `@error` directive.
670
668
  ///////////////////////////////
671
- class Error final : public Statement {
672
- ADD_PROPERTY(Expression_Obj, message)
669
+ class ErrorRule final : public Statement {
670
+ ADD_PROPERTY(ExpressionObj, message)
673
671
  public:
674
- Error(ParserState pstate, Expression_Obj msg);
675
- ATTACH_AST_OPERATIONS(Error)
672
+ ErrorRule(SourceSpan pstate, ExpressionObj msg);
673
+ ATTACH_AST_OPERATIONS(ErrorRule)
676
674
  ATTACH_CRTP_PERFORM_METHODS()
677
675
  };
678
676
 
679
677
  ///////////////////////////////
680
678
  // The Sass `@debug` directive.
681
679
  ///////////////////////////////
682
- class Debug final : public Statement {
683
- ADD_PROPERTY(Expression_Obj, value)
680
+ class DebugRule final : public Statement {
681
+ ADD_PROPERTY(ExpressionObj, value)
684
682
  public:
685
- Debug(ParserState pstate, Expression_Obj val);
686
- ATTACH_AST_OPERATIONS(Debug)
683
+ DebugRule(SourceSpan pstate, ExpressionObj val);
684
+ ATTACH_AST_OPERATIONS(DebugRule)
687
685
  ATTACH_CRTP_PERFORM_METHODS()
688
686
  };
689
687
 
@@ -694,7 +692,7 @@ namespace Sass {
694
692
  ADD_PROPERTY(String_Obj, text)
695
693
  ADD_PROPERTY(bool, is_important)
696
694
  public:
697
- Comment(ParserState pstate, String_Obj txt, bool is_important);
695
+ Comment(SourceSpan pstate, String_Obj txt, bool is_important);
698
696
  virtual bool is_invisible() const override;
699
697
  ATTACH_AST_OPERATIONS(Comment)
700
698
  ATTACH_CRTP_PERFORM_METHODS()
@@ -703,11 +701,11 @@ namespace Sass {
703
701
  ////////////////////////////////////
704
702
  // The Sass `@if` control directive.
705
703
  ////////////////////////////////////
706
- class If final : public Has_Block {
707
- ADD_PROPERTY(Expression_Obj, predicate)
704
+ class If final : public ParentStatement {
705
+ ADD_PROPERTY(ExpressionObj, predicate)
708
706
  ADD_PROPERTY(Block_Obj, alternative)
709
707
  public:
710
- If(ParserState pstate, Expression_Obj pred, Block_Obj con, Block_Obj alt = {});
708
+ If(SourceSpan pstate, ExpressionObj pred, Block_Obj con, Block_Obj alt = {});
711
709
  virtual bool has_content() override;
712
710
  ATTACH_AST_OPERATIONS(If)
713
711
  ATTACH_CRTP_PERFORM_METHODS()
@@ -716,37 +714,37 @@ namespace Sass {
716
714
  /////////////////////////////////////
717
715
  // The Sass `@for` control directive.
718
716
  /////////////////////////////////////
719
- class For final : public Has_Block {
720
- ADD_CONSTREF(std::string, variable)
721
- ADD_PROPERTY(Expression_Obj, lower_bound)
722
- ADD_PROPERTY(Expression_Obj, upper_bound)
717
+ class ForRule final : public ParentStatement {
718
+ ADD_CONSTREF(sass::string, variable)
719
+ ADD_PROPERTY(ExpressionObj, lower_bound)
720
+ ADD_PROPERTY(ExpressionObj, upper_bound)
723
721
  ADD_PROPERTY(bool, is_inclusive)
724
722
  public:
725
- For(ParserState pstate, std::string var, Expression_Obj lo, Expression_Obj hi, Block_Obj b, bool inc);
726
- ATTACH_AST_OPERATIONS(For)
723
+ ForRule(SourceSpan pstate, sass::string var, ExpressionObj lo, ExpressionObj hi, Block_Obj b, bool inc);
724
+ ATTACH_AST_OPERATIONS(ForRule)
727
725
  ATTACH_CRTP_PERFORM_METHODS()
728
726
  };
729
727
 
730
728
  //////////////////////////////////////
731
729
  // The Sass `@each` control directive.
732
730
  //////////////////////////////////////
733
- class Each final : public Has_Block {
734
- ADD_PROPERTY(std::vector<std::string>, variables)
735
- ADD_PROPERTY(Expression_Obj, list)
731
+ class EachRule final : public ParentStatement {
732
+ ADD_PROPERTY(sass::vector<sass::string>, variables)
733
+ ADD_PROPERTY(ExpressionObj, list)
736
734
  public:
737
- Each(ParserState pstate, std::vector<std::string> vars, Expression_Obj lst, Block_Obj b);
738
- ATTACH_AST_OPERATIONS(Each)
735
+ EachRule(SourceSpan pstate, sass::vector<sass::string> vars, ExpressionObj lst, Block_Obj b);
736
+ ATTACH_AST_OPERATIONS(EachRule)
739
737
  ATTACH_CRTP_PERFORM_METHODS()
740
738
  };
741
739
 
742
740
  ///////////////////////////////////////
743
741
  // The Sass `@while` control directive.
744
742
  ///////////////////////////////////////
745
- class While final : public Has_Block {
746
- ADD_PROPERTY(Expression_Obj, predicate)
743
+ class WhileRule final : public ParentStatement {
744
+ ADD_PROPERTY(ExpressionObj, predicate)
747
745
  public:
748
- While(ParserState pstate, Expression_Obj pred, Block_Obj b);
749
- ATTACH_AST_OPERATIONS(While)
746
+ WhileRule(SourceSpan pstate, ExpressionObj pred, Block_Obj b);
747
+ ATTACH_AST_OPERATIONS(WhileRule)
750
748
  ATTACH_CRTP_PERFORM_METHODS()
751
749
  };
752
750
 
@@ -754,9 +752,9 @@ namespace Sass {
754
752
  // The @return directive for use inside SassScript functions.
755
753
  /////////////////////////////////////////////////////////////
756
754
  class Return final : public Statement {
757
- ADD_PROPERTY(Expression_Obj, value)
755
+ ADD_PROPERTY(ExpressionObj, value)
758
756
  public:
759
- Return(ParserState pstate, Expression_Obj val);
757
+ Return(SourceSpan pstate, ExpressionObj val);
760
758
  ATTACH_AST_OPERATIONS(Return)
761
759
  ATTACH_CRTP_PERFORM_METHODS()
762
760
  };
@@ -765,10 +763,10 @@ namespace Sass {
765
763
  // Definitions for both mixins and functions. The two cases are distinguished
766
764
  // by a type tag.
767
765
  /////////////////////////////////////////////////////////////////////////////
768
- class Definition final : public Has_Block {
766
+ class Definition final : public ParentStatement {
769
767
  public:
770
768
  enum Type { MIXIN, FUNCTION };
771
- ADD_CONSTREF(std::string, name)
769
+ ADD_CONSTREF(sass::string, name)
772
770
  ADD_PROPERTY(Parameters_Obj, parameters)
773
771
  ADD_PROPERTY(Env*, environment)
774
772
  ADD_PROPERTY(Type, type)
@@ -778,20 +776,20 @@ namespace Sass {
778
776
  ADD_PROPERTY(bool, is_overload_stub)
779
777
  ADD_PROPERTY(Signature, signature)
780
778
  public:
781
- Definition(ParserState pstate,
782
- std::string n,
779
+ Definition(SourceSpan pstate,
780
+ sass::string n,
783
781
  Parameters_Obj params,
784
782
  Block_Obj b,
785
783
  Type t);
786
- Definition(ParserState pstate,
784
+ Definition(SourceSpan pstate,
787
785
  Signature sig,
788
- std::string n,
786
+ sass::string n,
789
787
  Parameters_Obj params,
790
788
  Native_Function func_ptr,
791
789
  bool overload_stub = false);
792
- Definition(ParserState pstate,
790
+ Definition(SourceSpan pstate,
793
791
  Signature sig,
794
- std::string n,
792
+ sass::string n,
795
793
  Parameters_Obj params,
796
794
  Sass_Function_Entry c_func);
797
795
  ATTACH_AST_OPERATIONS(Definition)
@@ -801,12 +799,12 @@ namespace Sass {
801
799
  //////////////////////////////////////
802
800
  // Mixin calls (i.e., `@include ...`).
803
801
  //////////////////////////////////////
804
- class Mixin_Call final : public Has_Block {
805
- ADD_CONSTREF(std::string, name)
802
+ class Mixin_Call final : public ParentStatement {
803
+ ADD_CONSTREF(sass::string, name)
806
804
  ADD_PROPERTY(Arguments_Obj, arguments)
807
805
  ADD_PROPERTY(Parameters_Obj, block_parameters)
808
806
  public:
809
- Mixin_Call(ParserState pstate, std::string n, Arguments_Obj args, Parameters_Obj b_params = {}, Block_Obj b = {});
807
+ Mixin_Call(SourceSpan pstate, sass::string n, Arguments_Obj args, Parameters_Obj b_params = {}, Block_Obj b = {});
810
808
  ATTACH_AST_OPERATIONS(Mixin_Call)
811
809
  ATTACH_CRTP_PERFORM_METHODS()
812
810
  };
@@ -817,7 +815,7 @@ namespace Sass {
817
815
  class Content final : public Statement {
818
816
  ADD_PROPERTY(Arguments_Obj, arguments)
819
817
  public:
820
- Content(ParserState pstate, Arguments_Obj args);
818
+ Content(SourceSpan pstate, Arguments_Obj args);
821
819
  ATTACH_AST_OPERATIONS(Content)
822
820
  ATTACH_CRTP_PERFORM_METHODS()
823
821
  };
@@ -830,11 +828,11 @@ namespace Sass {
830
828
  enum Type { PLUS, MINUS, NOT, SLASH };
831
829
  private:
832
830
  HASH_PROPERTY(Type, optype)
833
- HASH_PROPERTY(Expression_Obj, operand)
831
+ HASH_PROPERTY(ExpressionObj, operand)
834
832
  mutable size_t hash_;
835
833
  public:
836
- Unary_Expression(ParserState pstate, Type t, Expression_Obj o);
837
- const std::string type_name();
834
+ Unary_Expression(SourceSpan pstate, Type t, ExpressionObj o);
835
+ const sass::string type_name();
838
836
  virtual bool operator==(const Expression& rhs) const override;
839
837
  size_t hash() const override;
840
838
  ATTACH_AST_OPERATIONS(Unary_Expression)
@@ -845,13 +843,13 @@ namespace Sass {
845
843
  // Individual argument objects for mixin and function calls.
846
844
  ////////////////////////////////////////////////////////////
847
845
  class Argument final : public Expression {
848
- HASH_PROPERTY(Expression_Obj, value)
849
- HASH_CONSTREF(std::string, name)
846
+ HASH_PROPERTY(ExpressionObj, value)
847
+ HASH_CONSTREF(sass::string, name)
850
848
  ADD_PROPERTY(bool, is_rest_argument)
851
849
  ADD_PROPERTY(bool, is_keyword_argument)
852
850
  mutable size_t hash_;
853
851
  public:
854
- Argument(ParserState pstate, Expression_Obj val, std::string n = "", bool rest = false, bool keyword = false);
852
+ Argument(SourceSpan pstate, ExpressionObj val, sass::string n = "", bool rest = false, bool keyword = false);
855
853
  void set_delayed(bool delayed) override;
856
854
  bool operator==(const Expression& rhs) const override;
857
855
  size_t hash() const override;
@@ -871,7 +869,7 @@ namespace Sass {
871
869
  protected:
872
870
  void adjust_after_pushing(Argument_Obj a) override;
873
871
  public:
874
- Arguments(ParserState pstate);
872
+ Arguments(SourceSpan pstate);
875
873
  void set_delayed(bool delayed) override;
876
874
  Argument_Obj get_rest_argument();
877
875
  Argument_Obj get_keyword_argument();
@@ -880,12 +878,12 @@ namespace Sass {
880
878
  };
881
879
 
882
880
 
883
- // A Media Ruleset before it has been evaluated
881
+ // A Media StyleRule before it has been evaluated
884
882
  // Could be already final or an interpolation
885
- class MediaRule final : public Has_Block {
883
+ class MediaRule final : public ParentStatement {
886
884
  ADD_PROPERTY(List_Obj, schema)
887
885
  public:
888
- MediaRule(ParserState pstate, Block_Obj block = {});
886
+ MediaRule(SourceSpan pstate, Block_Obj block = {});
889
887
 
890
888
  bool bubbles() override { return true; };
891
889
  bool is_invisible() const override { return false; };
@@ -893,12 +891,12 @@ namespace Sass {
893
891
  ATTACH_CRTP_PERFORM_METHODS()
894
892
  };
895
893
 
896
- // A Media Ruleset after it has been evaluated
894
+ // A Media StyleRule after it has been evaluated
897
895
  // Representing the static or resulting css
898
- class CssMediaRule final : public Has_Block,
896
+ class CssMediaRule final : public ParentStatement,
899
897
  public Vectorized<CssMediaQuery_Obj> {
900
898
  public:
901
- CssMediaRule(ParserState pstate, Block_Obj b);
899
+ CssMediaRule(SourceSpan pstate, Block_Obj b);
902
900
  bool bubbles() override { return true; };
903
901
  bool isInvisible() const { return empty(); }
904
902
  bool is_invisible() const override { return false; };
@@ -925,17 +923,17 @@ namespace Sass {
925
923
 
926
924
  // The modifier, probably either "not" or "only".
927
925
  // This may be `null` if no modifier is in use.
928
- ADD_PROPERTY(std::string, modifier);
926
+ ADD_PROPERTY(sass::string, modifier);
929
927
 
930
928
  // The media type, for example "screen" or "print".
931
929
  // This may be `null`. If so, [features] will not be empty.
932
- ADD_PROPERTY(std::string, type);
930
+ ADD_PROPERTY(sass::string, type);
933
931
 
934
932
  // Feature queries, including parentheses.
935
- ADD_PROPERTY(std::vector<std::string>, features);
933
+ ADD_PROPERTY(sass::vector<sass::string>, features);
936
934
 
937
935
  public:
938
- CssMediaQuery(ParserState pstate);
936
+ CssMediaQuery(SourceSpan pstate);
939
937
 
940
938
  // Check if two instances are considered equal
941
939
  bool operator== (const CssMediaQuery& rhs) const;
@@ -970,12 +968,12 @@ namespace Sass {
970
968
  // ToDo: only used for interpolation case
971
969
  ////////////////////////////////////////////////////
972
970
  class Media_Query final : public Expression,
973
- public Vectorized<Media_Query_Expression_Obj> {
971
+ public Vectorized<Media_Query_ExpressionObj> {
974
972
  ADD_PROPERTY(String_Obj, media_type)
975
973
  ADD_PROPERTY(bool, is_negated)
976
974
  ADD_PROPERTY(bool, is_restricted)
977
975
  public:
978
- Media_Query(ParserState pstate, String_Obj t = {}, size_t s = 0, bool n = false, bool r = false);
976
+ Media_Query(SourceSpan pstate, String_Obj t = {}, size_t s = 0, bool n = false, bool r = false);
979
977
  ATTACH_AST_OPERATIONS(Media_Query)
980
978
  ATTACH_CRTP_PERFORM_METHODS()
981
979
  };
@@ -985,11 +983,11 @@ namespace Sass {
985
983
  // ToDo: only used for interpolation case
986
984
  ////////////////////////////////////////////////////
987
985
  class Media_Query_Expression final : public Expression {
988
- ADD_PROPERTY(Expression_Obj, feature)
989
- ADD_PROPERTY(Expression_Obj, value)
986
+ ADD_PROPERTY(ExpressionObj, feature)
987
+ ADD_PROPERTY(ExpressionObj, value)
990
988
  ADD_PROPERTY(bool, is_interpolated)
991
989
  public:
992
- Media_Query_Expression(ParserState pstate, Expression_Obj f, Expression_Obj v, bool i = false);
990
+ Media_Query_Expression(SourceSpan pstate, ExpressionObj f, ExpressionObj v, bool i = false);
993
991
  ATTACH_AST_OPERATIONS(Media_Query_Expression)
994
992
  ATTACH_CRTP_PERFORM_METHODS()
995
993
  };
@@ -999,11 +997,11 @@ namespace Sass {
999
997
  /////////////////////////////////////////////////
1000
998
  class At_Root_Query final : public Expression {
1001
999
  private:
1002
- ADD_PROPERTY(Expression_Obj, feature)
1003
- ADD_PROPERTY(Expression_Obj, value)
1000
+ ADD_PROPERTY(ExpressionObj, feature)
1001
+ ADD_PROPERTY(ExpressionObj, value)
1004
1002
  public:
1005
- At_Root_Query(ParserState pstate, Expression_Obj f = {}, Expression_Obj v = {}, bool i = false);
1006
- bool exclude(std::string str);
1003
+ At_Root_Query(SourceSpan pstate, ExpressionObj f = {}, ExpressionObj v = {}, bool i = false);
1004
+ bool exclude(sass::string str);
1007
1005
  ATTACH_AST_OPERATIONS(At_Root_Query)
1008
1006
  ATTACH_CRTP_PERFORM_METHODS()
1009
1007
  };
@@ -1011,13 +1009,13 @@ namespace Sass {
1011
1009
  ///////////
1012
1010
  // At-root.
1013
1011
  ///////////
1014
- class At_Root_Block final : public Has_Block {
1012
+ class AtRootRule final : public ParentStatement {
1015
1013
  ADD_PROPERTY(At_Root_Query_Obj, expression)
1016
1014
  public:
1017
- At_Root_Block(ParserState pstate, Block_Obj b = {}, At_Root_Query_Obj e = {});
1015
+ AtRootRule(SourceSpan pstate, Block_Obj b = {}, At_Root_Query_Obj e = {});
1018
1016
  bool bubbles() override;
1019
1017
  bool exclude_node(Statement_Obj s);
1020
- ATTACH_AST_OPERATIONS(At_Root_Block)
1018
+ ATTACH_AST_OPERATIONS(AtRootRule)
1021
1019
  ATTACH_CRTP_PERFORM_METHODS()
1022
1020
  };
1023
1021
 
@@ -1025,11 +1023,11 @@ namespace Sass {
1025
1023
  // Individual parameter objects for mixins and functions.
1026
1024
  /////////////////////////////////////////////////////////
1027
1025
  class Parameter final : public AST_Node {
1028
- ADD_CONSTREF(std::string, name)
1029
- ADD_PROPERTY(Expression_Obj, default_value)
1026
+ ADD_CONSTREF(sass::string, name)
1027
+ ADD_PROPERTY(ExpressionObj, default_value)
1030
1028
  ADD_PROPERTY(bool, is_rest_parameter)
1031
1029
  public:
1032
- Parameter(ParserState pstate, std::string n, Expression_Obj def = {}, bool rest = false);
1030
+ Parameter(SourceSpan pstate, sass::string n, ExpressionObj def = {}, bool rest = false);
1033
1031
  ATTACH_AST_OPERATIONS(Parameter)
1034
1032
  ATTACH_CRTP_PERFORM_METHODS()
1035
1033
  };
@@ -1045,7 +1043,7 @@ namespace Sass {
1045
1043
  protected:
1046
1044
  void adjust_after_pushing(Parameter_Obj p) override;
1047
1045
  public:
1048
- Parameters(ParserState pstate);
1046
+ Parameters(SourceSpan pstate);
1049
1047
  ATTACH_AST_OPERATIONS(Parameters)
1050
1048
  ATTACH_CRTP_PERFORM_METHODS()
1051
1049
  };