| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 UnterminatedToken(this.start, int charOffset, this.endOffset) | 257 UnterminatedToken(this.start, int charOffset, this.endOffset) |
| 258 : super(charOffset); | 258 : super(charOffset); |
| 259 | 259 |
| 260 String toString() => "UnterminatedToken($start)"; | 260 String toString() => "UnterminatedToken($start)"; |
| 261 | 261 |
| 262 String get assertionMessage => "'$start' isn't terminated."; | 262 String get assertionMessage => "'$start' isn't terminated."; |
| 263 | 263 |
| 264 int get charCount => endOffset - charOffset; | 264 int get charCount => endOffset - charOffset; |
| 265 } | 265 } |
| 266 | 266 |
| 267 class UnmatchedToken extends ErrorToken { |
| 268 final BeginGroupToken begin; |
| 269 |
| 270 UnmatchedToken(BeginGroupToken begin) |
| 271 : this.begin = begin, |
| 272 super(begin.charOffset); |
| 273 |
| 274 String toString() => "UnmatchedToken(${begin.value})"; |
| 275 |
| 276 String get assertionMessage => "'$begin' isn't closed."; |
| 277 } |
| 278 |
| 267 /** | 279 /** |
| 268 * A String-valued token. Represents identifiers, string literals, | 280 * A String-valued token. Represents identifiers, string literals, |
| 269 * number literals, comments, and error tokens, using the corresponding | 281 * number literals, comments, and error tokens, using the corresponding |
| 270 * precedence info. | 282 * precedence info. |
| 271 */ | 283 */ |
| 272 class StringToken extends Token { | 284 class StringToken extends Token { |
| 273 /** | 285 /** |
| 274 * The length threshold above which substring tokens are computed lazily. | 286 * The length threshold above which substring tokens are computed lazily. |
| 275 * | 287 * |
| 276 * For string tokens that are substrings of the program source, the actual | 288 * For string tokens that are substrings of the program source, the actual |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 713 |
| 702 const PrecedenceInfo STRING_INTERPOLATION_IDENTIFIER_INFO = | 714 const PrecedenceInfo STRING_INTERPOLATION_IDENTIFIER_INFO = |
| 703 const PrecedenceInfo('\$', 0, | 715 const PrecedenceInfo('\$', 0, |
| 704 STRING_INTERPOLATION_IDENTIFIER_TOKEN); | 716 STRING_INTERPOLATION_IDENTIFIER_TOKEN); |
| 705 | 717 |
| 706 const PrecedenceInfo HEXADECIMAL_INFO = | 718 const PrecedenceInfo HEXADECIMAL_INFO = |
| 707 const PrecedenceInfo('hexadecimal', 0, HEXADECIMAL_TOKEN); | 719 const PrecedenceInfo('hexadecimal', 0, HEXADECIMAL_TOKEN); |
| 708 | 720 |
| 709 const PrecedenceInfo COMMENT_INFO = | 721 const PrecedenceInfo COMMENT_INFO = |
| 710 const PrecedenceInfo('comment', 0, COMMENT_TOKEN); | 722 const PrecedenceInfo('comment', 0, COMMENT_TOKEN); |
| OLD | NEW |