#1252 net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file xxx.cpp
This commit is contained in:
@ -133,6 +133,8 @@ PARSER_END(CppParser)
|
||||
|
||||
SKIP :
|
||||
{
|
||||
"\ufeff" // UTF Byte Order Mark
|
||||
|
|
||||
" "
|
||||
|
|
||||
"\f"
|
||||
|
@ -4,12 +4,20 @@
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import net.sourceforge.pmd.PMD;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CPPTokenizerTest {
|
||||
|
||||
@Test
|
||||
public void testUTFwithBOM() {
|
||||
Tokens tokens = parse("\ufeffint start()\n{ int ret = 1;\nreturn ret;\n}\n");
|
||||
assertTrue(TokenEntry.getEOF() != tokens.getTokens().get(0));
|
||||
assertEquals(15, tokens.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiLineMacros() throws Throwable {
|
||||
Tokens tokens = parse(TEST1);
|
||||
|
@ -11,5 +11,6 @@
|
||||
**Bugfixes:**
|
||||
|
||||
* [#550](https://sourceforge.net/p/pmd/bugs/550/): False +: MissingBreakInSwitch
|
||||
* [#1252](https://sourceforge.net/p/pmd/bugs/1252/): net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file xxx.cpp
|
||||
* [#1263](https://sourceforge.net/p/pmd/bugs/1263/): PMD reports CheckResultSet violation in completely unrelated source files.
|
||||
* [#1273](https://sourceforge.net/p/pmd/bugs/1273/): CheckResultSet false positive in try-with-resources nested in if
|
||||
|
Reference in New Issue
Block a user