forked from phoedos/pmd
Merge branch 'cpd-language-go' of https://github.com/oinume/pmd into oinume-cpd-language-go
This commit is contained in:
commit
e8fadec7de
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,6 +6,8 @@ bin/
|
||||
.pmd
|
||||
.ruleset
|
||||
.settings/
|
||||
*.iml
|
||||
.idea
|
||||
*.patch
|
||||
pmd-java/src/site/site.xml
|
||||
pmd-javascript/src/site/site.xml
|
||||
|
15
pmd/src/main/java/net/sourceforge/pmd/cpd/GoLanguage.java
Normal file
15
pmd/src/main/java/net/sourceforge/pmd/cpd/GoLanguage.java
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
/**
|
||||
* GoLang
|
||||
*
|
||||
* @author oinume@gmail.com
|
||||
*/
|
||||
public class GoLanguage extends AbstractLanguage {
|
||||
public GoLanguage() {
|
||||
super(new GoTokenizer(), ".go");
|
||||
}
|
||||
}
|
27
pmd/src/main/java/net/sourceforge/pmd/cpd/GoTokenizer.java
Normal file
27
pmd/src/main/java/net/sourceforge/pmd/cpd/GoTokenizer.java
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* GoLang
|
||||
*
|
||||
* @author oinume@gmail.com
|
||||
*/
|
||||
public class GoTokenizer extends AbstractTokenizer {
|
||||
public GoTokenizer() {
|
||||
// setting markers for "string" in Go
|
||||
this.stringToken = new ArrayList<String>();
|
||||
this.stringToken.add("\"");
|
||||
this.stringToken.add("`");
|
||||
|
||||
// setting markers for 'ignorable character' in Go
|
||||
this.ignorableCharacter = new ArrayList<String>();
|
||||
this.ignorableCharacter.add(";");
|
||||
|
||||
// setting markers for 'ignorable string' in Go
|
||||
this.ignorableStmt = new ArrayList<String>();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user