55// DO NOT EDIT. This file was generated from async_evaluate.dart.
66// See tool/grind/synchronize.dart for details.
77//
8- // Checksum: 70d926fd13a7d35cd805bf7053f073cc123b260f
8+ // Checksum: 100082e5b65dc126357c027e76f34ae97b3f9e48
99//
1010// ignore_for_file: unused_import
1111
@@ -1350,46 +1350,6 @@ final class _EvaluateVisitor
13501350 );
13511351 }
13521352
1353- var siblings = _parent.parent! .children;
1354- var interleavedRules = < CssStyleRule > [];
1355- if (siblings.last != _parent &&
1356- // Reproduce this condition from [_warn] so that we don't add anything to
1357- // [interleavedRules] for declarations in dependencies.
1358- ! (_quietDeps && _inDependency)) {
1359- loop:
1360- for (var sibling in siblings.skip (siblings.indexOf (_parent) + 1 )) {
1361- switch (sibling) {
1362- case CssComment ():
1363- continue loop;
1364-
1365- case CssStyleRule rule:
1366- interleavedRules.add (rule);
1367-
1368- case _:
1369- // Always warn for siblings that aren't style rules, because they
1370- // add no specificity and they're nested in the same parent as this
1371- // declaration.
1372- _warn (
1373- "Sass's behavior for declarations that appear after nested\n "
1374- "rules will be changing to match the behavior specified by CSS "
1375- "in an upcoming\n "
1376- "version. To keep the existing behavior, move the declaration "
1377- "above the nested\n "
1378- "rule. To opt into the new behavior, wrap the declaration in "
1379- "`& {}`.\n "
1380- "\n "
1381- "More info: https://sass-lang.com/d/mixed-decls" ,
1382- MultiSpan (node.span, 'declaration' , {
1383- sibling.span: 'nested rule' ,
1384- }),
1385- Deprecation .mixedDecls,
1386- );
1387- interleavedRules.clear ();
1388- break ;
1389- }
1390- }
1391- }
1392-
13931353 var name = _interpolationToValue (node.name, warnForColor: true );
13941354 if (_declarationName case var declarationName? ) {
13951355 name = CssValue ("$declarationName -${name .value }" , name.span);
@@ -1403,14 +1363,14 @@ final class _EvaluateVisitor
14031363 _isEmptyList (value) ||
14041364 // Custom properties are allowed to have empty values, per spec.
14051365 name.value.startsWith ('--' )) {
1366+ _copyParentAfterSibling ();
14061367 _parent.addChild (
14071368 ModifiableCssDeclaration (
14081369 name,
14091370 CssValue (value, expression.span),
14101371 node.span,
14111372 parsedAsCustomProperty: node.isCustomProperty,
1412- interleavedRules: interleavedRules,
1413- trace: interleavedRules.isEmpty ? null : _stackTrace (node.span),
1373+ trace: _stackTrace (node.span),
14141374 valueSpanForMap:
14151375 _sourceMap ? node.value.andThen (_expressionNode)? .span : null ,
14161376 ),
@@ -1573,6 +1533,7 @@ final class _EvaluateVisitor
15731533
15741534 var children = node.children;
15751535 if (children == null ) {
1536+ _copyParentAfterSibling ();
15761537 _parent.addChild (
15771538 ModifiableCssAtRule (name, node.span, childless: true , value: value),
15781539 );
@@ -2089,6 +2050,7 @@ final class _EvaluateVisitor
20892050 );
20902051
20912052 if (_parent != _root) {
2053+ _copyParentAfterSibling ();
20922054 _parent.addChild (node);
20932055 } else if (_endOfImports == _root.children.length) {
20942056 _root.addChild (node);
@@ -2238,6 +2200,8 @@ final class _EvaluateVisitor
22382200 var text = _performInterpolation (node.text);
22392201 // Indented syntax doesn't require */
22402202 if (! text.endsWith ("*/" )) text += " */" ;
2203+
2204+ _copyParentAfterSibling ();
22412205 _parent.addChild (ModifiableCssComment (text, node.span));
22422206 return null ;
22432207 }
@@ -3921,6 +3885,7 @@ final class _EvaluateVisitor
39213885 }
39223886
39233887 if (node.isChildless) {
3888+ _copyParentAfterSibling ();
39243889 _parent.addChild (
39253890 ModifiableCssAtRule (
39263891 node.name,
@@ -3967,10 +3932,12 @@ final class _EvaluateVisitor
39673932 _endOfImports++ ;
39683933 }
39693934
3935+ _copyParentAfterSibling ();
39703936 _parent.addChild (ModifiableCssComment (node.text, node.span));
39713937 }
39723938
39733939 void visitCssDeclaration (CssDeclaration node) {
3940+ _copyParentAfterSibling ();
39743941 _parent.addChild (
39753942 ModifiableCssDeclaration (
39763943 node.name,
@@ -3992,6 +3959,7 @@ final class _EvaluateVisitor
39923959 modifiers: node.modifiers,
39933960 );
39943961 if (_parent != _root) {
3962+ _copyParentAfterSibling ();
39953963 _parent.addChild (modifiableNode);
39963964 } else if (_endOfImports == _root.children.length) {
39973965 _root.addChild (modifiableNode);
@@ -4378,6 +4346,19 @@ final class _EvaluateVisitor
43784346 return result;
43794347 }
43804348
4349+ /// If the current [_parent] is not the last child of its grandparent, makes a
4350+ /// new childless copy of it and sets [_parent] to that.
4351+ ///
4352+ /// Otherwise, leaves [_parent] as-is.
4353+ void _copyParentAfterSibling () {
4354+ if (_parent.parent case var grandparent?
4355+ when grandparent.children.last != _parent) {
4356+ var newParent = _parent.copyWithoutChildren ();
4357+ grandparent.addChild (newParent);
4358+ _parent = newParent;
4359+ }
4360+ }
4361+
43814362 /// Adds [node] as a child of the current parent.
43824363 ///
43834364 /// If [through] is passed, [node] is added as a child of the first parent for
0 commit comments