| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |