| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 /** | 92 /** |
| 93 * The character offset of the start of this token within the source text. | 93 * The character offset of the start of this token within the source text. |
| 94 */ | 94 */ |
| 95 final int charOffset; | 95 final int charOffset; |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * The next token in the token stream. | 98 * The next token in the token stream. |
| 99 */ | 99 */ |
| 100 Token next; | 100 Token next; |
| 101 | 101 |
| 102 Token(PrecedenceInfo this.info, int this.charOffset); | 102 Token(this.info, this.charOffset); |
| 103 | 103 |
| 104 get value => info.value; | 104 get value => info.value; |
| 105 | 105 |
| 106 /** | 106 /** |
| 107 * Returns the string value for keywords and symbols. For instance 'class' for | 107 * Returns the string value for keywords and symbols. For instance 'class' for |
| 108 * the [CLASS] keyword token and '*' for a [Token] based on [STAR_INFO]. For | 108 * the [CLASS] keyword token and '*' for a [Token] based on [STAR_INFO]. For |
| 109 * other tokens, such identifiers, strings, numbers, etc, [stringValue] | 109 * other tokens, such identifiers, strings, numbers, etc, [stringValue] |
| 110 * returns [:null:]. | 110 * returns [:null:]. |
| 111 * | 111 * |
| 112 * [stringValue] should only be used for testing keywords and symbols. | 112 * [stringValue] should only be used for testing keywords and symbols. |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 | 545 |
| 546 const PrecedenceInfo HEXADECIMAL_INFO = | 546 const PrecedenceInfo HEXADECIMAL_INFO = |
| 547 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); | 547 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); |
| 548 | 548 |
| 549 const PrecedenceInfo COMMENT_INFO = | 549 const PrecedenceInfo COMMENT_INFO = |
| 550 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); | 550 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); |
| 551 | 551 |
| 552 // For reporting lexical errors. | 552 // For reporting lexical errors. |
| 553 const PrecedenceInfo ERROR_INFO = | 553 const PrecedenceInfo ERROR_INFO = |
| 554 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); | 554 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); |
| OLD | NEW |