| 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 fasta.scanner.token; | 5 library fasta.scanner.token; |
| 6 | 6 |
| 7 import '../../scanner/token.dart' as analyzer; | 7 import '../../scanner/token.dart' as analyzer; |
| 8 import '../../scanner/token.dart' show Token, TokenType; | 8 import '../../scanner/token.dart' show Token, TokenType; |
| 9 | 9 |
| 10 import 'token_constants.dart' show IDENTIFIER_TOKEN; | 10 import 'token_constants.dart' show IDENTIFIER_TOKEN; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 decodeUtf8(data, start, end, valueOrLazySubstring.boolValue); | 95 decodeUtf8(data, start, end, valueOrLazySubstring.boolValue); |
| 96 } | 96 } |
| 97 return valueOrLazySubstring; | 97 return valueOrLazySubstring; |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 @override | 101 @override |
| 102 bool get isIdentifier => identical(kind, IDENTIFIER_TOKEN); | 102 bool get isIdentifier => identical(kind, IDENTIFIER_TOKEN); |
| 103 | 103 |
| 104 @override | 104 @override |
| 105 String toString() => "StringToken($lexeme)"; | 105 String toString() => lexeme; |
| 106 | 106 |
| 107 static final StringCanonicalizer canonicalizer = new StringCanonicalizer(); | 107 static final StringCanonicalizer canonicalizer = new StringCanonicalizer(); |
| 108 | 108 |
| 109 static String canonicalizedString( | 109 static String canonicalizedString( |
| 110 String s, int start, int end, bool canonicalize) { | 110 String s, int start, int end, bool canonicalize) { |
| 111 if (!canonicalize) return s; | 111 if (!canonicalize) return s; |
| 112 return canonicalizer.canonicalize(s, start, end, false); | 112 return canonicalizer.canonicalize(s, start, end, false); |
| 113 } | 113 } |
| 114 | 114 |
| 115 static String decodeUtf8(List<int> data, int start, int end, bool asciiOnly) { | 115 static String decodeUtf8(List<int> data, int start, int end, bool asciiOnly) { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 identical(value, "<=") || | 312 identical(value, "<=") || |
| 313 identical(value, "<") || | 313 identical(value, "<") || |
| 314 identical(value, "&") || | 314 identical(value, "&") || |
| 315 identical(value, "^") || | 315 identical(value, "^") || |
| 316 identical(value, "|"); | 316 identical(value, "|"); |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool isTernaryOperator(String value) => identical(value, "[]="); | 319 bool isTernaryOperator(String value) => identical(value, "[]="); |
| 320 | 320 |
| 321 bool isMinusOperator(String value) => identical(value, "-"); | 321 bool isMinusOperator(String value) => identical(value, "-"); |
| OLD | NEW |