Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: pkg/front_end/lib/src/fasta/source/outline_builder.dart

Issue 2996163002: support class native clause (Closed)
Patch Set: add new fasta native clause error code Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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, TokenType;
10 10
11 import '../builder/builder.dart'; 11 import '../builder/builder.dart';
12 12
13 import '../combinator.dart' show Combinator; 13 import '../combinator.dart' show Combinator;
14 14
15 import '../fasta_codes.dart' 15 import '../fasta_codes.dart'
16 show 16 show
17 Message, 17 Message,
18 codeExpectedBlockToSkip, 18 codeExpectedBlockToSkip,
19 messageOperatorWithOptionalFormals, 19 messageOperatorWithOptionalFormals,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 library.currentDeclaration.name = name.lexeme; 292 library.currentDeclaration.name = name.lexeme;
293 } 293 }
294 294
295 @override 295 @override
296 void endClassDeclaration( 296 void endClassDeclaration(
297 int interfacesCount, 297 int interfacesCount,
298 Token beginToken, 298 Token beginToken,
299 Token classKeyword, 299 Token classKeyword,
300 Token extendsKeyword, 300 Token extendsKeyword,
301 Token implementsKeyword, 301 Token implementsKeyword,
302 Token nativeToken,
302 Token endToken) { 303 Token endToken) {
303 debugEvent("endClassDeclaration"); 304 debugEvent("endClassDeclaration");
304 String documentationComment = _getDocumentationComment(beginToken); 305 String documentationComment = _getDocumentationComment(beginToken);
306 if (nativeToken?.next?.type == TokenType.STRING) {
ahe 2017/08/21 12:04:10 Same comment as ast_builder.dart.
danrubel 2017/08/22 01:35:28 Fixed as discussed previously.
307 // pop native clause - literal string
ahe 2017/08/21 12:04:10 A sentence should start with an uppercase letter a
308 pop(); // char offset
309 pop(); // string
310 }
305 List<TypeBuilder> interfaces = popList(interfacesCount); 311 List<TypeBuilder> interfaces = popList(interfacesCount);
306 TypeBuilder supertype = pop(); 312 TypeBuilder supertype = pop();
307 List<TypeVariableBuilder> typeVariables = pop(); 313 List<TypeVariableBuilder> typeVariables = pop();
308 int charOffset = pop(); 314 int charOffset = pop();
309 String name = pop(); 315 String name = pop();
310 if (typeVariables != null && supertype is MixinApplicationBuilder) { 316 if (typeVariables != null && supertype is MixinApplicationBuilder) {
311 supertype.typeVariables = typeVariables; 317 supertype.typeVariables = typeVariables;
312 supertype.subclassName = name; 318 supertype.subclassName = name;
313 } 319 }
314 int modifiers = Modifier.validate(pop()); 320 int modifiers = Modifier.validate(pop());
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 docToken = docToken.next; 970 docToken = docToken.next;
965 } 971 }
966 return buffer.toString(); 972 return buffer.toString();
967 } 973 }
968 974
969 @override 975 @override
970 void debugEvent(String name) { 976 void debugEvent(String name) {
971 // printEvent(name); 977 // printEvent(name);
972 } 978 }
973 } 979 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698