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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 StringCodeIterator(String string) : | 237 StringCodeIterator(String string) : |
238 this.string = string, index = 0, end = string.length; | 238 this.string = string, index = 0, end = string.length; |
239 | 239 |
240 StringCodeIterator.substring(this.string, this.index, this.end) { | 240 StringCodeIterator.substring(this.string, this.index, this.end) { |
241 assert(0 <= index); | 241 assert(0 <= index); |
242 assert(index <= end); | 242 assert(index <= end); |
243 assert(end <= string.length); | 243 assert(end <= string.length); |
244 } | 244 } |
245 | 245 |
246 bool hasNext() => index < end; | 246 bool get hasNext => index < end; |
247 int next() => string.charCodeAt(index++); | 247 int next() => string.charCodeAt(index++); |
248 } | 248 } |
249 | 249 |
250 class BeginGroupToken extends StringToken { | 250 class BeginGroupToken extends StringToken { |
251 Token endGroup; | 251 Token endGroup; |
252 BeginGroupToken(PrecedenceInfo info, String value, int charOffset) | 252 BeginGroupToken(PrecedenceInfo info, String value, int charOffset) |
253 : super(info, value, charOffset); | 253 : super(info, value, charOffset); |
254 } | 254 } |
255 | 255 |
256 bool isUserDefinableOperator(String value) { | 256 bool isUserDefinableOperator(String value) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 493 |
494 const PrecedenceInfo HEXADECIMAL_INFO = | 494 const PrecedenceInfo HEXADECIMAL_INFO = |
495 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); | 495 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); |
496 | 496 |
497 const PrecedenceInfo COMMENT_INFO = | 497 const PrecedenceInfo COMMENT_INFO = |
498 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); | 498 const PrecedenceInfo(const SourceString('comment'), 0, COMMENT_TOKEN); |
499 | 499 |
500 // For reporting lexical errors. | 500 // For reporting lexical errors. |
501 const PrecedenceInfo ERROR_INFO = | 501 const PrecedenceInfo ERROR_INFO = |
502 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); | 502 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); |
OLD | NEW |