Skip to content

Commit 5c13221

Browse files
committed
Fixes #5 - Implements semicolon to be optional
Avoids adding multiple semicolons to scss result
1 parent ad1e72e commit 5c13221

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sass2scss.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ namespace Sass
385385
// looks like there were no inner properties
386386
if (converter.selector) scss += " {}";
387387
// add final semicolon
388-
else scss += ";";
388+
else if (!converter.semicolon) scss += ";";
389389
}
390390
}
391391

@@ -580,6 +580,7 @@ namespace Sass
580580

581581
// check if next line should be concatenated (list mode)
582582
converter.comma = IS_PARSING(converter) && close == ",";
583+
converter.semicolon = IS_PARSING(converter) && close == ";";
583584

584585
// check if we have more than
585586
// one meaningfull char
@@ -620,6 +621,8 @@ namespace Sass
620621
// initialise all options
621622
converter.comma = false;
622623
converter.property = false;
624+
converter.selector = false;
625+
converter.semicolon = false;
623626
converter.end_of_file = false;
624627
converter.comment = "";
625628
converter.whitespace = "";

sass2scss.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace Sass
3838
bool comma;
3939
// has property
4040
bool property;
41+
// has semicolon
42+
bool semicolon;
4143
// comment context
4244
string comment;
4345
// flag end of file

0 commit comments

Comments
 (0)