From 860f761c278e1427bfa00755170b220da34d18a2 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 26 Aug 2016 21:59:28 -0700 Subject: [PATCH] "Separator independent" -> "normalized" --- lib/src/environment.dart | 8 ++++---- lib/src/utils.dart | 6 +++--- lib/src/visitor/perform.dart | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/environment.dart b/lib/src/environment.dart index 5cfaeaa4..d9884251 100644 --- a/lib/src/environment.dart +++ b/lib/src/environment.dart @@ -18,10 +18,10 @@ class Environment { final Map _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); diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 2102ff91..aa34ffa3 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -96,18 +96,18 @@ bool equalsIgnoreCase(String string1, String string2) { return string1.toUpperCase() == string2.toUpperCase(); } -Map/**/ separatorIndependentMap/**/() => +Map/**/ normalizedMap/**/() => new LinkedHashMap( equals: equalsIgnoreSeparator, hashCode: hashCodeIgnoreSeparator); -Map/**/ separatorIndependentMapMap/**/( +Map/**/ normalizedMapMap/**/( Map/**/ 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/**/(); + var result = normalizedMap/**/(); map.forEach((mapKey, mapValue) { result[key(mapKey, mapValue)] = value(mapKey, mapValue); }); diff --git a/lib/src/visitor/perform.dart b/lib/src/visitor/perform.dart index 4bc1e0ad..ea58c5d2 100644 --- a/lib/src/visitor/perform.dart +++ b/lib/src/visitor/perform.dart @@ -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/**/( + var named = normalizedMapMap/**/( arguments.named, value: (_, expression) => expression.accept(this));