Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java |
| diff --git a/compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java b/compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java |
| index 6e0750d054e1c5268bec1ca8422be5599f71b832..4c511706fa01670cef20d3afe898f6f674751918 100644 |
| --- a/compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java |
| +++ b/compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java |
| @@ -10,6 +10,7 @@ import com.google.dart.compiler.DartSource; |
| import com.google.dart.compiler.Source; |
| import com.google.dart.compiler.ast.DartUnit; |
| import com.google.dart.compiler.common.HasSourceInfo; |
| +import com.google.dart.compiler.common.HasSourceInfoSetter; |
| import com.google.dart.compiler.common.SourceInfo; |
| import com.google.dart.compiler.metrics.CompilerMetrics; |
| import com.google.dart.compiler.parser.DartScanner.State; |
| @@ -95,14 +96,14 @@ public class DartScannerParserContext implements ParserContext { |
| */ |
| private <T> void setSourcePosition(T result, DartScanner.Position startPos) { |
| if (result instanceof HasSourceInfo) { |
|
zundel
2012/03/12 19:42:31
instanceof HasSourceInfoSetter?
scheglov
2012/03/13 00:42:25
Done.
|
| - HasSourceInfo node = (HasSourceInfo) result; |
| + HasSourceInfoSetter hasSourceInfoSetter = (HasSourceInfoSetter) result; |
| int start = startPos.getPos(); |
| int end = getEndLocation().getPos(); |
| if (start != -1 && end < start) { |
| // handle 0-length tokens, including where there is trailing whitespace |
| end = start; |
| } |
| - node.setSourceInfo(new SourceInfo(source, start, end - start)); |
| + hasSourceInfoSetter.setSourceInfo(new SourceInfo(source, start, end - start)); |
| } |
| } |