| 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 2937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 } | 2948 } |
| 2949 | 2949 |
| 2950 Token parseLiteralSymbol(Token token) { | 2950 Token parseLiteralSymbol(Token token) { |
| 2951 Token hashToken = token; | 2951 Token hashToken = token; |
| 2952 listener.beginLiteralSymbol(hashToken); | 2952 listener.beginLiteralSymbol(hashToken); |
| 2953 token = token.next; | 2953 token = token.next; |
| 2954 if (isUserDefinableOperator(token.stringValue)) { | 2954 if (isUserDefinableOperator(token.stringValue)) { |
| 2955 listener.handleOperator(token); | 2955 listener.handleOperator(token); |
| 2956 listener.endLiteralSymbol(hashToken, 1); | 2956 listener.endLiteralSymbol(hashToken, 1); |
| 2957 return token.next; | 2957 return token.next; |
| 2958 } else if (identical(token.stringValue, 'void')) { |
| 2959 listener.handleSymbolVoid(token); |
| 2960 listener.endLiteralSymbol(hashToken, 1); |
| 2961 return token.next; |
| 2958 } else { | 2962 } else { |
| 2959 int count = 1; | 2963 int count = 1; |
| 2960 token = parseIdentifier(token, IdentifierContext.literalSymbol); | 2964 token = parseIdentifier(token, IdentifierContext.literalSymbol); |
| 2961 while (identical(token.stringValue, '.')) { | 2965 while (identical(token.stringValue, '.')) { |
| 2962 count++; | 2966 count++; |
| 2963 token = parseIdentifier( | 2967 token = parseIdentifier( |
| 2964 token.next, IdentifierContext.literalSymbolContinuation); | 2968 token.next, IdentifierContext.literalSymbolContinuation); |
| 2965 } | 2969 } |
| 2966 listener.endLiteralSymbol(hashToken, count); | 2970 listener.endLiteralSymbol(hashToken, count); |
| 2967 return token; | 2971 return token; |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3559 break; | 3563 break; |
| 3560 } | 3564 } |
| 3561 if (isRecoverable) { | 3565 if (isRecoverable) { |
| 3562 listener.handleRecoverableError(token, kind, arguments); | 3566 listener.handleRecoverableError(token, kind, arguments); |
| 3563 return null; | 3567 return null; |
| 3564 } else { | 3568 } else { |
| 3565 return listener.handleUnrecoverableError(token, kind, arguments); | 3569 return listener.handleUnrecoverableError(token, kind, arguments); |
| 3566 } | 3570 } |
| 3567 } | 3571 } |
| 3568 } | 3572 } |
| OLD | NEW |