5
5
// DO NOT EDIT. This file was generated from async_evaluate.dart.
6
6
// See tool/grind/synchronize.dart for details.
7
7
//
8
- // Checksum: 70d926fd13a7d35cd805bf7053f073cc123b260f
8
+ // Checksum: 100082e5b65dc126357c027e76f34ae97b3f9e48
9
9
//
10
10
// ignore_for_file: unused_import
11
11
@@ -1350,46 +1350,6 @@ final class _EvaluateVisitor
1350
1350
);
1351
1351
}
1352
1352
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
-
1393
1353
var name = _interpolationToValue (node.name, warnForColor: true );
1394
1354
if (_declarationName case var declarationName? ) {
1395
1355
name = CssValue ("$declarationName -${name .value }" , name.span);
@@ -1403,14 +1363,14 @@ final class _EvaluateVisitor
1403
1363
_isEmptyList (value) ||
1404
1364
// Custom properties are allowed to have empty values, per spec.
1405
1365
name.value.startsWith ('--' )) {
1366
+ _copyParentAfterSibling ();
1406
1367
_parent.addChild (
1407
1368
ModifiableCssDeclaration (
1408
1369
name,
1409
1370
CssValue (value, expression.span),
1410
1371
node.span,
1411
1372
parsedAsCustomProperty: node.isCustomProperty,
1412
- interleavedRules: interleavedRules,
1413
- trace: interleavedRules.isEmpty ? null : _stackTrace (node.span),
1373
+ trace: _stackTrace (node.span),
1414
1374
valueSpanForMap:
1415
1375
_sourceMap ? node.value.andThen (_expressionNode)? .span : null ,
1416
1376
),
@@ -1573,6 +1533,7 @@ final class _EvaluateVisitor
1573
1533
1574
1534
var children = node.children;
1575
1535
if (children == null ) {
1536
+ _copyParentAfterSibling ();
1576
1537
_parent.addChild (
1577
1538
ModifiableCssAtRule (name, node.span, childless: true , value: value),
1578
1539
);
@@ -2089,6 +2050,7 @@ final class _EvaluateVisitor
2089
2050
);
2090
2051
2091
2052
if (_parent != _root) {
2053
+ _copyParentAfterSibling ();
2092
2054
_parent.addChild (node);
2093
2055
} else if (_endOfImports == _root.children.length) {
2094
2056
_root.addChild (node);
@@ -2238,6 +2200,8 @@ final class _EvaluateVisitor
2238
2200
var text = _performInterpolation (node.text);
2239
2201
// Indented syntax doesn't require */
2240
2202
if (! text.endsWith ("*/" )) text += " */" ;
2203
+
2204
+ _copyParentAfterSibling ();
2241
2205
_parent.addChild (ModifiableCssComment (text, node.span));
2242
2206
return null ;
2243
2207
}
@@ -3921,6 +3885,7 @@ final class _EvaluateVisitor
3921
3885
}
3922
3886
3923
3887
if (node.isChildless) {
3888
+ _copyParentAfterSibling ();
3924
3889
_parent.addChild (
3925
3890
ModifiableCssAtRule (
3926
3891
node.name,
@@ -3967,10 +3932,12 @@ final class _EvaluateVisitor
3967
3932
_endOfImports++ ;
3968
3933
}
3969
3934
3935
+ _copyParentAfterSibling ();
3970
3936
_parent.addChild (ModifiableCssComment (node.text, node.span));
3971
3937
}
3972
3938
3973
3939
void visitCssDeclaration (CssDeclaration node) {
3940
+ _copyParentAfterSibling ();
3974
3941
_parent.addChild (
3975
3942
ModifiableCssDeclaration (
3976
3943
node.name,
@@ -3992,6 +3959,7 @@ final class _EvaluateVisitor
3992
3959
modifiers: node.modifiers,
3993
3960
);
3994
3961
if (_parent != _root) {
3962
+ _copyParentAfterSibling ();
3995
3963
_parent.addChild (modifiableNode);
3996
3964
} else if (_endOfImports == _root.children.length) {
3997
3965
_root.addChild (modifiableNode);
@@ -4378,6 +4346,19 @@ final class _EvaluateVisitor
4378
4346
return result;
4379
4347
}
4380
4348
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
+
4381
4362
/// Adds [node] as a child of the current parent.
4382
4363
///
4383
4364
/// If [through] is passed, [node] is added as a child of the first parent for
0 commit comments