Skip to content

Commit bb56f7b

Browse files
committed
Remove the Propset AST node
1 parent b11a557 commit bb56f7b

File tree

12 files changed

+0
-82
lines changed

12 files changed

+0
-82
lines changed

src/ast.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -481,18 +481,6 @@ namespace Sass {
481481
ATTACH_OPERATIONS()
482482
};
483483

484-
/////////////////////////////////////////////////////////
485-
// Nested declaration sets (i.e., namespaced properties).
486-
/////////////////////////////////////////////////////////
487-
class Propset : public Has_Block {
488-
ADD_PROPERTY(String*, property_fragment)
489-
public:
490-
Propset(ParserState pstate, String* pf, Block* b = 0)
491-
: Has_Block(pstate, b), property_fragment_(pf)
492-
{ }
493-
ATTACH_OPERATIONS()
494-
};
495-
496484
/////////////////
497485
// Bubble.
498486
/////////////////

src/ast_factory.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Sass {
1313
// statements
1414
Block* new_Block(std::string p, size_t l, size_t s = 0, bool r = false);
1515
Ruleset* new_Ruleset(std::string p, size_t l, Selector* s, Block* b);
16-
Propset* new_Propset(std::string p, size_t l, String* pf, Block* b);
1716
Supports_Query* new_Supports_Query(std::string p, size_t l, Supports_Query* f, Block* b);
1817
Media_Query* new_Media_Query(std::string p, size_t l, List* q, Block* b);
1918
At_Root_Block* new_At_Root_Block(std::string p, size_t l, Selector* sel, Block* b);

src/ast_fwd_decl.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace Sass {
1111
class Statement;
1212
class Block;
1313
class Ruleset;
14-
class Propset;
1514
class Bubble;
1615
class Trace;
1716
class Media_Block;

src/cssize.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ namespace Sass {
2929

3030
Statement* operator()(Block*);
3131
Statement* operator()(Ruleset*);
32-
// Statement* operator()(Propset*);
3332
// Statement* operator()(Bubble*);
3433
Statement* operator()(Media_Block*);
3534
Statement* operator()(Supports_Block*);

src/debugger.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
151151
std::cerr << (selector->has_line_feed() ? " [line-feed]": " -");
152152
std::cerr << " <" << prettyprint(selector->pstate().token.ws_before()) << ">" << std::endl;
153153
for(auto i : selector->elements()) { debug_ast(i, ind + " ", env); }
154-
} else if (dynamic_cast<Propset*>(node)) {
155-
Propset* selector = dynamic_cast<Propset*>(node);
156-
std::cerr << ind << "Propset " << selector;
157-
std::cerr << " (" << pstate_source_position(node) << ")";
158-
std::cerr << " <" << dynamic_cast<String_Constant*>(selector->property_fragment())->value() << ">";
159-
std::cerr << " " << selector->tabs() << std::endl;
160-
if (selector->block()) for(auto i : selector->block()->elements()) { debug_ast(i, ind + " ", env); }
161154
} else if (dynamic_cast<Wrapped_Selector*>(node)) {
162155
Wrapped_Selector* selector = dynamic_cast<Wrapped_Selector*>(node);
163156
std::cerr << ind << "Wrapped_Selector " << selector;

src/expand.cpp

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -153,53 +153,6 @@ namespace Sass {
153153
return rr;
154154
}
155155

156-
// this is not properly implemented
157-
// mixes string_schema and statement
158-
Statement* Expand::operator()(Propset* p)
159-
{
160-
String* fragment = dynamic_cast<String*>(p->property_fragment()->perform(&eval));
161-
Propset* prop = SASS_MEMORY_NEW(ctx.mem, Propset,
162-
p->pstate(),
163-
fragment,
164-
p->block()->perform(this)->block());
165-
prop->tabs(p->tabs());
166-
return prop;
167-
168-
169-
property_stack.push_back(p->property_fragment());
170-
Block* expanded_block = p->block()->perform(this)->block();
171-
for (size_t i = 0, L = expanded_block->length(); i < L; ++i) {
172-
Statement* stm = (*expanded_block)[i];
173-
if (Declaration* dec = static_cast<Declaration*>(stm)) {
174-
// dec = SASS_MEMORY_NEW(ctx.mem, Declaration, *dec);
175-
String_Schema* combined_prop = SASS_MEMORY_NEW(ctx.mem, String_Schema, p->pstate());
176-
if (!property_stack.empty()) {
177-
*combined_prop << property_stack.back()->perform(&eval);
178-
*combined_prop << SASS_MEMORY_NEW(ctx.mem, String_Quoted, p->pstate(), "-");
179-
if (dec->property()) {
180-
// we cannot directly add block (from dec->property()) to string schema (combined_prop)
181-
*combined_prop << SASS_MEMORY_NEW(ctx.mem, String_Quoted, dec->pstate(), dec->property()->to_string());
182-
}
183-
}
184-
else {
185-
*combined_prop << dec->property();
186-
}
187-
dec->property(combined_prop);
188-
*block_stack.back() << dec;
189-
}
190-
else if (typeid(*stm) == typeid(Comment)) {
191-
// drop comments in propsets
192-
}
193-
else {
194-
error("contents of namespaced properties must result in style declarations only", stm->pstate(), backtrace());
195-
}
196-
}
197-
198-
property_stack.pop_back();
199-
200-
return 0;
201-
}
202-
203156
Statement* Expand::operator()(Supports_Block* f)
204157
{
205158
Expression* condition = f->condition()->perform(&eval);

src/expand.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ namespace Sass {
4848

4949
Statement* operator()(Block*);
5050
Statement* operator()(Ruleset*);
51-
Statement* operator()(Propset*);
5251
Statement* operator()(Media_Block*);
5352
Statement* operator()(Supports_Block*);
5453
Statement* operator()(At_Root_Block*);

src/inspect.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ namespace Sass {
5151
if (rule->block()) rule->block()->perform(this);
5252
}
5353

54-
void Inspect::operator()(Propset* propset)
55-
{
56-
propset->property_fragment()->perform(this);
57-
append_colon_separator();
58-
propset->block()->perform(this);
59-
}
60-
6154
void Inspect::operator()(Bubble* bubble)
6255
{
6356
append_indentation();

src/inspect.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace Sass {
2323
// statements
2424
virtual void operator()(Block*);
2525
virtual void operator()(Ruleset*);
26-
virtual void operator()(Propset*);
2726
virtual void operator()(Bubble*);
2827
virtual void operator()(Supports_Block*);
2928
virtual void operator()(Media_Block*);

src/operation.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Sass {
1313
// statements
1414
virtual T operator()(Block* x) = 0;
1515
virtual T operator()(Ruleset* x) = 0;
16-
virtual T operator()(Propset* x) = 0;
1716
virtual T operator()(Bubble* x) = 0;
1817
virtual T operator()(Trace* x) = 0;
1918
virtual T operator()(Supports_Block* x) = 0;
@@ -95,7 +94,6 @@ namespace Sass {
9594
// statements
9695
T operator()(Block* x) { return static_cast<D*>(this)->fallback(x); }
9796
T operator()(Ruleset* x) { return static_cast<D*>(this)->fallback(x); }
98-
T operator()(Propset* x) { return static_cast<D*>(this)->fallback(x); }
9997
T operator()(Bubble* x) { return static_cast<D*>(this)->fallback(x); }
10098
T operator()(Trace* x) { return static_cast<D*>(this)->fallback(x); }
10199
T operator()(Supports_Block* x) { return static_cast<D*>(this)->fallback(x); }

0 commit comments

Comments
 (0)