mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 05:41:14 +01:00
"Separator independent" -> "normalized"
This commit is contained in:
parent
50912350af
commit
860f761c27
@ -18,10 +18,10 @@ class Environment {
|
||||
final Map<String, int> _functionIndices;
|
||||
|
||||
Environment()
|
||||
: _variables = [separatorIndependentMap()],
|
||||
_variableIndices = separatorIndependentMap(),
|
||||
_functions = [separatorIndependentMap()],
|
||||
_functionIndices = separatorIndependentMap();
|
||||
: _variables = [normalizedMap()],
|
||||
_variableIndices = normalizedMap(),
|
||||
_functions = [normalizedMap()],
|
||||
_functionIndices = normalizedMap();
|
||||
|
||||
Environment._(this._variables, this._variableIndices, this._functions,
|
||||
this._functionIndices);
|
||||
|
@ -96,18 +96,18 @@ bool equalsIgnoreCase(String string1, String string2) {
|
||||
return string1.toUpperCase() == string2.toUpperCase();
|
||||
}
|
||||
|
||||
Map/*<V>*/ separatorIndependentMap/*<V>*/() =>
|
||||
Map/*<String, V>*/ normalizedMap/*<V>*/() =>
|
||||
new LinkedHashMap(
|
||||
equals: equalsIgnoreSeparator, hashCode: hashCodeIgnoreSeparator);
|
||||
|
||||
Map/*<String, V2>*/ separatorIndependentMapMap/*<K, V1, V2>*/(
|
||||
Map/*<String, V2>*/ normalizedMapMap/*<K, V1, V2>*/(
|
||||
Map/*<K, V1>*/ map,
|
||||
{String key(/*=K*/ key, /*=V1*/ value),
|
||||
/*=V2*/ value(/*=K*/ key, /*=V1*/ value)}) {
|
||||
key ??= (mapKey, _) => mapKey as String;
|
||||
value ??= (_, mapValue) => mapValue as dynamic/*=V2*/;
|
||||
|
||||
var result = separatorIndependentMap/*<V2>*/();
|
||||
var result = normalizedMap/*<V2>*/();
|
||||
map.forEach((mapKey, mapValue) {
|
||||
result[key(mapKey, mapValue)] = value(mapKey, mapValue);
|
||||
});
|
||||
|
@ -290,7 +290,7 @@ class PerformVisitor extends StatementVisitor
|
||||
return _withEnvironment(callable.environment, () => _environment.scope(() {
|
||||
var positional = arguments.positional
|
||||
.map((expression) => expression.accept(this)).toList();
|
||||
var named = separatorIndependentMapMap/*<String, Expression, Value>*/(
|
||||
var named = normalizedMapMap/*<String, Expression, Value>*/(
|
||||
arguments.named,
|
||||
value: (_, expression) => expression.accept(this));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user