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

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

Issue 10661022: Issue 3752. Support for @override annotations (as structured doc comments) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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/CPParserTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/CPParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/CPParserTest.java
index 4b09e7885549d206c466cbb1ba92a9e947d4f6fa..52edec25b4f5d6648844215ad7076d65420b633c 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/CPParserTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/CPParserTest.java
@@ -27,7 +27,13 @@ public class CPParserTest extends CompilerTestCase {
private static String[] EXPECTED002 = {"/*\n*\n //comment\nX Y"};
private String source;
- private CommentPreservingParser parser;
+
+
+ @Override
+ protected DartParser makeParser(Source src, String sourceCode, DartCompilerListener listener) {
+ source = sourceCode;
+ return super.makeParser(src, sourceCode, listener);
+ }
public void test001() {
DartUnit unit = parseUnit("Comments.dart");
@@ -40,25 +46,11 @@ public class CPParserTest extends CompilerTestCase {
compareComments(unit.getComments(), EXPECTED002);
}
- @Override
- protected DartParser makeParser(ParserContext context) {
- parser = new CommentPreservingParser(context, false);
- return parser;
- }
-
- @Override
- protected ParserContext makeParserContext(Source src, String sourceCode,
- DartCompilerListener listener) {
- this.source = sourceCode;
- return CommentPreservingParser.createContext(src, sourceCode, listener);
- }
-
private List<String> extractComments(List<DartComment> cms) {
List<String> comments = new ArrayList<String>();
for (DartComment cm : cms) {
SourceInfo sourceInfo = cm.getSourceInfo();
- comments.add(source.substring(sourceInfo.getOffset(), sourceInfo.getOffset()
- + sourceInfo.getLength()));
+ comments.add(source.substring(sourceInfo.getOffset(), sourceInfo.getEnd()));
}
return comments;
}

Powered by Google App Engine
This is Rietveld 408576698