| 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 part of scanner; | 5 part of scanner; |
| 6 | 6 |
| 7 const int EOF_TOKEN = 0; | 7 const int EOF_TOKEN = 0; |
| 8 | 8 |
| 9 const int KEYWORD_TOKEN = $k; | 9 const int KEYWORD_TOKEN = $k; |
| 10 const int IDENTIFIER_TOKEN = $a; | 10 const int IDENTIFIER_TOKEN = $a; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 BadInputToken(this.character, int charOffset) | 255 BadInputToken(this.character, int charOffset) |
| 256 : super(charOffset); | 256 : super(charOffset); |
| 257 | 257 |
| 258 String toString() => "BadInputToken($character)"; | 258 String toString() => "BadInputToken($character)"; |
| 259 | 259 |
| 260 String get assertionMessage { | 260 String get assertionMessage { |
| 261 return 'Character U+${character.toRadixString(16)} not allowed here.'; | 261 return 'Character U+${character.toRadixString(16)} not allowed here.'; |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 // TODO(sigmund): delete once we enable null-aware-operators by default. | |
| 266 class UnsupportedNullAwareToken extends ErrorToken { | |
| 267 final String operator; | |
| 268 | |
| 269 UnsupportedNullAwareToken(this.operator, int charOffset) | |
| 270 : super(charOffset); | |
| 271 | |
| 272 String toString() => "UnsupportedNullAwareToken($operator)"; | |
| 273 | |
| 274 String get assertionMessage => "'$operator' isn't supported without " | |
| 275 "the --enable-null-aware-operators flag."; | |
| 276 | |
| 277 int get charCount => operator.length; | |
| 278 } | |
| 279 | |
| 280 class UnterminatedToken extends ErrorToken { | 265 class UnterminatedToken extends ErrorToken { |
| 281 final String start; | 266 final String start; |
| 282 final int endOffset; | 267 final int endOffset; |
| 283 | 268 |
| 284 UnterminatedToken(this.start, int charOffset, this.endOffset) | 269 UnterminatedToken(this.start, int charOffset, this.endOffset) |
| 285 : super(charOffset); | 270 : super(charOffset); |
| 286 | 271 |
| 287 String toString() => "UnterminatedToken($start)"; | 272 String toString() => "UnterminatedToken($start)"; |
| 288 | 273 |
| 289 String get assertionMessage => "'$start' isn't terminated."; | 274 String get assertionMessage => "'$start' isn't terminated."; |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 | 731 |
| 747 const PrecedenceInfo STRING_INTERPOLATION_IDENTIFIER_INFO = | 732 const PrecedenceInfo STRING_INTERPOLATION_IDENTIFIER_INFO = |
| 748 const PrecedenceInfo('\$', 0, | 733 const PrecedenceInfo('\$', 0, |
| 749 STRING_INTERPOLATION_IDENTIFIER_TOKEN); | 734 STRING_INTERPOLATION_IDENTIFIER_TOKEN); |
| 750 | 735 |
| 751 const PrecedenceInfo HEXADECIMAL_INFO = | 736 const PrecedenceInfo HEXADECIMAL_INFO = |
| 752 const PrecedenceInfo('hexadecimal', 0, HEXADECIMAL_TOKEN); | 737 const PrecedenceInfo('hexadecimal', 0, HEXADECIMAL_TOKEN); |
| 753 | 738 |
| 754 const PrecedenceInfo COMMENT_INFO = | 739 const PrecedenceInfo COMMENT_INFO = |
| 755 const PrecedenceInfo('comment', 0, COMMENT_TOKEN); | 740 const PrecedenceInfo('comment', 0, COMMENT_TOKEN); |
| OLD | NEW |