22// MIT-style license that can be found in the LICENSE file or at
33// https://opensource.org/licenses/MIT.
44
5+ import 'package:sass/src/utils.dart' ;
56import 'package:source_span/source_span.dart' ;
67
78import '../../value/list.dart' ;
@@ -20,6 +21,11 @@ final class ArgumentList implements SassNode {
2021 /// The arguments passed by name.
2122 final Map <String , Expression > named;
2223
24+ /// The spans for the arguments passed by name, including their argument names.
25+ ///
26+ /// This always has the same keys as [named] in the same order.
27+ final Map <String , FileSpan > namedSpans;
28+
2329 /// The first rest argument (as in `$args...` ).
2430 final Expression ? rest;
2531
@@ -34,18 +40,22 @@ final class ArgumentList implements SassNode {
3440 ArgumentList (
3541 Iterable <Expression > positional,
3642 Map <String , Expression > named,
43+ Map <String , FileSpan > namedSpans,
3744 this .span, {
3845 this .rest,
3946 this .keywordRest,
4047 }) : positional = List .unmodifiable (positional),
41- named = Map .unmodifiable (named) {
48+ named = Map .unmodifiable (named),
49+ namedSpans = Map .unmodifiable (namedSpans) {
4250 assert (rest != null || keywordRest == null );
51+ assert (iterableEquals (named.keys, namedSpans.keys));
4352 }
4453
4554 /// Creates an invocation that passes no arguments.
4655 ArgumentList .empty (this .span)
4756 : positional = const [],
4857 named = const {},
58+ namedSpans = const {},
4959 rest = null ,
5060 keywordRest = null ;
5161
0 commit comments