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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/source/SourceRangeFactory.java

Issue 250823006: Translate parts of engine.services project. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move to pkg/analysis_services/ Created 6 years, 8 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/source/SourceRangeFactory.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/source/SourceRangeFactory.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/source/SourceRangeFactory.java
index 7b8563575f6dacdb6c9da2457765efba3b0d3373..dcd270b4937fd8439586e51e1801f904f777259c 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/source/SourceRangeFactory.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/utilities/source/SourceRangeFactory.java
@@ -18,6 +18,8 @@ import com.google.dart.engine.element.Element;
import com.google.dart.engine.element.ShowElementCombinator;
import com.google.dart.engine.error.AnalysisError;
import com.google.dart.engine.scanner.Token;
+import com.google.dart.engine.utilities.translation.DartName;
+import com.google.dart.engine.utilities.translation.DartOmit;
import java.util.List;
@@ -27,6 +29,7 @@ import java.util.List;
*
* @coverage dart.engine.utilities
*/
+@DartOmit
public class SourceRangeFactory {
/**
* @return the name {@link SourceRange} of the given {@link Element}.
@@ -38,6 +41,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at end of "a" and ends at end of "b".
*/
+ @DartName("rangeEndEnd")
public static SourceRange rangeEndEnd(AstNode a, AstNode b) {
int start = a.getEnd();
int end = b.getEnd();
@@ -47,6 +51,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at end of "a" and ends at "end".
*/
+ @DartName("rangeEndEnd")
public static SourceRange rangeEndEnd(AstNode a, int end) {
int start = a.getEnd();
return rangeStartEnd(start, end);
@@ -55,6 +60,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at end of "a" and ends at end of "b".
*/
+ @DartName("rangeEndEnd")
public static SourceRange rangeEndEnd(AstNode a, SourceRange b) {
int start = a.getEnd();
int end = b.getEnd();
@@ -64,6 +70,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at end of "a" and ends at end of "b".
*/
+ @DartName("rangeEndEnd")
public static SourceRange rangeEndEnd(SourceRange a, AstNode b) {
int start = a.getEnd();
int end = b.getEnd();
@@ -73,6 +80,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at end of "a" and ends at end of "b".
*/
+ @DartName("rangeEndEnd")
public static SourceRange rangeEndEnd(SourceRange a, SourceRange b) {
int start = a.getEnd();
int end = b.getEnd();
@@ -82,11 +90,13 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at the end of "startInfo" and has specified length.
*/
+ @DartName("rangeEndLength")
public static SourceRange rangeEndLength(AstNode a, int length) {
int start = a.getEnd();
return new SourceRange(start, length);
}
+ @DartName("rangeEndLength")
public static SourceRange rangeEndLength(SourceRange a, int length) {
int start = a.getOffset() + a.getLength();
return rangeStartLength(start, length);
@@ -95,6 +105,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at the end of "a" and ends at the start of "b".
*/
+ @DartName("rangeEndStart")
public static SourceRange rangeEndStart(AstNode a, AstNode b) {
int start = a.getEnd();
int end = b.getOffset();
@@ -104,6 +115,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at the end of "a" and ends "b".
*/
+ @DartName("rangeEndStart")
public static SourceRange rangeEndStart(AstNode a, int b) {
int start = a.getEnd();
return rangeStartEnd(start, b);
@@ -112,6 +124,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at end of "a" and ends at start of "b".
*/
+ @DartName("rangeEndStart")
public static SourceRange rangeEndStart(AstNode a, Token b) {
int start = a.getEnd();
int end = b.getOffset();
@@ -121,6 +134,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at the end of "a" and ends at the start of "b".
*/
+ @DartName("rangeEndStart")
public static SourceRange rangeEndStart(SourceRange a, SourceRange b) {
int start = a.getEnd();
int end = b.getOffset();
@@ -197,6 +211,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at end of "b".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(AstNode a, AstNode b) {
int start = a.getOffset();
int end = b.getEnd();
@@ -206,6 +221,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at "end".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(AstNode a, int end) {
int start = a.getOffset();
return rangeStartEnd(start, end);
@@ -214,6 +230,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at end of "b".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(AstNode a, Token b) {
int start = a.getOffset();
int end = b.getEnd();
@@ -223,11 +240,13 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at "start" and ends at end of "b".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(int start, AstNode b) {
int end = b.getEnd();
return new SourceRange(start, end - start);
}
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(int start, int end) {
return new SourceRange(start, end - start);
}
@@ -235,6 +254,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at end of "b".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(SourceRange a, AstNode b) {
int start = a.getOffset();
int end = b.getEnd();
@@ -244,6 +264,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at "end".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(SourceRange a, int end) {
int start = a.getOffset();
return rangeStartEnd(start, end);
@@ -252,6 +273,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at end of "b".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(SourceRange a, SourceRange b) {
int start = a.getOffset();
int end = b.getEnd();
@@ -261,6 +283,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at end of "b".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(Token a, AstNode b) {
int start = a.getOffset();
int end = b.getEnd();
@@ -270,11 +293,13 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at "end".
*/
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(Token a, int end) {
int start = a.getOffset();
return rangeStartEnd(start, end);
}
+ @DartName("rangeStartEnd")
public static SourceRange rangeStartEnd(Token a, Token b) {
int start = a.getOffset();
int end = b.getEnd();
@@ -284,15 +309,18 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and has given length.
*/
+ @DartName("rangeStartLength")
public static SourceRange rangeStartLength(AstNode a, int length) {
int start = a.getOffset();
return new SourceRange(start, length);
}
+ @DartName("rangeStartLength")
public static SourceRange rangeStartLength(int start, int length) {
return new SourceRange(start, length);
}
+ @DartName("rangeStartLength")
public static SourceRange rangeStartLength(SourceRange a, int length) {
return rangeStartLength(a.getOffset(), length);
}
@@ -300,6 +328,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at start of "b".
*/
+ @DartName("rangeStartStart")
public static SourceRange rangeStartStart(AstNode a, AstNode b) {
int start = a.getOffset();
int end = b.getOffset();
@@ -309,6 +338,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start "start" and ends at start of "b".
*/
+ @DartName("rangeStartStart")
public static SourceRange rangeStartStart(int start, AstNode b) {
int end = b.getOffset();
return rangeStartEnd(start, end);
@@ -317,6 +347,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at start of "b".
*/
+ @DartName("rangeStartStart")
public static SourceRange rangeStartStart(SourceRange a, AstNode b) {
int start = a.getOffset();
int end = b.getOffset();
@@ -326,6 +357,7 @@ public class SourceRangeFactory {
/**
* @return the {@link SourceRange} which start at start of "a" and ends at start of "b".
*/
+ @DartName("rangeStartStart")
public static SourceRange rangeStartStart(SourceRange a, SourceRange b) {
int start = a.getOffset();
int end = b.getOffset();
@@ -358,5 +390,4 @@ public class SourceRangeFactory {
public static SourceRange rangeWithBase(SourceRange base, SourceRange r) {
return rangeWithBase(base.getOffset(), r);
}
-
}

Powered by Google App Engine
This is Rietveld 408576698