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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 void endLiteralSymbol(Token hashToken, int identifierCount) { | 432 void endLiteralSymbol(Token hashToken, int identifierCount) { |
433 debugEvent("LiteralSymbol"); | 433 debugEvent("LiteralSymbol"); |
434 List<analyzer.Token> components = new List<analyzer.Token>(identifierCount); | 434 List<analyzer.Token> components = new List<analyzer.Token>(identifierCount); |
435 for (int i = identifierCount - 1; i >= 0; i--) { | 435 for (int i = identifierCount - 1; i >= 0; i--) { |
436 SimpleIdentifier identifier = pop(); | 436 SimpleIdentifier identifier = pop(); |
437 components[i] = identifier.token; | 437 components[i] = identifier.token; |
438 } | 438 } |
439 push(ast.symbolLiteral(toAnalyzerToken(hashToken), components)); | 439 push(ast.symbolLiteral(toAnalyzerToken(hashToken), components)); |
440 } | 440 } |
441 | 441 |
442 void endType(Token beginToken, Token endToken) { | 442 void handleType(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 | 452 // TODO(paulberry,ahe): what if the type doesn't resolve to a class |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 debugEvent("Modifier"); | 588 debugEvent("Modifier"); |
589 // TODO(ahe): Don't ignore modifiers. | 589 // TODO(ahe): Don't ignore modifiers. |
590 } | 590 } |
591 | 591 |
592 void handleModifiers(int count) { | 592 void handleModifiers(int count) { |
593 debugEvent("Modifiers"); | 593 debugEvent("Modifiers"); |
594 // TODO(ahe): Don't ignore modifiers. | 594 // TODO(ahe): Don't ignore modifiers. |
595 push(NullValue.Modifiers); | 595 push(NullValue.Modifiers); |
596 } | 596 } |
597 } | 597 } |
OLD | NEW |