| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:front_end/src/fasta/problems.dart' | 5 import 'package:front_end/src/fasta/problems.dart' |
| 6 show internalProblem, unsupported; | 6 show internalProblem, unsupported; |
| 7 import 'package:front_end/src/fasta/messages.dart' show Message; | 7 import 'package:front_end/src/fasta/messages.dart' show Message; |
| 8 import 'package:front_end/src/fasta/parser.dart'; | 8 import 'package:front_end/src/fasta/parser.dart'; |
| 9 import 'package:front_end/src/fasta/source/stack_listener.dart'; | 9 import 'package:front_end/src/fasta/source/stack_listener.dart'; |
| 10 import 'package:front_end/src/scanner/token.dart'; | 10 import 'package:front_end/src/scanner/token.dart'; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 debugEvent("Arguments"); | 180 debugEvent("Arguments"); |
| 181 push(popList(count)); | 181 push(popList(count)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 @override | 184 @override |
| 185 void endClassBody(int memberCount, Token beginToken, Token endToken) { | 185 void endClassBody(int memberCount, Token beginToken, Token endToken) { |
| 186 debugEvent("ClassBody"); | 186 debugEvent("ClassBody"); |
| 187 push(popList(memberCount)); | 187 push(popList(memberCount)); |
| 188 } | 188 } |
| 189 | 189 |
| 190 @override |
| 191 void handleNativeClause(Token nativeToken, bool hasName) { |
| 192 if (hasName) { |
| 193 pop(); // Pop the native clause which in this case is a StringLiteral. |
| 194 } |
| 195 } |
| 196 |
| 190 void endClassDeclaration( | 197 void endClassDeclaration( |
| 191 int interfacesCount, | 198 int interfacesCount, |
| 192 Token beginToken, | 199 Token beginToken, |
| 193 Token classKeyword, | 200 Token classKeyword, |
| 194 Token extendsKeyword, | 201 Token extendsKeyword, |
| 195 Token implementsKeyword, | 202 Token implementsKeyword, |
| 203 Token nativeToken, |
| 196 Token endToken) { | 204 Token endToken) { |
| 197 debugEvent("ClassDeclaration"); | 205 debugEvent("ClassDeclaration"); |
| 198 List<ClassMember> members = pop(); | 206 List<ClassMember> members = pop(); |
| 199 TypeName superclass = pop(); | 207 TypeName superclass = pop(); |
| 200 pop(); // Type variables | 208 pop(); // Type variables |
| 201 String name = pop(); | 209 String name = pop(); |
| 202 List<Annotation> metadata = pop(); | 210 List<Annotation> metadata = pop(); |
| 203 Comment comment = pop(); | 211 Comment comment = pop(); |
| 204 compilationUnit.declarations.add( | 212 compilationUnit.declarations.add( |
| 205 new ClassDeclaration(comment, metadata, name, superclass, members)); | 213 new ClassDeclaration(comment, metadata, name, superclass, members)); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 final String name; | 484 final String name; |
| 477 | 485 |
| 478 final List<TypeName> typeArguments; | 486 final List<TypeName> typeArguments; |
| 479 | 487 |
| 480 TypeName(this.name, this.typeArguments); | 488 TypeName(this.name, this.typeArguments); |
| 481 } | 489 } |
| 482 | 490 |
| 483 /// "Mini AST" representation of an expression which summary code generation | 491 /// "Mini AST" representation of an expression which summary code generation |
| 484 /// need not be concerned about. | 492 /// need not be concerned about. |
| 485 class UnknownExpression extends Expression {} | 493 class UnknownExpression extends Expression {} |
| OLD | NEW |