| 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 const int EOF_TOKEN = 0; | 5 const int EOF_TOKEN = 0; |
| 6 | 6 |
| 7 const int KEYWORD_TOKEN = $k; | 7 const int KEYWORD_TOKEN = $k; |
| 8 const int IDENTIFIER_TOKEN = $a; | 8 const int IDENTIFIER_TOKEN = $a; |
| 9 const int BAD_INPUT_TOKEN = $X; | 9 const int BAD_INPUT_TOKEN = $X; |
| 10 const int DOUBLE_TOKEN = $d; | 10 const int DOUBLE_TOKEN = $d; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 : this.fromSource(info, new SourceString(value), charOffset); | 170 : this.fromSource(info, new SourceString(value), charOffset); |
| 171 | 171 |
| 172 StringToken.fromSource(PrecedenceInfo info, this.value, int charOffset) | 172 StringToken.fromSource(PrecedenceInfo info, this.value, int charOffset) |
| 173 : super(info, charOffset); | 173 : super(info, charOffset); |
| 174 | 174 |
| 175 String toString() => "StringToken(${value.slowToString()})"; | 175 String toString() => "StringToken(${value.slowToString()})"; |
| 176 | 176 |
| 177 String slowToString() => value.slowToString(); | 177 String slowToString() => value.slowToString(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 interface SourceString extends Hashable, Iterable<int> default StringWrapper { | 180 interface SourceString extends Iterable<int> default StringWrapper { |
| 181 const SourceString(String string); | 181 const SourceString(String string); |
| 182 | 182 |
| 183 void printOn(StringBuffer sb); | 183 void printOn(StringBuffer sb); |
| 184 | 184 |
| 185 /** Gives a [SourceString] that is not including the [initial] first and | 185 /** Gives a [SourceString] that is not including the [initial] first and |
| 186 * [terminal] last characters. This is only intended to be used to remove | 186 * [terminal] last characters. This is only intended to be used to remove |
| 187 * quotes from string literals (including an initial '@' for raw strings). | 187 * quotes from string literals (including an initial '@' for raw strings). |
| 188 */ | 188 */ |
| 189 SourceString copyWithoutQuotes(int initial, int terminal); | 189 SourceString copyWithoutQuotes(int initial, int terminal); |
| 190 | 190 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 495 |
| 496 const PrecedenceInfo HEXADECIMAL_INFO = | 496 const PrecedenceInfo HEXADECIMAL_INFO = |
| 497 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); | 497 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); |
| 498 | 498 |
| 499 const PrecedenceInfo COMMENT_INFO = | 499 const PrecedenceInfo COMMENT_INFO = |
| 500 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); | 500 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); |
| 501 | 501 |
| 502 // For reporting lexical errors. | 502 // For reporting lexical errors. |
| 503 const PrecedenceInfo ERROR_INFO = | 503 const PrecedenceInfo ERROR_INFO = |
| 504 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); | 504 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); |
| OLD | NEW |