[gherkin] Migrate to PMD 7

This commit is contained in:
Andreas Dangel 2022-07-01 15:09:46 +02:00
parent c79db6e5f3
commit a7340fce4c
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3
4 changed files with 575 additions and 581 deletions

View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd</artifactId>
<version>6.48.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -6,10 +6,9 @@ package net.sourceforge.pmd.lang.gherkin.cpd;
import org.antlr.v4.runtime.CharStream;
import net.sourceforge.pmd.cpd.AntlrTokenizer;
import net.sourceforge.pmd.cpd.SourceCode;
import net.sourceforge.pmd.cpd.token.AntlrTokenFilter;
import net.sourceforge.pmd.lang.antlr.AntlrTokenManager;
import net.sourceforge.pmd.cpd.internal.AntlrTokenizer;
import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTokenManager;
import net.sourceforge.pmd.lang.gherkin.ast.GherkinLexer;
/**
@ -22,9 +21,4 @@ public class GherkinTokenizer extends AntlrTokenizer {
CharStream charStream = AntlrTokenizer.getCharStreamFromSourceCode(sourceCode);
return new AntlrTokenManager(new GherkinLexer(charStream), sourceCode.getFileName());
}
@Override
protected AntlrTokenFilter getTokenFilter(final AntlrTokenManager tokenManager) {
return new AntlrTokenFilter(tokenManager);
}
}

View File

@ -1,15 +1,15 @@
[Image] or [Truncated image[ Bcol Ecol
L1
[Given] 1 5
[I] 7 7
[have] 9 12
[a] 14 14
[lot] 16 18
[to] 20 21
[say:] 23 26
[\n] 27 27
[Given] 1 6
[I] 7 8
[have] 9 13
[a] 14 15
[lot] 16 19
[to] 20 22
[say:] 23 27
[\n] 27 28
L2
["""\n One\n Two\n Three\n """] 1 4
["""\n One\n Two\n Three\n """] 1 5
L6
[\n] 5 5
[\n] 5 6
EOF