Convert CharStream to class

This commit is contained in:
Clément Fournier
2020-04-18 12:50:34 +02:00
parent d3de455ede
commit 95bac5eb95
35 changed files with 118 additions and 169 deletions

View File

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

View File

@ -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 {

View File

@ -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