Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library fasta.analyzer.ast_builder; | 5 library fasta.analyzer.ast_builder; |
| 6 | 6 |
| 7 import 'package:front_end/src/fasta/scanner/token.dart' show | 7 import 'package:front_end/src/fasta/scanner/token.dart' show |
| 8 BeginGroupToken, | 8 BeginGroupToken, |
| 9 Token; | 9 Token; |
| 10 | 10 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 void endType(Token beginToken, Token endToken) { | 442 void endType(Token beginToken, Token endToken) { |
| 443 debugEvent("Type"); | 443 debugEvent("Type"); |
| 444 TypeArgumentList arguments = pop(); | 444 TypeArgumentList arguments = pop(); |
| 445 SimpleIdentifier name = pop(); | 445 SimpleIdentifier name = pop(); |
| 446 KernelClassElement cls = name.staticElement; | 446 KernelClassElement cls = name.staticElement; |
| 447 if (cls == null) { | 447 if (cls == null) { |
| 448 Builder builder = scope.lookup(name.name); | 448 Builder builder = scope.lookup(name.name); |
| 449 if (builder == null) { | 449 if (builder == null) { |
| 450 internalError("Undefined name: $name"); | 450 internalError("Undefined name: $name"); |
| 451 } | 451 } |
| 452 // TODO(paulberry,ahe): what if the type doesn't resolve to a class | |
| 453 // element? | |
|
ahe
2017/02/07 09:47:16
FYI: I have a more complete implementation of this
Paul Berry
2017/02/07 13:45:13
Cool, glad to hear it.
| |
| 452 cls = elementStore[builder]; | 454 cls = elementStore[builder]; |
| 453 assert(cls != null); | 455 assert(cls != null); |
| 454 name.staticElement = cls; | 456 name.staticElement = cls; |
| 455 } | 457 } |
| 456 push(ast.typeName(name, arguments)..type = cls.rawType); | 458 push(ast.typeName(name, arguments)..type = cls.rawType); |
| 457 } | 459 } |
| 458 | 460 |
| 459 void handleAsOperator(Token operator, Token endToken) { | 461 void handleAsOperator(Token operator, Token endToken) { |
| 460 debugEvent("AsOperator"); | 462 debugEvent("AsOperator"); |
| 461 TypeName type = pop(); | 463 TypeName type = pop(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 586 debugEvent("Modifier"); | 588 debugEvent("Modifier"); |
| 587 // TODO(ahe): Don't ignore modifiers. | 589 // TODO(ahe): Don't ignore modifiers. |
| 588 } | 590 } |
| 589 | 591 |
| 590 void handleModifiers(int count) { | 592 void handleModifiers(int count) { |
| 591 debugEvent("Modifiers"); | 593 debugEvent("Modifiers"); |
| 592 // TODO(ahe): Don't ignore modifiers. | 594 // TODO(ahe): Don't ignore modifiers. |
| 593 push(NullValue.Modifiers); | 595 push(NullValue.Modifiers); |
| 594 } | 596 } |
| 595 } | 597 } |
| OLD | NEW |