File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,8 @@ namespace Sass {
475
475
} else {
476
476
hasDeclarations = true ;
477
477
}
478
+ } else if (Declaration* d = dynamic_cast <Declaration*>(stm)) {
479
+ return isPrintable (d, style);
478
480
} else {
479
481
hasDeclarations = true ;
480
482
}
@@ -487,6 +489,28 @@ namespace Sass {
487
489
return false ;
488
490
}
489
491
492
+ bool isPrintable (String_Constant* s, Output_Style style)
493
+ {
494
+ return ! s->value ().empty ();
495
+ }
496
+
497
+ bool isPrintable (String_Quoted* s, Output_Style style)
498
+ {
499
+ return true ;
500
+ }
501
+
502
+ bool isPrintable (Declaration* d, Output_Style style)
503
+ {
504
+ Expression* val = d->value ();
505
+ if (String_Quoted* sq = dynamic_cast <String_Quoted*>(val)) return isPrintable (sq, style);
506
+ if (String_Constant* sc = dynamic_cast <String_Constant*>(val)) return isPrintable (sc, style);
507
+ return true ;
508
+ }
509
+
510
+ bool isPrintable (Expression* e, Output_Style style) {
511
+ return isPrintable (e, style);
512
+ }
513
+
490
514
bool isPrintable (Feature_Block* f, Output_Style style) {
491
515
if (f == NULL ) {
492
516
return false ;
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ namespace Sass {
41
41
bool isPrintable (Feature_Block* r, Output_Style style = NESTED);
42
42
bool isPrintable (Media_Block* r, Output_Style style = NESTED);
43
43
bool isPrintable (Block* b, Output_Style style = NESTED);
44
+ bool isPrintable (String_Constant* s, Output_Style style = NESTED);
45
+ bool isPrintable (String_Quoted* s, Output_Style style = NESTED);
46
+ bool isPrintable (Declaration* d, Output_Style style = NESTED);
47
+ bool isPrintable (Expression* e, Output_Style style = NESTED);
44
48
bool isAscii (const char chr);
45
49
46
50
}
You can’t perform that action at this time.
0 commit comments