| Index: lib/compiler/implementation/code_buffer.dart
|
| diff --git a/lib/compiler/implementation/code_buffer.dart b/lib/compiler/implementation/code_buffer.dart
|
| index 3c3053e429942e4cfa4f7018efbf1998d6576e7b..02c04d9607c3e94c1a7ef93ff00fa8873bc1a186 100644
|
| --- a/lib/compiler/implementation/code_buffer.dart
|
| +++ b/lib/compiler/implementation/code_buffer.dart
|
| @@ -6,6 +6,7 @@ class CodeBuffer implements StringBuffer {
|
| StringBuffer buffer;
|
| List<SourceLocation> sourceLocations;
|
| int lastBufferOffset = 0;
|
| + int mappedRangeCounter = 0;
|
|
|
| CodeBuffer()
|
| : buffer = new StringBuffer(),
|
| @@ -25,6 +26,7 @@ class CodeBuffer implements StringBuffer {
|
| if (object is CodeBuffer) {
|
| return addBuffer(object);
|
| }
|
| + if (mappedRangeCounter == 0) setSourceLocation(null, null);
|
| buffer.add(object.toString());
|
| return this;
|
| }
|
| @@ -67,6 +69,15 @@ class CodeBuffer implements StringBuffer {
|
| return buffer.toString();
|
| }
|
|
|
| + void beginMappedRange() {
|
| + ++mappedRangeCounter;
|
| + }
|
| +
|
| + void endMappedRange() {
|
| + assert(mappedRangeCounter > 0);
|
| + --mappedRangeCounter;
|
| + }
|
| +
|
| void setSourceLocation(Element element, Token token) {
|
| int offsetDelta = buffer.length - lastBufferOffset;
|
| sourceLocations.add(new SourceLocation(element, token, offsetDelta));
|
|
|