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.outline_builder; | 5 library fasta.outline_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' show ProcedureKind; | 7 import 'package:kernel/ast.dart' show ProcedureKind; |
8 | 8 |
9 import '../../scanner/token.dart' show Token; | 9 import '../../scanner/token.dart' show Token; |
10 | 10 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 @override | 277 @override |
278 void endClassDeclaration( | 278 void endClassDeclaration( |
279 int interfacesCount, | 279 int interfacesCount, |
280 Token beginToken, | 280 Token beginToken, |
281 Token classKeyword, | 281 Token classKeyword, |
282 Token extendsKeyword, | 282 Token extendsKeyword, |
283 Token implementsKeyword, | 283 Token implementsKeyword, |
284 Token endToken) { | 284 Token endToken) { |
285 debugEvent("endClassDeclaration"); | 285 debugEvent("endClassDeclaration"); |
| 286 |
| 287 String documentationComment = null; |
| 288 if (beginToken.precedingComments != null) { |
| 289 documentationComment = beginToken.precedingComments.lexeme; |
| 290 // TODO(scheglov): Add support for line comments. |
| 291 } |
| 292 |
286 List<TypeBuilder> interfaces = popList(interfacesCount); | 293 List<TypeBuilder> interfaces = popList(interfacesCount); |
287 TypeBuilder supertype = pop(); | 294 TypeBuilder supertype = pop(); |
288 List<TypeVariableBuilder> typeVariables = pop(); | 295 List<TypeVariableBuilder> typeVariables = pop(); |
289 int charOffset = pop(); | 296 int charOffset = pop(); |
290 String name = pop(); | 297 String name = pop(); |
291 if (typeVariables != null && supertype is MixinApplicationBuilder) { | 298 if (typeVariables != null && supertype is MixinApplicationBuilder) { |
292 supertype.typeVariables = typeVariables; | 299 supertype.typeVariables = typeVariables; |
293 supertype.subclassName = name; | 300 supertype.subclassName = name; |
294 } | 301 } |
295 int modifiers = Modifier.validate(pop()); | 302 int modifiers = Modifier.validate(pop()); |
296 List<MetadataBuilder> metadata = pop(); | 303 List<MetadataBuilder> metadata = pop(); |
297 library.addClass(metadata, modifiers, name, typeVariables, supertype, | 304 library.addClass(documentationComment, metadata, modifiers, name, |
298 interfaces, charOffset); | 305 typeVariables, supertype, interfaces, charOffset); |
299 checkEmpty(beginToken.charOffset); | 306 checkEmpty(beginToken.charOffset); |
300 } | 307 } |
301 | 308 |
302 ProcedureKind computeProcedureKind(Token token) { | 309 ProcedureKind computeProcedureKind(Token token) { |
303 if (token == null) return ProcedureKind.Method; | 310 if (token == null) return ProcedureKind.Method; |
304 if (optional("get", token)) return ProcedureKind.Getter; | 311 if (optional("get", token)) return ProcedureKind.Getter; |
305 if (optional("set", token)) return ProcedureKind.Setter; | 312 if (optional("set", token)) return ProcedureKind.Setter; |
306 return unhandled( | 313 return unhandled( |
307 token.lexeme, "computeProcedureKind", token.charOffset, uri); | 314 token.lexeme, "computeProcedureKind", token.charOffset, uri); |
308 } | 315 } |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 Link<Token> handleMemberName(Link<Token> identifiers) { | 893 Link<Token> handleMemberName(Link<Token> identifiers) { |
887 if (!enableNative || identifiers.isEmpty) return identifiers; | 894 if (!enableNative || identifiers.isEmpty) return identifiers; |
888 return removeNativeClause(identifiers, stringExpectedAfterNative); | 895 return removeNativeClause(identifiers, stringExpectedAfterNative); |
889 } | 896 } |
890 | 897 |
891 @override | 898 @override |
892 void debugEvent(String name) { | 899 void debugEvent(String name) { |
893 // printEvent(name); | 900 // printEvent(name); |
894 } | 901 } |
895 } | 902 } |
OLD | NEW |