"Separator independent" -> "normalized"

This commit is contained in:
Natalie Weizenbaum 2016-08-26 21:59:28 -07:00 committed by Natalie Weizenbaum
parent 50912350af
commit 860f761c27
3 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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);
});

View File

@ -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));