| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.generated.parser; | 5 library analyzer.src.generated.parser; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 5635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5646 * creating a type annotation or changing the current token. Return the token | 5646 * creating a type annotation or changing the current token. Return the token |
| 5647 * following the type annotation that was parsed, or `null` if the given token | 5647 * following the type annotation that was parsed, or `null` if the given token |
| 5648 * is not the first token in a valid type annotation. | 5648 * is not the first token in a valid type annotation. |
| 5649 * | 5649 * |
| 5650 * This method must be kept in sync with [parseTypeAnnotation]. | 5650 * This method must be kept in sync with [parseTypeAnnotation]. |
| 5651 */ | 5651 */ |
| 5652 Token skipTypeAnnotation(Token startToken) { | 5652 Token skipTypeAnnotation(Token startToken) { |
| 5653 Token next = null; | 5653 Token next = null; |
| 5654 if (_atGenericFunctionTypeAfterReturnType(startToken)) { | 5654 if (_atGenericFunctionTypeAfterReturnType(startToken)) { |
| 5655 next = skipGenericFunctionTypeAfterReturnType(startToken); | 5655 next = skipGenericFunctionTypeAfterReturnType(startToken); |
| 5656 } else if (_currentToken.keyword == Keyword.VOID && | 5656 } else if (startToken.keyword == Keyword.VOID && |
| 5657 _atGenericFunctionTypeAfterReturnType(_currentToken.next)) { | 5657 _atGenericFunctionTypeAfterReturnType(startToken.next)) { |
| 5658 next = next.next; | 5658 next = startToken.next; |
| 5659 } else { | 5659 } else { |
| 5660 next = skipTypeName(startToken); | 5660 next = skipTypeName(startToken); |
| 5661 } | 5661 } |
| 5662 while (next != null && _atGenericFunctionTypeAfterReturnType(next)) { | 5662 while (next != null && _atGenericFunctionTypeAfterReturnType(next)) { |
| 5663 next = skipGenericFunctionTypeAfterReturnType(next); | 5663 next = skipGenericFunctionTypeAfterReturnType(next); |
| 5664 } | 5664 } |
| 5665 return next; | 5665 return next; |
| 5666 } | 5666 } |
| 5667 | 5667 |
| 5668 /** | 5668 /** |
| (...skipping 2931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8600 } | 8600 } |
| 8601 } | 8601 } |
| 8602 } | 8602 } |
| 8603 | 8603 |
| 8604 /** | 8604 /** |
| 8605 * Instances of this class are thrown when the parser detects that AST has | 8605 * Instances of this class are thrown when the parser detects that AST has |
| 8606 * too many nested expressions to be parsed safely and avoid possibility of | 8606 * too many nested expressions to be parsed safely and avoid possibility of |
| 8607 * [StackOverflowError] in the parser or during later analysis. | 8607 * [StackOverflowError] in the parser or during later analysis. |
| 8608 */ | 8608 */ |
| 8609 class _TooDeepTreeError {} | 8609 class _TooDeepTreeError {} |
| OLD | NEW |