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

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

Issue 2735973004: Add 'withKeyword' to mixin application with Fasta. (Closed)
Patch Set: Created 3 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.parser.parser; 5 library fasta.parser.parser;
6 6
7 import '../scanner.dart' show ErrorToken; 7 import '../scanner.dart' show ErrorToken;
8 8
9 import '../scanner/recover.dart' show closeBraceFor, skipToEof; 9 import '../scanner/recover.dart' show closeBraceFor, skipToEof;
10 10
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 token = parseTypeVariablesOpt(token); 415 token = parseTypeVariablesOpt(token);
416 token = parseFormalParameters(token); 416 token = parseFormalParameters(token);
417 } 417 }
418 listener.endFunctionTypeAlias(typedefKeyword, equals, token); 418 listener.endFunctionTypeAlias(typedefKeyword, equals, token);
419 return expect(';', token); 419 return expect(';', token);
420 } 420 }
421 421
422 Token parseMixinApplication(Token token) { 422 Token parseMixinApplication(Token token) {
423 listener.beginMixinApplication(token); 423 listener.beginMixinApplication(token);
424 token = parseType(token); 424 token = parseType(token);
425 Token withKeyword = token;
425 token = expect('with', token); 426 token = expect('with', token);
426 token = parseTypeList(token); 427 token = parseTypeList(token);
427 listener.endMixinApplication(); 428 listener.endMixinApplication(withKeyword);
428 return token; 429 return token;
429 } 430 }
430 431
431 Token parseReturnTypeOpt(Token token) { 432 Token parseReturnTypeOpt(Token token) {
432 if (identical(token.stringValue, 'void')) { 433 if (identical(token.stringValue, 'void')) {
433 if (isGeneralizedFunctionType(token.next)) { 434 if (isGeneralizedFunctionType(token.next)) {
434 return parseType(token); 435 return parseType(token);
435 } else { 436 } else {
436 listener.handleVoidKeyword(token); 437 listener.handleVoidKeyword(token);
437 return token.next; 438 return token.next;
(...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 break; 3573 break;
3573 } 3574 }
3574 if (isRecoverable) { 3575 if (isRecoverable) {
3575 listener.handleRecoverableError(token, kind, arguments); 3576 listener.handleRecoverableError(token, kind, arguments);
3576 return null; 3577 return null;
3577 } else { 3578 } else {
3578 return listener.handleUnrecoverableError(token, kind, arguments); 3579 return listener.handleUnrecoverableError(token, kind, arguments);
3579 } 3580 }
3580 } 3581 }
3581 } 3582 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698