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