67 Commits

Author SHA1 Message Date
Andreas Dangel
3a7460de29 [lang-test] Move classes into n.s.p.lang.test 2024-02-23 17:46:23 +01:00
Andreas Dangel
6163f67b06 [core] Rename Tokenizer to CpdLexer
See #4065
2024-01-11 17:04:48 +01:00
Andreas Dangel
32afa53f8e All language modules: getInstance()
Use a consistent implementation of getInstance().
Now all modules resolve against the LanguageRegistry.
2023-08-24 16:01:27 +02:00
Clément Fournier
c572cb88d7 Rename package cpd.internal to cpd.impl 2023-02-13 15:18:37 +01:00
Clément Fournier
ddbfc90c14 Fix build 2023-02-12 20:06:28 +01:00
Clément Fournier
add597026c Don't forget EOF token 2023-02-12 15:28:34 +01:00
Clément Fournier
cf81809990 Change a ton of stuff in CPD 2023-02-10 18:21:23 +01:00
Clément Fournier
d4c05d1fb5 Make pmd language have a hook to launch CPD
This allows removing the CPD language instances,
sharing more logic between CPD and PMD, and using
language properties to configure CPD and PMD uniformly.
2023-02-10 16:45:52 +01:00
Andreas Dangel
c23ecab2c6 Make test classes and methods package-private 2023-01-17 15:41:31 +01:00
Andreas Dangel
bc7a45699f Merge branch 'pmd/7.0.x' into pmd7-junit5-part2 2022-09-12 19:34:11 +02:00
Andreas Dangel
cded733c9b [matlab] Migrate tests to Junit5 2022-07-29 17:24:46 +02:00
Clément Fournier
155a895a93 Move charstream 2020-09-17 22:54:20 +02:00
Clément Fournier
e93e5b0a4c Move into .io package 2020-09-17 22:43:29 +02:00
Clément Fournier
95bac5eb95 Convert CharStream to class 2020-09-17 22:41:16 +02:00
Clément Fournier
7384fd6fb2 Merge branch 'master' into 7.0.x 2020-08-28 14:58:10 +02:00
XenoAmess
244a39db0f fix typos. 2020-08-27 11:47:11 +08:00
Andreas Dangel
2b1d071930 Fix tests due to endColumn changes 2020-08-21 12:38:37 +02:00
Andreas Dangel
ab489832fe Merge branch 'master' into pmd/7.0.x 2020-08-21 11:51:54 +02:00
Maikel Steneker
6fb5ac59b9 Ensure CPD uses tab width of 1 for tabs consistently
The columns that are reported by CPD were inconsistent across languages
before. A language like Java (using a JavaCC-based tokenizer) would use
a width of 8 for tabs, whereas a language like C# (using an Antlr-based
tokenizer) would use 1 instead.

This includes unit tests for most languages to ensure a tab character is
counted as 1. The configuration for JavaCC has been adjusted to respect
this as well.
2020-07-20 10:42:21 +02:00
Andreas Dangel
e4690cb56a Fix compile errors for CPD only languages 2020-07-17 15:04:43 +02:00
Clément Fournier
5b7ed588ea Make CPD end column exclusive
This is to align it with PMD columns,
which in 7.0 are already exclusive.
2020-06-19 02:21:45 +02:00
Clément Fournier
c49d9e315f Merge branch 'master' into 7.0.x 2020-06-19 01:32:32 +02:00
Clément Fournier
60d028a282 Convert matlab tests 2020-06-13 23:39:35 +02:00
Clément Fournier
96feed7b83 Do it for the other languages 2020-03-20 18:07:56 +01:00
Clément Fournier
368573e7c7 Start removing TokenManager wrappers 2020-03-20 18:07:56 +01:00
Clément Fournier
3cdcba2299 Fix file name for token manager error 2020-03-20 18:07:56 +01:00
Clément Fournier
925c22472e Port Matlab cpd module 2020-03-17 17:04:14 +01:00
Clément Fournier
903383d7cf Merge branch 'master' into 7.0.x 2020-03-17 15:14:46 +01:00
Clément Fournier
138c0e3e86 Deprecate tokManagers for more module 2020-03-17 15:08:58 +01:00
Clément Fournier
ec1eb208eb Merge branch 'master' into 7.0.x 2020-01-24 23:48:22 +01:00
Clément Fournier
d90d5d267c Remove trailing whitespace everywhere 2020-01-24 23:40:06 +01:00
Andreas Dangel
b02ab00e87 Merge remote-tracking branch 'origin/master' into pmd/7.0.x 2020-01-24 19:18:17 +01:00
Andreas Dangel
5feca7fd93 Exclude generated AST*.java files from internalization 2020-01-24 16:19:24 +01:00
Clément Fournier
60e97d0ec8 Deprecate javacc generated code 2020-01-22 17:19:29 +01:00
Clément Fournier
99700d7526 Extract changes from #2166 to 7.0.x
* Make Java nodes text-available
* Introduce shared JavaccToken in pmd-core
* Use factory to produce char streams

