| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 dart2js.tokens; | 5 library dart2js.tokens; |
| 6 | 6 |
| 7 import 'dart:convert' show | 7 import 'dart:convert' show |
| 8 UTF8; | 8 UTF8; |
| 9 import 'dart:collection' show | 9 import 'dart:collection' show |
| 10 HashSet; | 10 HashSet; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 int get charCount { | 105 int get charCount { |
| 106 if (info == Precedence.BAD_INPUT_INFO) { | 106 if (info == Precedence.BAD_INPUT_INFO) { |
| 107 // This is a token that wraps around an error message. Return 1 | 107 // This is a token that wraps around an error message. Return 1 |
| 108 // instead of the size of the length of the error message. | 108 // instead of the size of the length of the error message. |
| 109 return 1; | 109 return 1; |
| 110 } else { | 110 } else { |
| 111 return value.length; | 111 return value.length; |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 /// The character offset of the end of this token within the source text. |
| 116 int get charEnd => charOffset + charCount; |
| 117 |
| 115 int get hashCode => computeHashCode(charOffset, info, value); | 118 int get hashCode => computeHashCode(charOffset, info, value); |
| 116 } | 119 } |
| 117 | 120 |
| 118 /// A pair of tokens marking the beginning and the end of a span. Use for error | 121 /// A pair of tokens marking the beginning and the end of a span. Use for error |
| 119 /// reporting. | 122 /// reporting. |
| 120 class TokenPair implements Spannable { | 123 class TokenPair implements Spannable { |
| 121 final Token begin; | 124 final Token begin; |
| 122 final Token end; | 125 final Token end; |
| 123 | 126 |
| 124 TokenPair(this.begin, this.end); | 127 TokenPair(this.begin, this.end); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 (identical(value, '<=')) || | 434 (identical(value, '<=')) || |
| 432 (identical(value, '<')) || | 435 (identical(value, '<')) || |
| 433 (identical(value, '&')) || | 436 (identical(value, '&')) || |
| 434 (identical(value, '^')) || | 437 (identical(value, '^')) || |
| 435 (identical(value, '|')); | 438 (identical(value, '|')); |
| 436 } | 439 } |
| 437 | 440 |
| 438 bool isTernaryOperator(String value) => identical(value, '[]='); | 441 bool isTernaryOperator(String value) => identical(value, '[]='); |
| 439 | 442 |
| 440 bool isMinusOperator(String value) => identical(value, '-'); | 443 bool isMinusOperator(String value) => identical(value, '-'); |
| OLD | NEW |