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 final int EOF_TOKEN = 0; | 5 final int EOF_TOKEN = 0; |
6 | 6 |
7 final int KEYWORD_TOKEN = $k; | 7 final int KEYWORD_TOKEN = $k; |
8 final int IDENTIFIER_TOKEN = $a; | 8 final int IDENTIFIER_TOKEN = $a; |
9 final int DOUBLE_TOKEN = $d; | 9 final int DOUBLE_TOKEN = $d; |
10 final int INT_TOKEN = $i; | 10 final int INT_TOKEN = $i; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 const StringWrapper(String this.stringValue); | 199 const StringWrapper(String this.stringValue); |
200 | 200 |
201 int hashCode() => stringValue.hashCode(); | 201 int hashCode() => stringValue.hashCode(); |
202 | 202 |
203 bool operator ==(other) { | 203 bool operator ==(other) { |
204 return other is SourceString && toString() == other.slowToString(); | 204 return other is SourceString && toString() == other.slowToString(); |
205 } | 205 } |
206 | 206 |
207 Iterator<int> iterator() => new StringCodeIterator(stringValue); | 207 Iterator<int> iterator() => new StringCodeIterator(stringValue); |
208 | 208 |
209 void printOn(StringBuffer sb) { | 209 void printOn(sb) { |
floitsch
2012/07/12 16:29:09
Couldn't you make the CodeBuffer implement StringB
podivilov
2012/07/13 12:49:57
Done.
| |
210 sb.add(stringValue); | 210 sb.add(stringValue); |
211 } | 211 } |
212 | 212 |
213 String toString() => stringValue; | 213 String toString() => stringValue; |
214 | 214 |
215 String slowToString() => stringValue; | 215 String slowToString() => stringValue; |
216 | 216 |
217 SourceString copyWithoutQuotes(int initial, int terminal) { | 217 SourceString copyWithoutQuotes(int initial, int terminal) { |
218 assert(0 <= initial); | 218 assert(0 <= initial); |
219 assert(0 <= terminal); | 219 assert(0 <= terminal); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 | 491 |
492 final PrecedenceInfo HEXADECIMAL_INFO = | 492 final PrecedenceInfo HEXADECIMAL_INFO = |
493 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); | 493 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); |
494 | 494 |
495 final PrecedenceInfo COMMENT_INFO = | 495 final PrecedenceInfo COMMENT_INFO = |
496 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); | 496 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); |
497 | 497 |
498 // For reporting lexical errors. | 498 // For reporting lexical errors. |
499 final PrecedenceInfo ERROR_INFO = | 499 final PrecedenceInfo ERROR_INFO = |
500 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); | 500 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); |
OLD | NEW |