Skip to content

Commit 6f80638

Browse files
committed
Implement the Trace node from Ruby Sass.
The Trace node is a simple wrapper around the result of a mixin call and `@content`. It exists as a way to group the resulting properties as a block but maintain some metadata about the initiating mixin call or `@content` block. It also plays an important rule is bubble those blocks with `@at-root` and nested property sets. This required implementing the final missing `cssize` methods. As a result we should a complete `@at-root` implementation. `Trace` "wrapping" other nodes didn't play nice with the naive check nesting implementation I lazily wrote so I also implemented 99% of the check nesting visitor like-for-like with Ruby Sass. The missing piece is handling `@imports` which is the only part I didn't need to touch in this work. Spec sass/sass-spec#868 Fixes #1585
1 parent c15f22f commit 6f80638

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/expand.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ namespace Sass {
8787

8888
Statement* Expand::operator()(Ruleset* r)
8989
{
90-
bool old_at_root_without_rule = this->at_root_without_rule;
91-
// reset when leaving scope
92-
9390
if (in_keyframes) {
9491
Keyframe_Rule* k = SASS_MEMORY_NEW(ctx.mem, Keyframe_Rule, r->pstate(), r->block()->perform(this)->block());
9592
if (r->selector()) {
@@ -100,7 +97,8 @@ namespace Sass {
10097
return k;
10198
}
10299

103-
this->at_root_without_rule = false;
100+
// reset when leaving scope
101+
LOCAL_FLAG(at_root_without_rule, false);
104102

105103
// do some special checks for the base level rules
106104
if (r->is_root()) {
@@ -154,8 +152,6 @@ namespace Sass {
154152
rr->is_root(r->is_root());
155153
rr->tabs(r->tabs());
156154

157-
this->at_root_without_rule = old_at_root_without_rule;
158-
159155
return rr;
160156
}
161157

0 commit comments

Comments
 (0)