intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.js.core / src / net / sourceforge / phpeclipse / js / core / parser / JSWordDetector.java
1 /*
2  * Created on May 13, 2003
3  *========================================================================
4  * Modifications history
5  *========================================================================
6  * $Log: not supported by cvs2svn $
7  * Revision 1.1  2004/02/26 02:25:42  agfitzp
8  * renamed packages to match xml & css
9  *
10  * Revision 1.1  2004/02/05 03:10:08  agfitzp
11  * Initial Submission
12  *
13  * Revision 1.1.2.1  2003/12/12 21:37:24  agfitzp
14  * Experimental work for Classes view
15  *
16  * Revision 1.2  2003/05/30 20:53:09  agfitzp
17  * 0.0.2 : Outlining is now done as the user types. Some other bug fixes.
18  *
19  *========================================================================
20  */
21 package net.sourceforge.phpeclipse.js.core.parser;
22
23 /**
24  * @author fitzpata
25  *
26  */
27
28 import org.eclipse.jface.text.rules.IWordDetector;
29
30 /**
31  * A JavaScript aware word detector.
32  * JavaScript tokens are almost identical to Java so this
33  * class is borrowed from org.eclipse.jdt.internal.ui.text.JavaWordDetector.
34  */
35 public class JSWordDetector implements IWordDetector {
36
37         /**
38          * @see IWordDetector#isWordStart
39          * JavaScript tokens are almost identical to Java so for now
40          * we can just borrow this behavior.
41          */
42         public boolean isWordStart(char c) {
43                 return Character.isJavaIdentifierStart(c);
44         }
45         
46         /**
47          * @see IWordDetector#isWordPart
48          * JavaScript tokens are almost identical to Java so for now
49          * we can just borrow this behavior.
50          */
51         public boolean isWordPart(char c) {
52                 return Character.isJavaIdentifierPart(c);
53         }
54 }