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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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 part of dart2js; 5 part of dart2js;
6 6
7 class CodeBuffer implements StringBuffer { 7 class CodeBuffer implements StringBuffer {
8 StringBuffer buffer; 8 StringBuffer buffer;
9 List<CodeBufferMarker> markers; 9 List<CodeBufferMarker> markers;
10 int lastBufferOffset = 0; 10 int lastBufferOffset = 0;
(...skipping 30 matching lines...) Expand all
41 markers.add(new CodeBufferMarker(offsetDelta, 41 markers.add(new CodeBufferMarker(offsetDelta,
42 firstMarker.sourcePosition)); 42 firstMarker.sourcePosition));
43 for (int i = 1; i < other.markers.length; ++i) { 43 for (int i = 1; i < other.markers.length; ++i) {
44 markers.add(other.markers[i]); 44 markers.add(other.markers[i]);
45 } 45 }
46 lastBufferOffset = buffer.length + other.lastBufferOffset; 46 lastBufferOffset = buffer.length + other.lastBufferOffset;
47 } 47 }
48 buffer.add(other.getText()); 48 buffer.add(other.getText());
49 } 49 }
50 50
51 CodeBuffer addAll(Collection<Object> objects) { 51 CodeBuffer addAll(Iterable<Object> iterable) {
52 for (Object obj in objects) { 52 for (Object obj in iterable) {
53 add(obj); 53 add(obj);
54 } 54 }
55 return this; 55 return this;
56 } 56 }
57 57
58 CodeBuffer addCharCode(int charCode) { 58 CodeBuffer addCharCode(int charCode) {
59 return add(new String.fromCharCodes([charCode])); 59 return add(new String.fromCharCodes([charCode]));
60 } 60 }
61 61
62 CodeBuffer clear() { 62 CodeBuffer clear() {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 }); 97 });
98 } 98 }
99 } 99 }
100 100
101 class CodeBufferMarker { 101 class CodeBufferMarker {
102 final int offsetDelta; 102 final int offsetDelta;
103 final sourcePosition; 103 final sourcePosition;
104 104
105 CodeBufferMarker(this.offsetDelta, this.sourcePosition); 105 CodeBufferMarker(this.offsetDelta, this.sourcePosition);
106 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698