| 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 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1851 listener.beginFactoryMethod(factoryKeyword); | 1851 listener.beginFactoryMethod(factoryKeyword); |
| 1852 token = expect('factory', token); | 1852 token = expect('factory', token); |
| 1853 token = parseConstructorReference(token); | 1853 token = parseConstructorReference(token); |
| 1854 token = parseFormalParameters(token); | 1854 token = parseFormalParameters(token); |
| 1855 token = parseAsyncModifier(token); | 1855 token = parseAsyncModifier(token); |
| 1856 if (optional('=', token)) { | 1856 if (optional('=', token)) { |
| 1857 token = parseRedirectingFactoryBody(token); | 1857 token = parseRedirectingFactoryBody(token); |
| 1858 } else { | 1858 } else { |
| 1859 token = parseFunctionBody(token, false, isExternal); | 1859 token = parseFunctionBody(token, false, isExternal); |
| 1860 } | 1860 } |
| 1861 listener.endFactoryMethod(start, token); | 1861 listener.endFactoryMethod(start, factoryKeyword, token); |
| 1862 return token.next; | 1862 return token.next; |
| 1863 } | 1863 } |
| 1864 | 1864 |
| 1865 Token parseOperatorName(Token token) { | 1865 Token parseOperatorName(Token token) { |
| 1866 assert(optional('operator', token)); | 1866 assert(optional('operator', token)); |
| 1867 if (isUserDefinableOperator(token.next.stringValue)) { | 1867 if (isUserDefinableOperator(token.next.stringValue)) { |
| 1868 Token operator = token; | 1868 Token operator = token; |
| 1869 token = token.next; | 1869 token = token.next; |
| 1870 listener.handleOperatorName(operator, token); | 1870 listener.handleOperatorName(operator, token); |
| 1871 return token.next; | 1871 return token.next; |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3578 break; | 3578 break; |
| 3579 } | 3579 } |
| 3580 if (isRecoverable) { | 3580 if (isRecoverable) { |
| 3581 listener.handleRecoverableError(token, kind, arguments); | 3581 listener.handleRecoverableError(token, kind, arguments); |
| 3582 return null; | 3582 return null; |
| 3583 } else { | 3583 } else { |
| 3584 return listener.handleUnrecoverableError(token, kind, arguments)?.next; | 3584 return listener.handleUnrecoverableError(token, kind, arguments)?.next; |
| 3585 } | 3585 } |
| 3586 } | 3586 } |
| 3587 } | 3587 } |
| OLD | NEW |