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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/DartASTValidator.java

Issue 9651004: Make SourceInfo a class, rename its menthods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for formatting, lazily create LainesInfo 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/javatests/com/google/dart/compiler/parser/DartASTValidator.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/DartASTValidator.java b/compiler/javatests/com/google/dart/compiler/parser/DartASTValidator.java
index abd626e15a6dca452e1ecf0eae9963b99b418c1e..cb11a9407a2b4298cd9622fa3944259ae15bee16 100755
--- a/compiler/javatests/com/google/dart/compiler/parser/DartASTValidator.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/DartASTValidator.java
@@ -101,13 +101,13 @@ public class DartASTValidator extends ASTVisitor<Void> {
if (nodes != null) {
int previousEnd = -1;
for (DartNode node : nodes) {
- int start = node.getSourceStart();
+ int start = node.getSourceInfo().getOffset();
if (start <= previousEnd) {
errors.add("Node starts (" + start + ") before previous sibling's end (" + previousEnd
+ ") or nodes are not in source order");
}
node.accept(this);
- previousEnd = start + node.getSourceLength() - 1;
+ previousEnd = start + node.getSourceInfo().getLength() - 1;
}
}
}
@@ -599,16 +599,16 @@ public class DartASTValidator extends ASTVisitor<Void> {
errors.add("No parent for " + node.getClass().getName());
}
- int nodeStart = node.getSourceStart();
- int nodeLength = node.getSourceLength();
+ int nodeStart = node.getSourceInfo().getOffset();
+ int nodeLength = node.getSourceInfo().getLength();
if (nodeStart < 0 || nodeLength < 0) {
errors.add("No source info for " + node.getClass().getName());
}
if (parent != null) {
int nodeEnd = nodeStart + nodeLength;
- int parentStart = parent.getSourceStart();
- int parentEnd = parentStart + parent.getSourceLength();
+ int parentStart = parent.getSourceInfo().getOffset();
+ int parentEnd = parentStart + parent.getSourceInfo().getLength();
if (parentStart > nodeStart) {
errors.add("Invalid source start (" + nodeStart + ") for "
+ node.getClass().getName() + " inside "

Powered by Google App Engine
This is Rietveld 408576698