Tests are still on java-grammar,
since they use the DSL & newer
AST structure.

This is to prepare for other changes
that concern all javacc languages and
should not be done on java-grammar
2020-01-10 21:15:15 +01:00
Clément Fournier
1fe9c59212 Remove cpp lang 2019-09-24 06:15:34 +02:00
Clément Fournier
5343a7674b Merge branch 'master' into 7.0.x
Fix conflicts with Apex CC category properties
2019-05-18 16:13:43 +02:00
Andreas Dangel
465b303f3c Merge branch 'pr-1822' 2019-05-12 16:19:29 +02:00
Andreas Dangel
7b871ddaf9 Merge branch 'pr-1821' 2019-05-12 16:16:05 +02:00
Andreas Dangel
1f02f5ff7f Update release notes, refs #1821 2019-05-12 16:13:57 +02:00
Andreas Dangel
93050a2c7f Improve unit test 2019-05-12 16:06:23 +02:00
Maikel Steneker
1c1c2d87f7 Added unit test for double-quoted string in Matlab. 2019-05-10 17:16:17 +02:00
Maikel Steneker
f76ac0aa89 Added unit test for question mark (?) token in Matlab tokenizer. 2019-05-10 16:27:37 +02:00
Maikel Steneker
224c3931e4 Added unit tests for block comments. 2019-05-10 16:10:03 +02:00
Maikel Steneker
1a6a19aaaa Added test case for failing Matlab file. 2019-05-08 12:04:57 +02:00
Clément Fournier
6d84530d52 Merge branch 'master' into 7.0.x 2019-02-18 19:32:55 +01:00
Andreas Dangel
89c8f47b2b Move JavaCCTokenizer to internal package 2019-01-26 19:19:46 +01:00
Andreas Dangel
08b7dd49dd [core] Add a generic JavaCCTokenizer for CPD 2019-01-26 11:24:32 +01:00
Andreas Dangel
b745f331b8 CPD: Fix error handling for lexical errors
* TokenMgrError must not be caught by the tokenizer. This is handled
  by CPD itself
* The token managers need to know the filename for proper error messages
2019-01-20 10:18:56 +01:00
Clément Fournier
12b647c548 Merge branch 'master' into 7.0.x
Conflicts:
	pmd-apex-jorje/pom.xml
	pmd-apex/pom.xml
	pmd-core/pom.xml
	pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java
	pmd-core/src/main/java/net/sourceforge/pmd/util/designer/Designer.java
	pmd-cpp/pom.xml
	pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppHandler.java
	pmd-cs/pom.xml
	pmd-dist/pom.xml
	pmd-doc/pom.xml
	pmd-fortran/pom.xml
	pmd-go/pom.xml
	pmd-groovy/pom.xml
	pmd-java/pom.xml
	pmd-java8/pom.xml
	pmd-javascript/pom.xml
	pmd-jsp/pom.xml
	pmd-kotlin/pom.xml
	pmd-lang-test/pom.xml
	pmd-matlab/pom.xml
	pmd-matlab/src/main/java/net/sourceforge/pmd/lang/matlab/MatlabHandler.java
	pmd-objectivec/pom.xml
	pmd-objectivec/src/main/java/net/sourceforge/pmd/lang/objectivec/ObjectiveCHandler.java
	pmd-perl/pom.xml
	pmd-php/pom.xml
	pmd-plsql/pom.xml
	pmd-python/pom.xml
	pmd-python/src/main/java/net/sourceforge/pmd/lang/python/PythonHandler.java
	pmd-ruby/pom.xml
	pmd-scala/pom.xml
	pmd-swift/pom.xml
	pmd-test/pom.xml
	pmd-ui/pom.xml
	pmd-visualforce/pom.xml
	pmd-vm/pom.xml
	pmd-xml/pom.xml
	pom.xml
2018-12-13 18:53:10 +01:00