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