Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 } | 8 } |
| 9 | 9 |
| 10 class TreeElementMapping implements TreeElements { | 10 class TreeElementMapping implements TreeElements { |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 568 target = prefix.library.lookupLocalMember(name); | 568 target = prefix.library.lookupLocalMember(name); |
| 569 if (target == null) { | 569 if (target == null) { |
| 570 error(node, MessageKind.NO_SUCH_LIBRARY_MEMBER, | 570 error(node, MessageKind.NO_SUCH_LIBRARY_MEMBER, |
| 571 [resolvedReceiver.name, name]); | 571 [resolvedReceiver.name, name]); |
| 572 } | 572 } |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 return target; | 575 return target; |
| 576 } | 576 } |
| 577 | 577 |
| 578 resolveTypeTest(TypeAnnotation node) { | 578 resolveTypeTest(Node argument) { |
| 579 TypeAnnotation node = argument.asTypeAnnotation(); | |
|
ahe
2012/02/13 09:59:57
I'd be more comfortable with a visitor.
| |
| 580 if (node == null) { | |
| 581 node = argument.asSend().receiver; | |
|
ahe
2012/02/13 09:59:57
This could cause a null pointer exception.
| |
| 582 } | |
| 579 resolveTypeRequired(node); | 583 resolveTypeRequired(node); |
| 580 } | 584 } |
| 581 | 585 |
| 582 void handleArguments(Send node) { | 586 void handleArguments(Send node) { |
| 583 int count = 0; | 587 int count = 0; |
| 584 List<SourceString> namedArguments = <SourceString>[]; | 588 List<SourceString> namedArguments = <SourceString>[]; |
| 585 for (Link<Node> link = node.argumentsNode.nodes; | 589 for (Link<Node> link = node.argumentsNode.nodes; |
| 586 !link.isEmpty(); | 590 !link.isEmpty(); |
| 587 link = link.tail) { | 591 link = link.tail) { |
| 588 count++; | 592 count++; |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1149 class TopScope extends Scope { | 1153 class TopScope extends Scope { |
| 1150 LibraryElement get library() => element; | 1154 LibraryElement get library() => element; |
| 1151 | 1155 |
| 1152 TopScope(LibraryElement library) : super(null, library); | 1156 TopScope(LibraryElement library) : super(null, library); |
| 1153 Element lookup(SourceString name) => library.find(name); | 1157 Element lookup(SourceString name) => library.find(name); |
| 1154 | 1158 |
| 1155 Element add(Element element) { | 1159 Element add(Element element) { |
| 1156 throw "Cannot add an element in the top scope"; | 1160 throw "Cannot add an element in the top scope"; |
| 1157 } | 1161 } |
| 1158 } | 1162 } |
| OLD | NEW |