| 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.parser; | 5 library analyzer.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 5946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5957 * will have any comments that might have preceeded the token. | 5957 * will have any comments that might have preceeded the token. |
| 5958 */ | 5958 */ |
| 5959 Token _createToken(Token token, TokenType type, {bool isBegin: false}) { | 5959 Token _createToken(Token token, TokenType type, {bool isBegin: false}) { |
| 5960 CommentToken comments = token.precedingComments; | 5960 CommentToken comments = token.precedingComments; |
| 5961 if (comments == null) { | 5961 if (comments == null) { |
| 5962 if (isBegin) { | 5962 if (isBegin) { |
| 5963 return new BeginToken(type, token.offset); | 5963 return new BeginToken(type, token.offset); |
| 5964 } | 5964 } |
| 5965 return new Token(type, token.offset); | 5965 return new Token(type, token.offset); |
| 5966 } else if (isBegin) { | 5966 } else if (isBegin) { |
| 5967 return new BeginTokenWithComment(type, token.offset, comments); | 5967 return new BeginToken(type, token.offset, comments); |
| 5968 } | 5968 } |
| 5969 return new TokenWithComment(type, token.offset, comments); | 5969 return new Token(type, token.offset, comments); |
| 5970 } | 5970 } |
| 5971 | 5971 |
| 5972 /** | 5972 /** |
| 5973 * Check that the given [expression] is assignable and report an error if it | 5973 * Check that the given [expression] is assignable and report an error if it |
| 5974 * isn't. | 5974 * isn't. |
| 5975 * | 5975 * |
| 5976 * assignableExpression ::= | 5976 * assignableExpression ::= |
| 5977 * primary (arguments* assignableSelector)+ | 5977 * primary (arguments* assignableSelector)+ |
| 5978 * | 'super' unconditionalAssignableSelector | 5978 * | 'super' unconditionalAssignableSelector |
| 5979 * | identifier | 5979 * | identifier |
| (...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8649 } | 8649 } |
| 8650 } | 8650 } |
| 8651 } | 8651 } |
| 8652 | 8652 |
| 8653 /** | 8653 /** |
| 8654 * Instances of this class are thrown when the parser detects that AST has | 8654 * Instances of this class are thrown when the parser detects that AST has |
| 8655 * too many nested expressions to be parsed safely and avoid possibility of | 8655 * too many nested expressions to be parsed safely and avoid possibility of |
| 8656 * [StackOverflowError] in the parser or during later analysis. | 8656 * [StackOverflowError] in the parser or during later analysis. |
| 8657 */ | 8657 */ |
| 8658 class _TooDeepTreeError {} | 8658 class _TooDeepTreeError {} |
| OLD | NEW |