@@ -1365,7 +1365,14 @@ namespace Sass {
1365
1365
return parse_function_call_schema ();
1366
1366
}
1367
1367
else if (lex< identifier_schema >()) {
1368
- return parse_identifier_schema ();
1368
+ String* string = parse_identifier_schema ();
1369
+ if (String_Schema* schema = dynamic_cast <String_Schema*>(string)) {
1370
+ if (lex < exactly < ' (' > >()) {
1371
+ *schema << parse_list ();
1372
+ lex < exactly < ' )' > >();
1373
+ }
1374
+ }
1375
+ return string;
1369
1376
}
1370
1377
else if (peek< re_functional >()) {
1371
1378
return parse_function_call ();
@@ -1598,13 +1605,14 @@ namespace Sass {
1598
1605
css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
1599
1606
}
1600
1607
1608
+ const char * e = 0 ;
1601
1609
size_t num_items = 0 ;
1602
1610
while (position < stop) {
1603
1611
// parse space between tokens
1604
1612
if (lex< spaces >() && num_items) {
1605
1613
(*schema) << new (ctx.mem ) String_Constant (pstate, " " );
1606
1614
}
1607
- if (peek< re_functional >()) {
1615
+ if ((e = peek< re_functional >()) && e < stop ) {
1608
1616
(*schema) << parse_function_call ();
1609
1617
}
1610
1618
// lex an interpolant /#{...}/
@@ -1621,10 +1629,16 @@ namespace Sass {
1621
1629
// lex some string constants
1622
1630
else if (lex< alternatives < exactly<' %' >, exactly < ' -' >, identifier > >()) {
1623
1631
(*schema) << new (ctx.mem ) String_Constant (pstate, lexed);
1632
+ if (*position == ' "' || *position == ' \' ' ) {
1633
+ (*schema) << new (ctx.mem ) String_Constant (pstate, " " );
1634
+ }
1624
1635
}
1625
1636
// lex a quoted string
1626
1637
else if (lex< quoted_string >()) {
1627
- (*schema) << new (ctx.mem ) String_Quoted (pstate, lexed);
1638
+ (*schema) << new (ctx.mem ) String_Quoted (pstate, lexed, ' "' );
1639
+ if (*position == ' "' || *position == ' \' ' || alpha (position)) {
1640
+ (*schema) << new (ctx.mem ) String_Constant (pstate, " " );
1641
+ }
1628
1642
}
1629
1643
// lex (normalized) variable
1630
1644
else if (lex< variable >()) {
@@ -1680,7 +1694,9 @@ namespace Sass {
1680
1694
if (p) {
1681
1695
if (i < p) {
1682
1696
// accumulate the preceding segment if it's nonempty
1683
- (*schema) << new (ctx.mem ) String_Constant (pstate, std::string (i, p));
1697
+ const char * o = position; position = i;
1698
+ *schema << parse_value_schema (p);
1699
+ position = o;
1684
1700
}
1685
1701
// we need to skip anything inside strings
1686
1702
// create a new target in parser/prelexer
@@ -1702,7 +1718,11 @@ namespace Sass {
1702
1718
}
1703
1719
}
1704
1720
else { // no interpolants left; add the last segment if nonempty
1705
- if (i < end) (*schema) << new (ctx.mem ) String_Constant (pstate, std::string (i, id.end ));
1721
+ if (i < end) {
1722
+ const char * o = position; position = i;
1723
+ *schema << parse_value_schema (id.end );
1724
+ position = o;
1725
+ }
1706
1726
break ;
1707
1727
}
1708
1728
}
0 commit comments