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; |
} |