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:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; | 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; |
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; | 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; |
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; | 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; |
(...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 handleType(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 Identifier name = pop(); | 445 Identifier name = pop(); |
446 // TODO(paulberry,ahe): what if the type doesn't resolve to a class | 446 // TODO(paulberry,ahe): what if the type doesn't resolve to a class |
447 // element? | 447 // element? |
448 KernelClassElement cls = name.staticElement; | 448 KernelClassElement cls = name.staticElement; |
449 if (cls == null) { | 449 if (cls == null) { |
450 // TODO(paulberry): This is a kludge. Ideally we should already have | 450 // TODO(paulberry): This is a kludge. Ideally we should already have |
451 // set the static element at the time that handleIdentifier was called. | 451 // set the static element at the time that handleIdentifier was called. |
452 Builder builder = scope.lookup(name.name, beginToken.charOffset, uri); | 452 Builder builder = scope.lookup(name.name, beginToken.charOffset, uri); |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 /// [ClassDeclaration] or [ClassTypeAlias] object. | 1163 /// [ClassDeclaration] or [ClassTypeAlias] object. |
1164 class _MixinApplication { | 1164 class _MixinApplication { |
1165 final TypeName supertype; | 1165 final TypeName supertype; |
1166 | 1166 |
1167 final Token withKeyword; | 1167 final Token withKeyword; |
1168 | 1168 |
1169 final List<TypeName> mixinTypes; | 1169 final List<TypeName> mixinTypes; |
1170 | 1170 |
1171 _MixinApplication(this.supertype, this.withKeyword, this.mixinTypes); | 1171 _MixinApplication(this.supertype, this.withKeyword, this.mixinTypes); |
1172 } | 1172 } |
OLD | NEW |