| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #library('parser'); | 5 #library('parser'); |
| 6 | 6 |
| 7 #import('dart:io'); | 7 #import('dart:io'); |
| 8 | 8 |
| 9 #import('../../../utf/utf.dart'); | 9 #import('../../../utf/utf.dart'); |
| 10 | 10 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 bool readOnly = false; | 295 bool readOnly = false; |
| 296 bool buildAst = false; | 296 bool buildAst = false; |
| 297 } | 297 } |
| 298 | 298 |
| 299 class MySourceFile extends SourceFile { | 299 class MySourceFile extends SourceFile { |
| 300 final rawText; | 300 final rawText; |
| 301 var stringText; | 301 var stringText; |
| 302 | 302 |
| 303 MySourceFile(filename, this.rawText) : super(filename, null); | 303 MySourceFile(filename, this.rawText) : super(filename, null); |
| 304 | 304 |
| 305 String get text() { | 305 String get text { |
| 306 if (rawText is String) { | 306 if (rawText is String) { |
| 307 return rawText; | 307 return rawText; |
| 308 } else { | 308 } else { |
| 309 if (stringText === null) { | 309 if (stringText === null) { |
| 310 stringText = new String.fromCharCodes(rawText); | 310 stringText = new String.fromCharCodes(rawText); |
| 311 if (stringText.endsWith('\u0000')) { | 311 if (stringText.endsWith('\u0000')) { |
| 312 // Strip trailing NUL used by ByteArrayScanner to signal EOF. | 312 // Strip trailing NUL used by ByteArrayScanner to signal EOF. |
| 313 stringText = stringText.substring(0, stringText.length - 1); | 313 stringText = stringText.substring(0, stringText.length - 1); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 return stringText; | 316 return stringText; |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 | 319 |
| 320 set text(String newText) { | 320 set text(String newText) { |
| 321 throw "not supported"; | 321 throw "not supported"; |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 class Mock { | 325 class Mock { |
| 326 const Mock(); | 326 const Mock(); |
| 327 bool get useColors() => true; | 327 bool get useColors => true; |
| 328 internalError(message) { throw message.toString(); } | 328 internalError(message) { throw message.toString(); } |
| 329 } | 329 } |
| OLD | NEW |