Merge branch 'cpd-language-go' of https://github.com/oinume/pmd into oinume-cpd-language-go

This commit is contained in:
Andreas Dangel 2014-10-12 19:57:41 +02:00
commit e8fadec7de
3 changed files with 44 additions and 0 deletions

2
.gitignore vendored
View File

@ -6,6 +6,8 @@ bin/
.pmd
.ruleset
.settings/
*.iml
.idea
*.patch
pmd-java/src/site/site.xml
pmd-javascript/src/site/site.xml

View 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");
}
}

View 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>();
}
}