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 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 listener.beginConstructorReference(start); | 1947 listener.beginConstructorReference(start); |
1948 token = parseIdentifier(token, IdentifierContext.constructorReference); | 1948 token = parseIdentifier(token, IdentifierContext.constructorReference); |
1949 token = parseQualifiedRestOpt( | 1949 token = parseQualifiedRestOpt( |
1950 token, IdentifierContext.constructorReferenceContinuation); | 1950 token, IdentifierContext.constructorReferenceContinuation); |
1951 token = parseTypeArgumentsOpt(token); | 1951 token = parseTypeArgumentsOpt(token); |
1952 Token period = null; | 1952 Token period = null; |
1953 if (optional('.', token)) { | 1953 if (optional('.', token)) { |
1954 period = token; | 1954 period = token; |
1955 token = parseIdentifier(token.next, | 1955 token = parseIdentifier(token.next, |
1956 IdentifierContext.constructorReferenceContinuationAfterTypeArguments); | 1956 IdentifierContext.constructorReferenceContinuationAfterTypeArguments); |
| 1957 } else { |
| 1958 listener.handleNoConstructorReferenceContinuationAfterTypeArguments(token)
; |
1957 } | 1959 } |
1958 listener.endConstructorReference(start, period, token); | 1960 listener.endConstructorReference(start, period, token); |
1959 return token; | 1961 return token; |
1960 } | 1962 } |
1961 | 1963 |
1962 Token parseRedirectingFactoryBody(Token token) { | 1964 Token parseRedirectingFactoryBody(Token token) { |
1963 listener.beginRedirectingFactoryBody(token); | 1965 listener.beginRedirectingFactoryBody(token); |
1964 assert(optional('=', token)); | 1966 assert(optional('=', token)); |
1965 Token equals = token; | 1967 Token equals = token; |
1966 token = parseConstructorReference(token.next); | 1968 token = parseConstructorReference(token.next); |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3543 break; | 3545 break; |
3544 } | 3546 } |
3545 if (isRecoverable) { | 3547 if (isRecoverable) { |
3546 listener.handleRecoverableError(token, kind, arguments); | 3548 listener.handleRecoverableError(token, kind, arguments); |
3547 return null; | 3549 return null; |
3548 } else { | 3550 } else { |
3549 return listener.handleUnrecoverableError(token, kind, arguments); | 3551 return listener.handleUnrecoverableError(token, kind, arguments); |
3550 } | 3552 } |
3551 } | 3553 } |
3552 } | 3554 } |
OLD | NEW |