Convert CharStream to class
This commit is contained in:
@ -13,8 +13,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import net.sourceforge.pmd.PMD;
|
||||
import net.sourceforge.pmd.cpd.internal.JavaCCTokenizer;
|
||||
import net.sourceforge.pmd.lang.TokenManager;
|
||||
import net.sourceforge.pmd.lang.ast.CharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.io.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument;
|
||||
import net.sourceforge.pmd.lang.cpp.ast.CppEscapeReader;
|
||||
|
@ -8,7 +8,7 @@ import static java.lang.Integer.min;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.impl.io.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.util.document.Chars;
|
||||
|
||||
public class CppEscapeReader extends EscapeAwareReader {
|
||||
|
@ -11,15 +11,14 @@ import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.junit.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.CharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.io.NewCharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream;
|
||||
import net.sourceforge.pmd.util.document.TextDocument;
|
||||
|
||||
public class CppCharStreamTest {
|
||||
|
||||
@NonNull
|
||||
public CharStream charStreamFor(String source) throws IOException {
|
||||
return NewCharStream.open(new CPPTokenizer().newTokenDoc(TextDocument.readOnlyString(source)));
|
||||
return CharStream.create(new CPPTokenizer().newTokenDoc(TextDocument.readOnlyString(source)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user