Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: frog/leg/tools/mini_parser.dart

Issue 8883017: Split File into File and RandomAccessFile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/leg/scanner/vm_scanner_bench.dart ('k') | runtime/bin/file.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #library('parser'); 5 #library('parser');
6 6
7 #import('../scanner/scanner_implementation.dart'); 7 #import('../scanner/scanner_implementation.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 9
10 #source('../../source.dart'); 10 #source('../../source.dart');
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 stringStream.lineHandler = () { 109 stringStream.lineHandler = () {
110 String line; 110 String line;
111 while ((line = stringStream.readLine()) !== null) { 111 while ((line = stringStream.readLine()) !== null) {
112 lineHandler(line); 112 lineHandler(line);
113 } 113 }
114 }; 114 };
115 stringStream.closeHandler = closeHandler; 115 stringStream.closeHandler = closeHandler;
116 } 116 }
117 117
118 List<int> read(String filename) { 118 List<int> read(String filename) {
119 File file = new File(filename); 119 File file = new File(filename).openSync();
120 file.openSync();
121 bool threw = true; 120 bool threw = true;
122 try { 121 try {
123 int size = file.lengthSync(); 122 int size = file.lengthSync();
124 List<int> bytes = new List<int>(size + 1); 123 List<int> bytes = new List<int>(size + 1);
125 file.readListSync(bytes, 0, size); 124 file.readListSync(bytes, 0, size);
126 bytes[size] = $EOF; 125 bytes[size] = $EOF;
127 threw = false; 126 threw = false;
128 return bytes; 127 return bytes;
129 } finally { 128 } finally {
130 try { 129 try {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 String _GREEN_COLOR = '\u001b[32m'; 193 String _GREEN_COLOR = '\u001b[32m';
195 String _RED_COLOR = '\u001b[31m'; 194 String _RED_COLOR = '\u001b[31m';
196 String _MAGENTA_COLOR = '\u001b[35m'; 195 String _MAGENTA_COLOR = '\u001b[35m';
197 String _NO_COLOR = '\u001b[0m'; 196 String _NO_COLOR = '\u001b[0m';
198 197
199 class Mock { 198 class Mock {
200 const Mock(); 199 const Mock();
201 bool get useColors() => true; 200 bool get useColors() => true;
202 internalError(message) { throw message.toString(); } 201 internalError(message) { throw message.toString(); }
203 } 202 }
OLDNEW
« no previous file with comments | « frog/leg/scanner/vm_scanner_bench.dart ('k') | runtime/bin/file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698