| Index: frog/leg/universe.dart
|
| ===================================================================
|
| --- frog/leg/universe.dart (revision 3781)
|
| +++ frog/leg/universe.dart (working copy)
|
| @@ -79,7 +79,8 @@
|
| const Selector(SelectorKind.INDEX, 2);
|
| static final Selector GETTER_AND_SETTER =
|
| const Selector(SelectorKind.SETTER, 1);
|
| - static final Selector INVOCATION_0 = const Invocation(0);
|
| + static final Selector INVOCATION_0 =
|
| + const Selector(SelectorKind.INVOCATION, 0);
|
|
|
| bool applies(Compiler compiler, FunctionElement element) {
|
| FunctionParameters parameters = element.computeParameters(compiler);
|
| @@ -132,15 +133,32 @@
|
| && namedArguments.length == other.namedArguments.length
|
| && sameNames(namedArguments, other.namedArguments);
|
| }
|
| +
|
| + void set orderedNamedArguments(List<SourceString> other) {
|
| + // It's ok to ignore [other] if it's empty because this type of
|
| + // selector should not have any named arguments.
|
| + assert(other.isEmpty());
|
| + }
|
| +
|
| + String toString() => '$argumentCount';
|
| }
|
|
|
| class Invocation extends Selector {
|
| final List<SourceString> namedArguments;
|
| + List<SourceString> orderedNamedArguments;
|
| int get namedArgumentCount() => namedArguments.length;
|
| int get positionalArgumentCount() => argumentCount - namedArgumentCount;
|
|
|
| - const Invocation(
|
| - int argumentCount,
|
| - [List<SourceString> this.namedArguments = const <SourceString>[]])
|
| - : super(SelectorKind.INVOCATION, argumentCount);
|
| + Invocation(int argumentCount,
|
| + [List<SourceString> this.namedArguments = const <SourceString>[]])
|
| + : super(SelectorKind.INVOCATION, argumentCount),
|
| + orderedNamedArguments = const <SourceString>[];
|
| +
|
| + String toString() {
|
| + StringBuffer buffer = new StringBuffer();
|
| + for (SourceString name in orderedNamedArguments) {
|
| + buffer.add('\$$name');
|
| + }
|
| + return '$argumentCount$buffer';
|
| + }
|
| }
|
|
|