@@ -482,6 +482,9 @@ namespace Sass {
482
482
// accumulate the preceding segment if the position has advanced
483
483
if (i < p) (*schema) << new (ctx.mem ) String_Quoted (pstate, string (i, p));
484
484
// skip to the delimiter by skipping occurences in quoted strings
485
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
486
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
487
+ }
485
488
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p + 2 , end_of_selector);
486
489
Expression* interpolant = Parser::from_c_str (p+2 , j, ctx, pstate).parse_list ();
487
490
interpolant->is_interpolant (true );
@@ -1387,6 +1390,9 @@ namespace Sass {
1387
1390
}
1388
1391
// we need to skip anything inside strings
1389
1392
// create a new target in parser/prelexer
1393
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
1394
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1395
+ }
1390
1396
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p + 2 , chunk.end ); // find the closing brace
1391
1397
if (j) { --j;
1392
1398
// parse the interpolant and accumulate it
@@ -1458,6 +1464,9 @@ namespace Sass {
1458
1464
if (i < p) {
1459
1465
(*schema) << new (ctx.mem ) String_Constant (pstate, string (i, p)); // accumulate the preceding segment if it's nonempty
1460
1466
}
1467
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
1468
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1469
+ }
1461
1470
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p+2 , str.end ); // find the closing brace
1462
1471
if (j) {
1463
1472
// parse the interpolant and accumulate it
@@ -1502,6 +1511,9 @@ namespace Sass {
1502
1511
{
1503
1512
String_Schema* schema = new (ctx.mem ) String_Schema (pstate);
1504
1513
size_t num_items = 0 ;
1514
+ if (peek<exactly<' }' >>()) {
1515
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1516
+ }
1505
1517
while (position < stop) {
1506
1518
if (lex< interpolant >()) {
1507
1519
Token insides (Token (lexed.begin + 2 , lexed.end - 1 ));
@@ -1595,6 +1607,9 @@ namespace Sass {
1595
1607
}
1596
1608
// we need to skip anything inside strings
1597
1609
// create a new target in parser/prelexer
1610
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
1611
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1612
+ }
1598
1613
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p+2 , id.end ); // find the closing brace
1599
1614
if (j) {
1600
1615
// parse the interpolant and accumulate it
@@ -2229,14 +2244,16 @@ namespace Sass {
2229
2244
const char * pos = peek < optional_spaces >();
2230
2245
bool ellipsis_left = false ;
2231
2246
const char * pos_left (pos);
2232
- while (*pos_left && pos_left >= source) {
2247
+ while (*pos_left && pos_left > source) {
2233
2248
if (pos - pos_left > max_len) {
2234
2249
ellipsis_left = true ;
2235
2250
break ;
2236
2251
}
2237
- if (*pos_left == ' \r ' ) break ;
2238
- if (*pos_left == ' \n ' ) break ;
2239
- -- pos_left;
2252
+ const char * prev = pos_left - 1 ;
2253
+ if (*prev == ' \r ' ) break ;
2254
+ if (*prev == ' \n ' ) break ;
2255
+ if (*prev == 10 ) break ;
2256
+ pos_left = prev;
2240
2257
}
2241
2258
bool ellipsis_right = false ;
2242
2259
const char * pos_right (pos);
@@ -2247,6 +2264,7 @@ namespace Sass {
2247
2264
}
2248
2265
if (*pos_right == ' \r ' ) break ;
2249
2266
if (*pos_right == ' \n ' ) break ;
2267
+ if (*pos_left == 10 ) break ;
2250
2268
++ pos_right;
2251
2269
}
2252
2270
string left (pos_left, pos);
0 commit comments