Chromium Code Reviews| Index: frog/leg/universe.dart |
| =================================================================== |
| --- frog/leg/universe.dart (revision 3778) |
| +++ 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,31 @@ |
| && namedArguments.length == other.namedArguments.length |
| && sameNames(namedArguments, other.namedArguments); |
| } |
| + |
| + void set orderedNamedArguments(List<SourceString> other) { |
| + assert(other.length == 0); |
|
kasperl
2012/02/01 10:21:21
Add a comment that explains that it's okay to igno
ngeoffray
2012/02/01 11:44:15
Done.
|
| + } |
| + |
| + 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), |
|
kasperl
2012/02/01 10:21:21
4 space indent?
ngeoffray
2012/02/01 11:44:15
Done.
|
| + orderedNamedArguments = const <SourceString>[]; |
| + |
| + String toString() { |
| + StringBuffer buffer = new StringBuffer(); |
| + buffer.add(argumentCount); |
| + for (SourceString name in orderedNamedArguments) { |
| + buffer.add('\$$name'); |
| + } |
| + return buffer.toString(); |
|
kasperl
2012/02/01 10:21:21
I might be inclined to remove the buffer.add(argum
ngeoffray
2012/02/01 11:44:15
Done.
|
| + } |
| } |