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

Side by Side Diff: lib/compiler/implementation/code_buffer.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month 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
OLDNEW
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 class CodeBuffer implements StringBuffer { 5 class CodeBuffer implements StringBuffer {
6 StringBuffer buffer; 6 StringBuffer buffer;
7 List<CodeBufferMarker> markers; 7 List<CodeBufferMarker> markers;
8 int lastBufferOffset = 0; 8 int lastBufferOffset = 0;
9 int mappedRangeCounter = 0; 9 int mappedRangeCounter = 0;
10 10
11 CodeBuffer() 11 CodeBuffer()
12 : buffer = new StringBuffer(), 12 : buffer = new StringBuffer(),
13 markers = new List<CodeBufferMarker>(); 13 markers = new List<CodeBufferMarker>();
14 14
15 int get length => buffer.length; 15 int get length => buffer.length;
16 16
17 bool isEmpty() { 17 bool get isEmpty {
18 return buffer.isEmpty(); 18 return buffer.isEmpty;
19 } 19 }
20 20
21 /** 21 /**
22 * Converts [object] to a string and adds it to the buffer. If [object] is a 22 * Converts [object] to a string and adds it to the buffer. If [object] is a
23 * [CodeBuffer], adds its markers to [markers]. 23 * [CodeBuffer], adds its markers to [markers].
24 */ 24 */
25 CodeBuffer add(var object) { 25 CodeBuffer add(var object) {
26 if (object is CodeBuffer) { 26 if (object is CodeBuffer) {
27 return addBuffer(object); 27 return addBuffer(object);
28 } 28 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 }); 91 });
92 } 92 }
93 } 93 }
94 94
95 class CodeBufferMarker { 95 class CodeBufferMarker {
96 final int offsetDelta; 96 final int offsetDelta;
97 final sourcePosition; 97 final sourcePosition;
98 98
99 CodeBufferMarker(this.offsetDelta, this.sourcePosition); 99 CodeBufferMarker(this.offsetDelta, this.sourcePosition);
100 } 100 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/closure.dart ('k') | lib/compiler/implementation/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698