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' | 7 import 'package:front_end/src/fasta/scanner/token.dart' |
| 8 show BeginGroupToken, Token; | 8 show BeginGroupToken, Token; |
| 9 | 9 |
| 10 import 'package:analyzer/analyzer.dart'; | 10 import 'package:analyzer/analyzer.dart'; |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 835 List<TypeName> mixinTypes = pop(); | 835 List<TypeName> mixinTypes = pop(); |
| 836 // TODO(paulberry,ahe): the parser doesn't give us enough information to | 836 // TODO(paulberry,ahe): the parser doesn't give us enough information to |
| 837 // locate the "with" keyword. | 837 // locate the "with" keyword. |
| 838 Token withKeyword; | 838 Token withKeyword; |
| 839 TypeName supertype = pop(); | 839 TypeName supertype = pop(); |
| 840 push(new _MixinApplication(supertype, withKeyword, mixinTypes)); | 840 push(new _MixinApplication(supertype, withKeyword, mixinTypes)); |
| 841 } | 841 } |
| 842 | 842 |
| 843 @override | 843 @override |
| 844 void endNamedMixinApplication( | 844 void endNamedMixinApplication( |
| 845 Token beginToken, Token implementsKeyword, Token endToken) { | 845 Token beginToken, Token equalsToken, Token implementsKeyword, Token endTok en) { |
|
ahe
2017/02/22 05:35:54
Long line.
| |
| 846 debugEvent("NamedMixinApplication"); | 846 debugEvent("NamedMixinApplication"); |
| 847 ImplementsClause implementsClause; | 847 ImplementsClause implementsClause; |
| 848 if (implementsKeyword != null) { | 848 if (implementsKeyword != null) { |
| 849 List<TypeName> interfaces = pop(); | 849 List<TypeName> interfaces = pop(); |
| 850 implementsClause = | 850 implementsClause = |
| 851 ast.implementsClause(toAnalyzerToken(implementsKeyword), interfaces); | 851 ast.implementsClause(toAnalyzerToken(implementsKeyword), interfaces); |
| 852 } | 852 } |
| 853 _MixinApplication mixinApplication = pop(); | 853 _MixinApplication mixinApplication = pop(); |
| 854 var superclass = mixinApplication.supertype; | 854 var superclass = mixinApplication.supertype; |
| 855 var withClause = ast.withClause( | 855 var withClause = ast.withClause( |
| 856 toAnalyzerToken(mixinApplication.withKeyword), | 856 toAnalyzerToken(mixinApplication.withKeyword), |
| 857 mixinApplication.mixinTypes); | 857 mixinApplication.mixinTypes); |
| 858 // TODO(paulberry,ahe): the parser should give us the "=" token. | 858 analyzer.Token equals = toAnalyzerToken(equalsToken); |
| 859 analyzer.Token equals; | |
| 860 TypeParameterList typeParameters = pop(); | 859 TypeParameterList typeParameters = pop(); |
| 861 SimpleIdentifier name = pop(); | 860 SimpleIdentifier name = pop(); |
| 862 Token classKeyword; | 861 Token classKeyword; |
| 863 // TODO(paulberry,ahe): This is a hack. The parser should give us the class | 862 // TODO(paulberry,ahe): This is a hack. The parser should give us the class |
| 864 // keyword. | 863 // keyword. |
| 865 if (identical(beginToken.value, 'abstract')) { | 864 if (identical(beginToken.value, 'abstract')) { |
| 866 classKeyword = beginToken.next; | 865 classKeyword = beginToken.next; |
| 867 } else { | 866 } else { |
| 868 classKeyword = beginToken; | 867 classKeyword = beginToken; |
| 869 } | 868 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1020 /// [ClassDeclaration] or [ClassTypeAlias] object. | 1019 /// [ClassDeclaration] or [ClassTypeAlias] object. |
| 1021 class _MixinApplication { | 1020 class _MixinApplication { |
| 1022 final TypeName supertype; | 1021 final TypeName supertype; |
| 1023 | 1022 |
| 1024 final Token withKeyword; | 1023 final Token withKeyword; |
| 1025 | 1024 |
| 1026 final List<TypeName> mixinTypes; | 1025 final List<TypeName> mixinTypes; |
| 1027 | 1026 |
| 1028 _MixinApplication(this.supertype, this.withKeyword, this.mixinTypes); | 1027 _MixinApplication(this.supertype, this.withKeyword, this.mixinTypes); |
| 1029 } | 1028 } |
| OLD | NEW |