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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java

Issue 9692002: Step back and remove more getNode() invocations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
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));
}
}

Powered by Google App Engine
This is Rietveld 408576698