@@ -145,7 +145,9 @@ namespace Sass {
145
145
}
146
146
147
147
// update for end position
148
- block->update_pstate (pstate);
148
+ // this seems to be done somewhere else
149
+ // but that fixed selector schema issue
150
+ // block->update_pstate(pstate);
149
151
150
152
// parse comments after block
151
153
// lex < optional_css_comments >();
@@ -491,6 +493,7 @@ namespace Sass {
491
493
stack.pop_back ();
492
494
// update for end position
493
495
ruleset->update_pstate (pstate);
496
+ ruleset->block ()->update_pstate (pstate);
494
497
// inherit is_root from parent block
495
498
// need this info for sanity checks
496
499
ruleset->is_root (is_root);
@@ -517,30 +520,46 @@ namespace Sass {
517
520
// try to parse mutliple interpolants
518
521
if (const char * p = find_first_in_interval< exactly<hash_lbrace>, block_comment >(i, end_of_selector)) {
519
522
// accumulate the preceding segment if the position has advanced
520
- if (i < p) schema->append (SASS_MEMORY_NEW (String_Constant, pstate, std::string (i, p)));
523
+ if (i < p) {
524
+ std::string parsed (i, p);
525
+ String_Constant_Obj str = SASS_MEMORY_NEW (String_Constant, pstate, parsed);
526
+ pstate += Offset (parsed);
527
+ str->update_pstate (pstate);
528
+ schema->append (&str);
529
+ }
530
+
521
531
// check if the interpolation only contains white-space (error out)
522
532
if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2 )) { position = p+2 ;
523
533
css_error (" Invalid CSS" , " after " , " : expected expression (e.g. 1px, bold), was " );
524
534
}
525
535
// skip over all nested inner interpolations up to our own delimiter
526
536
const char * j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p + 2 , end_of_selector);
527
537
// pass inner expression to the parser to resolve nested interpolations
538
+ pstate.add (p, p+2 );
528
539
Expression_Obj interpolant = Parser::from_c_str (p+2 , j, ctx, pstate).parse_list ();
529
540
// set status on the list expression
530
541
interpolant->is_interpolant (true );
531
542
// schema->has_interpolants(true);
532
543
// add to the string schema
533
544
schema->append (&interpolant);
545
+ // advance parser state
546
+ pstate.add (p+2 , j);
534
547
// advance position
535
548
i = j;
536
549
}
537
550
// no more interpolants have been found
538
551
// add the last segment if there is one
539
552
else {
540
553
// make sure to add the last bits of the string up to the end (if any)
541
- if (i < end_of_selector) schema->append (SASS_MEMORY_NEW (String_Constant, pstate, std::string (i, end_of_selector)));
554
+ if (i < end_of_selector) {
555
+ std::string parsed (i, end_of_selector);
556
+ String_Constant_Obj str = SASS_MEMORY_NEW (String_Constant, pstate, parsed);
557
+ pstate += Offset (parsed);
558
+ str->update_pstate (pstate);
559
+ i = end_of_selector;
560
+ schema->append (&str);
561
+ }
542
562
// exit loop
543
- i = end_of_selector;
544
563
}
545
564
}
546
565
// EO until eos
@@ -550,6 +569,9 @@ namespace Sass {
550
569
551
570
// update for end position
552
571
selector_schema->update_pstate (pstate);
572
+ schema->update_pstate (pstate);
573
+
574
+ after_token = before_token = pstate;
553
575
554
576
// return parsed result
555
577
return selector_schema;
@@ -645,6 +667,7 @@ namespace Sass {
645
667
646
668
String_Ptr reference = 0 ;
647
669
lex < block_comment >();
670
+ advanceToNextToken ();
648
671
Complex_Selector_Obj sel = SASS_MEMORY_NEW (Complex_Selector, pstate);
649
672
650
673
// parse the left hand side
@@ -974,6 +997,7 @@ namespace Sass {
974
997
lex < css_comments >(false );
975
998
Declaration_Obj decl = SASS_MEMORY_NEW (Declaration, prop->pstate (), prop, value/* , lex<kwd_important>()*/ );
976
999
decl->is_indented (is_indented);
1000
+ decl->update_pstate (pstate);
977
1001
return decl;
978
1002
}
979
1003
}
0 commit comments