forked from phoedos/pmd
Changed javascript to ecmascript.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7024 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
parent
b937b65558
commit
79ef486724
@ -5,18 +5,18 @@ package test.net.sourceforge.pmd.cpd;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import net.sourceforge.pmd.PMD;
|
||||
import net.sourceforge.pmd.cpd.JavascriptTokenizer;
|
||||
import net.sourceforge.pmd.cpd.EcmascriptTokenizer;
|
||||
import net.sourceforge.pmd.cpd.SourceCode;
|
||||
import net.sourceforge.pmd.cpd.Tokenizer;
|
||||
import net.sourceforge.pmd.cpd.Tokens;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class JavascriptTokenizerTest {
|
||||
public class EcmascriptTokenizerTest {
|
||||
|
||||
@Test
|
||||
public void test1() throws Throwable {
|
||||
Tokenizer tokenizer = new JavascriptTokenizer();
|
||||
Tokenizer tokenizer = new EcmascriptTokenizer();
|
||||
SourceCode sourceCode = new SourceCode( new SourceCode.StringCodeLoader( getCode1() ) );
|
||||
Tokens tokens = new Tokens();
|
||||
tokenizer.tokenize( sourceCode, tokens );
|
||||
@ -25,7 +25,7 @@ public class JavascriptTokenizerTest {
|
||||
|
||||
@Test
|
||||
public void test2() throws Throwable {
|
||||
Tokenizer t = new JavascriptTokenizer();
|
||||
Tokenizer t = new EcmascriptTokenizer();
|
||||
SourceCode sourceCode = new SourceCode( new SourceCode.StringCodeLoader( getCode2() ) );
|
||||
Tokens tokens = new Tokens();
|
||||
t.tokenize( sourceCode, tokens );
|
||||
@ -59,6 +59,6 @@ public class JavascriptTokenizerTest {
|
||||
}
|
||||
|
||||
public static junit.framework.Test suite() {
|
||||
return new junit.framework.JUnit4TestAdapter( JavascriptTokenizerTest.class );
|
||||
return new junit.framework.JUnit4TestAdapter( EcmascriptTokenizerTest.class );
|
||||
}
|
||||
}
|
@ -4,8 +4,8 @@
|
||||
*/
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
public class JavascriptLanguage extends AbstractLanguage {
|
||||
public JavascriptLanguage() {
|
||||
super(new JavascriptTokenizer(), ".js");
|
||||
public class EcmascriptLanguage extends AbstractLanguage {
|
||||
public EcmascriptLanguage() {
|
||||
super(new EcmascriptTokenizer(), ".js");
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import java.util.ArrayList;
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
public class JavascriptTokenizer extends AbstractTokenizer {
|
||||
public JavascriptTokenizer() {
|
||||
public class EcmascriptTokenizer extends AbstractTokenizer {
|
||||
public EcmascriptTokenizer() {
|
||||
// setting markers for "string" in javascript
|
||||
this.stringToken = new ArrayList<String>();
|
||||
this.stringToken.add( "\'" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user