| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void printOn(StringBuffer sb) { | 154 void printOn(StringBuffer sb) { |
| 155 sb.add(stringValue); | 155 sb.add(stringValue); |
| 156 } | 156 } |
| 157 | 157 |
| 158 String toString() => stringValue; | 158 String toString() => stringValue; |
| 159 | 159 |
| 160 SourceString copyWithoutQuotes(int initial, int terminal) { | 160 SourceString copyWithoutQuotes(int initial, int terminal) { |
| 161 assert(0 <= initial); | 161 assert(0 <= initial); |
| 162 assert(0 <= terminal); | 162 assert(0 <= terminal); |
| 163 assert(initial + terminal <= stringValue.length); | 163 assert(initial + terminal <= stringValue.length); |
| 164 assert(stringValue.startsWith(["", "'", "@'", "'''", "@'''"][initial]) || | |
| 165 stringValue.startsWith(['', '"', '@"', '"""', '@"""'][initial])); | |
| 166 assert(stringValue.endsWith(["", "'", null, "'''"][terminal]) || | |
| 167 stringValue.endsWith(['', '"', null, '"""'][terminal])); | |
| 168 return new StringWrapper( | 164 return new StringWrapper( |
| 169 stringValue.substring(initial, stringValue.length - terminal)); | 165 stringValue.substring(initial, stringValue.length - terminal)); |
| 170 } | 166 } |
| 171 | 167 |
| 172 bool isEmpty() => stringValue.isEmpty(); | 168 bool isEmpty() => stringValue.isEmpty(); |
| 173 } | 169 } |
| 174 | 170 |
| 175 class StringCodeIterator implements Iterator<int> { | 171 class StringCodeIterator implements Iterator<int> { |
| 176 final String string; | 172 final String string; |
| 177 int index; | 173 int index; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 final PrecedenceInfo STRING_INTERPOLATION_INFO = | 393 final PrecedenceInfo STRING_INTERPOLATION_INFO = |
| 398 const PrecedenceInfo(const SourceString('\${'), 0, | 394 const PrecedenceInfo(const SourceString('\${'), 0, |
| 399 STRING_INTERPOLATION_TOKEN); | 395 STRING_INTERPOLATION_TOKEN); |
| 400 | 396 |
| 401 final PrecedenceInfo HEXADECIMAL_INFO = | 397 final PrecedenceInfo HEXADECIMAL_INFO = |
| 402 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); | 398 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); |
| 403 | 399 |
| 404 // For reporting lexical errors. | 400 // For reporting lexical errors. |
| 405 final PrecedenceInfo ERROR_INFO = | 401 final PrecedenceInfo ERROR_INFO = |
| 406 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); | 402 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); |
| OLD | NEW |