@@ -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 );
@@ -1399,6 +1402,9 @@ namespace Sass {
1399
1402
}
1400
1403
// we need to skip anything inside strings
1401
1404
// create a new target in parser/prelexer
1405
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
1406
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1407
+ }
1402
1408
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p + 2 , chunk.end ); // find the closing brace
1403
1409
if (j) { --j;
1404
1410
// parse the interpolant and accumulate it
@@ -1470,6 +1476,9 @@ namespace Sass {
1470
1476
if (i < p) {
1471
1477
(*schema) << new (ctx.mem ) String_Constant (pstate, string (i, p)); // accumulate the preceding segment if it's nonempty
1472
1478
}
1479
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
1480
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1481
+ }
1473
1482
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p+2 , str.end ); // find the closing brace
1474
1483
if (j) {
1475
1484
// parse the interpolant and accumulate it
@@ -1514,6 +1523,9 @@ namespace Sass {
1514
1523
{
1515
1524
String_Schema* schema = new (ctx.mem ) String_Schema (pstate);
1516
1525
size_t num_items = 0 ;
1526
+ if (peek<exactly<' }' >>()) {
1527
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1528
+ }
1517
1529
while (position < stop) {
1518
1530
if (lex< spaces >() && num_items) {
1519
1531
(*schema) << new (ctx.mem ) String_Constant (pstate, " " );
@@ -1610,6 +1622,9 @@ namespace Sass {
1610
1622
}
1611
1623
// we need to skip anything inside strings
1612
1624
// create a new target in parser/prelexer
1625
+ if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
1626
+ css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1627
+ }
1613
1628
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p+2 , id.end ); // find the closing brace
1614
1629
if (j) {
1615
1630
// parse the interpolant and accumulate it
@@ -2295,14 +2310,16 @@ namespace Sass {
2295
2310
const char * pos = peek < optional_spaces >();
2296
2311
bool ellipsis_left = false ;
2297
2312
const char * pos_left (pos);
2298
- while (*pos_left && pos_left >= source) {
2313
+ while (*pos_left && pos_left > source) {
2299
2314
if (pos - pos_left > max_len) {
2300
2315
ellipsis_left = true ;
2301
2316
break ;
2302
2317
}
2303
- if (*pos_left == ' \r ' ) break ;
2304
- if (*pos_left == ' \n ' ) break ;
2305
- -- pos_left;
2318
+ const char * prev = pos_left - 1 ;
2319
+ if (*prev == ' \r ' ) break ;
2320
+ if (*prev == ' \n ' ) break ;
2321
+ if (*prev == 10 ) break ;
2322
+ pos_left = prev;
2306
2323
}
2307
2324
bool ellipsis_right = false ;
2308
2325
const char * pos_right (pos);
@@ -2313,6 +2330,7 @@ namespace Sass {
2313
2330
}
2314
2331
if (*pos_right == ' \r ' ) break ;
2315
2332
if (*pos_right == ' \n ' ) break ;
2333
+ if (*pos_left == 10 ) break ;
2316
2334
++ pos_right;
2317
2335
}
2318
2336
string left (pos_left, pos);
0 commit comments