Commit Graph

73 Commits

Author SHA1 Message Date
dbc2d02895 [cpp] Add custom CppCharStream for line continuation support
Fixes #448
2017-07-07 22:46:21 +02:00
7f1292b212 Update version to 6.0.0-SNAPSHOT 2017-06-24 22:29:36 +02:00
f3b9231b69 [maven-release-plugin] prepare for next development iteration 2017-06-24 22:26:42 +02:00
6dd0bc8bfd [maven-release-plugin] prepare release pmd_releases/5.8.0 2017-06-24 22:26:34 +02:00
0f9a4a97c0 cpp: skip line continuation character in grammar
Fixes #431

Note: the tokens separate by such continuation characters are not
merged and appear as two separate tokens, which could lead to false
negatives in duplication detection.

ContinuationReader is deleted, since skipping characters in the stream
makes it difficult to provide accurate line numbers/positions.
2017-06-17 12:42:13 +02:00
2c861a2f6c cpp: add missing "finally" token, move ID Token to beginning of file 2017-06-17 12:27:47 +02:00
1e64c0d864 [maven-release-plugin] prepare for next development iteration 2017-05-20 22:35:55 +02:00
9b70c1a0d1 [maven-release-plugin] prepare release pmd_releases/5.7.0 2017-05-20 22:35:46 +02:00
0d0134b4fd Change version to 5.7.0-SNAPSHOT 2017-04-29 20:27:03 +02:00
7373b040c9 [maven-release-plugin] prepare for next development iteration 2017-04-29 20:20:16 +02:00
65a18787e9 [maven-release-plugin] prepare release pmd_releases/5.6.1 2017-04-29 20:20:07 +02:00
d4edeefa63 [maven-release-plugin] prepare for next development iteration 2017-04-22 13:20:12 +02:00
38fb34dc17 [maven-release-plugin] prepare release pmd_releases/5.6.0 2017-04-22 13:20:03 +02:00
d92688a07d Introduce end-of-line normalization
References pmd/build-tools#2
2017-02-02 20:52:08 +01:00
e280151987 pmd-cpp/pmd-java: checkstyle fixes 2016-12-16 15:48:53 +01:00
edcd4e5ccb pmd-cpp: checkstyle, formatting 2016-12-02 09:18:02 +01:00
35605a5801 Change version to 5.6.0-SNAPSHOT on master 2016-11-06 17:38:37 +01:00
5f13cc20e9 [maven-release-plugin] prepare for next development iteration 2016-11-05 11:02:08 +01:00
96fffcaadd [maven-release-plugin] prepare release pmd_releases/5.5.2 2016-11-05 11:02:08 +01:00
6746b7522c [maven-release-plugin] prepare for next development iteration 2016-07-27 20:40:56 +02:00
cc3ad9aeb7 [maven-release-plugin] prepare release pmd_releases/5.5.1 2016-07-27 20:40:56 +02:00
ef2a97d267 [maven-release-plugin] prepare for next development iteration 2016-06-25 17:53:11 +02:00
64d9ef96fc [maven-release-plugin] prepare release pmd_releases/5.5.0 2016-06-25 17:53:10 +02:00
ea7669ee92 Merge branch 'pr-27' 2016-01-07 10:56:59 +01:00
a33e83addc Merge branch 'tiobe/raw-CPP11-literals' of https://github.com/tiobe/pmd into pr-27 2016-01-07 10:55:27 +01:00
c099d50397 Added support for Raw String Literals (C++11). 2015-12-10 16:15:40 +01:00
83eceab455 [maven-release-plugin] prepare for next development iteration 2015-12-04 19:15:01 +01:00
c141c91612 [maven-release-plugin] prepare release pmd_releases/5.3.6 2015-12-04 19:15:01 +01:00
9f74721ae7 Prepare next dev version on master branch: 5.5.0-SNAPSHOT 2015-10-04 16:10:33 +02:00
d5bf509758 [maven-release-plugin] prepare for next development iteration 2015-10-04 14:39:14 +02:00
c21763a5e7 [maven-release-plugin] prepare release pmd_releases/5.4.0 2015-10-04 14:39:13 +02:00
af9f9d477d [maven-release-plugin] prepare for next development iteration 2015-10-04 12:48:25 +02:00
f357da73b6 [maven-release-plugin] prepare release pmd_releases/5.3.5 2015-10-04 12:48:25 +02:00
819611dd23 [maven-release-plugin] prepare for next development iteration 2015-09-18 12:36:07 +02:00
0ffbe97a04 [maven-release-plugin] prepare release pmd_releases/5.3.4 2015-09-18 12:36:06 +02:00
0671c2e478 [maven-release-plugin] prepare for next development iteration 2015-07-25 15:28:23 +02:00
1348ed8e06 [maven-release-plugin] prepare release pmd_releases/5.3.3 2015-07-25 15:28:22 +02:00
793af091c0 [maven-release-plugin] prepare for next development iteration 2015-05-22 18:23:42 +02:00
2c99fbd5e5 [maven-release-plugin] prepare release pmd_releases/5.3.2 2015-05-22 18:23:41 +02:00
a720b93431 [maven-release-plugin] prepare for next development iteration 2015-04-20 20:15:12 +02:00
de7a81202f [maven-release-plugin] prepare release pmd_releases/5.3.1 2015-04-20 20:15:11 +02:00
c44a89cce3 [maven-release-plugin] prepare for next development iteration 2015-04-01 20:06:39 +02:00
094c9c0ec9 [maven-release-plugin] prepare release pmd_releases/5.3.0 2015-04-01 20:06:38 +02:00
5c2f6bc962 [maven-release-plugin] prepare for next development iteration 2015-04-01 19:57:15 +02:00
dd6affeb6e Use new pmd-build plugin, adjust some rule documentation for markdown changes 2015-03-15 14:59:55 +01:00
5ae01d2d3e Up version to 5.3.0-SNAPSHOT 2015-01-18 12:19:52 +01:00
c92dc9706c Relaxed C++ tokenizer so a '\'(backslash) can be use to escape any character inside a string or character.
The following 2 code snippets could not be tokenized:

