@@ -503,6 +503,7 @@ namespace Sass {
503
503
// a ruleset connects a selector and a block
504
504
Ruleset_Obj Parser::parse_ruleset (Lookahead lookahead)
505
505
{
506
+ NESTING_GUARD (nestings);
506
507
// inherit is_root from parent block
507
508
Block_Obj parent = block_stack.back ();
508
509
bool is_root = parent && parent->is_root ();
@@ -535,6 +536,7 @@ namespace Sass {
535
536
// in the eval stage we will be re-parse it into an actual selector
536
537
Selector_Schema_Obj Parser::parse_selector_schema (const char * end_of_selector, bool chroot)
537
538
{
539
+ NESTING_GUARD (nestings);
538
540
// move up to the start
539
541
lex< optional_spaces >();
540
542
const char * i = position;
@@ -646,6 +648,7 @@ namespace Sass {
646
648
{
647
649
bool reloop;
648
650
bool had_linefeed = false ;
651
+ NESTING_GUARD (nestings);
649
652
Complex_Selector_Obj sel;
650
653
Selector_List_Obj group = SASS_MEMORY_NEW (Selector_List, pstate);
651
654
group->media_block (last_media_block);
@@ -700,6 +703,7 @@ namespace Sass {
700
703
Complex_Selector_Obj Parser::parse_complex_selector (bool chroot)
701
704
{
702
705
706
+ NESTING_GUARD (nestings);
703
707
String_Obj reference = 0 ;
704
708
lex < block_comment >();
705
709
advanceToNextToken ();
@@ -1055,6 +1059,7 @@ namespace Sass {
1055
1059
1056
1060
Expression_Obj Parser::parse_map ()
1057
1061
{
1062
+ NESTING_GUARD (nestings);
1058
1063
Expression_Obj key = parse_list ();
1059
1064
List_Obj map = SASS_MEMORY_NEW (List, pstate, 0 , SASS_HASH);
1060
1065
@@ -1098,6 +1103,7 @@ namespace Sass {
1098
1103
1099
1104
Expression_Obj Parser::parse_bracket_list ()
1100
1105
{
1106
+ NESTING_GUARD (nestings);
1101
1107
// check if we have an empty list
1102
1108
// return the empty list as such
1103
1109
if (peek_css< list_terminator >(position))
@@ -1144,12 +1150,14 @@ namespace Sass {
1144
1150
// so to speak: we unwrap items from lists if possible here!
1145
1151
Expression_Obj Parser::parse_list (bool delayed)
1146
1152
{
1153
+ NESTING_GUARD (nestings);
1147
1154
return parse_comma_list (delayed);
1148
1155
}
1149
1156
1150
1157
// will return singletons unwrapped
1151
1158
Expression_Obj Parser::parse_comma_list (bool delayed)
1152
1159
{
1160
+ NESTING_GUARD (nestings);
1153
1161
// check if we have an empty list
1154
1162
// return the empty list as such
1155
1163
if (peek_css< list_terminator >(position))
@@ -1189,6 +1197,7 @@ namespace Sass {
1189
1197
// will return singletons unwrapped
1190
1198
Expression_Obj Parser::parse_space_list ()
1191
1199
{
1200
+ NESTING_GUARD (nestings);
1192
1201
Expression_Obj disj1 = parse_disjunction ();
1193
1202
// if it's a singleton, return it (don't wrap it)
1194
1203
if (peek_css< space_list_terminator >(position)
@@ -1213,6 +1222,7 @@ namespace Sass {
1213
1222
// parse logical OR operation
1214
1223
Expression_Obj Parser::parse_disjunction ()
1215
1224
{
1225
+ NESTING_GUARD (nestings);
1216
1226
advanceToNextToken ();
1217
1227
ParserState state (pstate);
1218
1228
// parse the left hand side conjunction
@@ -1234,6 +1244,7 @@ namespace Sass {
1234
1244
// parse logical AND operation
1235
1245
Expression_Obj Parser::parse_conjunction ()
1236
1246
{
1247
+ NESTING_GUARD (nestings);
1237
1248
advanceToNextToken ();
1238
1249
ParserState state (pstate);
1239
1250
// parse the left hand side relation
@@ -1256,6 +1267,7 @@ namespace Sass {
1256
1267
// parse comparison operations
1257
1268
Expression_Obj Parser::parse_relation ()
1258
1269
{
1270
+ NESTING_GUARD (nestings);
1259
1271
advanceToNextToken ();
1260
1272
ParserState state (pstate);
1261
1273
// parse the left hand side expression
@@ -1308,6 +1320,7 @@ namespace Sass {
1308
1320
// parse addition and subtraction operations
1309
1321
Expression_Obj Parser::parse_expression ()
1310
1322
{
1323
+ NESTING_GUARD (nestings);
1311
1324
advanceToNextToken ();
1312
1325
ParserState state (pstate);
1313
1326
// parses multiple add and subtract operations
@@ -1351,6 +1364,7 @@ namespace Sass {
1351
1364
// parse addition and subtraction operations
1352
1365
Expression_Obj Parser::parse_operators ()
1353
1366
{
1367
+ NESTING_GUARD (nestings);
1354
1368
advanceToNextToken ();
1355
1369
ParserState state (pstate);
1356
1370
Expression_Obj factor = parse_factor ();
@@ -1383,6 +1397,7 @@ namespace Sass {
1383
1397
// called from parse_value_schema
1384
1398
Expression_Obj Parser::parse_factor ()
1385
1399
{
1400
+ NESTING_GUARD (nestings);
1386
1401
lex < css_comments >(false );
1387
1402
if (lex_css< exactly<' (' > >()) {
1388
1403
// parse_map may return a list
0 commit comments