View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.cpd;
5   
6   import java.util.ArrayList;
7   
8   public class EcmascriptTokenizer extends AbstractTokenizer {
9       public EcmascriptTokenizer() {
10          // setting markers for "string" in javascript
11          this.stringToken = new ArrayList<>();
12          this.stringToken.add( "\'" );
13          this.stringToken.add( "\"" );
14          
15          // setting markers for 'ignorable character' in javascript
16          this.ignorableCharacter = new ArrayList<>();
17          this.ignorableCharacter.add( ";" );
18  
19          // setting markers for 'ignorable string' in javascript
20          this.ignorableStmt = new ArrayList<>();
21  
22          // strings do indeed span multiple lines in javascript
23          this.spanMultipleLinesString = true;
24          // the lines do to end with backslashes
25          this.spanMultipleLinesLineContinuationCharacter = '\\';
26      }
27  }