1:  if (*pbuf == '\0x05'), the problem is the '\0' in the character
literal '\0x05'.
2:  szPath = m_sdcacheDir + _T("\    oMedia");, the problem is the '\ '
in the string literal "\    oMedia".

I relaxed the lexical grammar so a '\' (backslash) can escape any
character inside a string or character literal. We can relax the grammar
because CPD only needs the tokens, so it is no problem to accept
'invalid' string / character literals. (according to the ANSI C
standard).  Failing too fast because the tokenizer is too strict is
annoying because then we can't check the files for duplicated code.

Both snippets were taken from existing projects and be successfully
compiled, so for some C / C++ compilers it is valid code.
2015-01-13 11:36:54 +01:00
d830974842 Fixed lexical error when a C++ file contains an empty character literal L''.
This commit fixes a lexical error when a C++ file contains an empty
character literal L''. The following code could not be tokenized:

std::wstring wsMessage( sMessage.length(), L'');

It triggers the following error:

net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file
'foo.cpp' at line 1, column 46.  Encountered: "\'" (39), after : "\'"
2015-01-13 11:36:54 +01:00
ceef6cd236 Fixed lexical eror when a preprocessor directive is followed by a single line comment that starts with "//*".
This commit fixes a lexical eror when a preprocessor directive is
followed by a single line comment that starts with "//*".

The following code could not be tokenized:

#define LSTFVLES_CPP  //*

It triggers the following error:

net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file
'foo.cpp' at line 2, column 0.  Encountered: <EOF> after : ""
2015-01-13 11:36:53 +01:00
5c2df4c877 Fixed lexical error when a C++ file contains ASM with the '@' character.
This commit fixes a lexical error when a C++ file contains ASM with the
'@' character. The following code cannot be tokenized and triggers a
lexical error:

asm void eSPI_boot()
{
// setup stack pointer
lis r1, _stack_addr@h
ori r1, r1, _stack_addr@l
}

The error that occurs:

net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file
CODE_LOADED_FROM_STRING at line 4, column 22.  Encountered: "@" (64),
after : ""
2015-01-13 11:36:53 +01:00