@@ -770,10 +770,15 @@ abstract class StylesheetParser extends Parser {
770770 scanner.spanFrom (start));
771771 }
772772
773+ var beforeWhitespace = scanner.location;
773774 whitespace ();
774- var arguments = scanner.peekChar () == $lparen
775- ? _argumentInvocation (mixin : true )
776- : ArgumentInvocation .empty (scanner.emptySpan);
775+ ArgumentInvocation arguments;
776+ if (scanner.peekChar () == $lparen) {
777+ arguments = _argumentInvocation (mixin : true );
778+ whitespace ();
779+ } else {
780+ arguments = ArgumentInvocation .empty (beforeWhitespace.pointSpan ());
781+ }
777782
778783 expectStatementSeparator ("@content rule" );
779784 return ContentRule (arguments, scanner.spanFrom (start));
@@ -835,7 +840,10 @@ abstract class StylesheetParser extends Parser {
835840
836841 var value = almostAnyValue ();
837842 var optional = scanner.scanChar ($exclamation);
838- if (optional) expectIdentifier ("optional" );
843+ if (optional) {
844+ expectIdentifier ("optional" );
845+ whitespace ();
846+ }
839847 expectStatementSeparator ("@extend rule" );
840848 return ExtendRule (value, scanner.spanFrom (start), optional: optional);
841849 }
@@ -954,6 +962,7 @@ abstract class StylesheetParser extends Parser {
954962 }
955963
956964 var configuration = _configuration (allowGuarded: true );
965+ whitespace ();
957966
958967 expectStatementSeparator ("@forward rule" );
959968 var span = scanner.spanFrom (start);
@@ -1419,8 +1428,7 @@ abstract class StylesheetParser extends Parser {
14191428 var namespace = _useNamespace (url, start);
14201429 whitespace ();
14211430 var configuration = _configuration ();
1422-
1423- expectStatementSeparator ("@use rule" );
1431+ whitespace ();
14241432
14251433 var span = scanner.spanFrom (start);
14261434 if (! _isUseAllowed) {
0 commit comments