43
43
44
44
import org .fife .ui .rsyntaxtextarea .RSyntaxTextArea ;
45
45
import org .fife .ui .rsyntaxtextarea .Token ;
46
+ import org .fife .ui .rsyntaxtextarea .TokenTypes ;
46
47
47
48
/**
48
49
* TODO
@@ -57,7 +58,7 @@ public TokenFunctions(RSyntaxTextArea textArea) {
57
58
}
58
59
59
60
public static boolean tokenEquals (Token token , char [] text ) {
60
- if (token .getType () != token .RESERVED_WORD ||
61
+ if (token .getType () != TokenTypes .RESERVED_WORD ||
61
62
token .length () != text .length )
62
63
return false ;
63
64
final char [] tokenText = token .getTextArray ();
@@ -70,7 +71,7 @@ public static boolean tokenEquals(Token token, char[] text) {
70
71
}
71
72
72
73
public static boolean isIdentifier (Token token ) {
73
- if (token .getType () != token .IDENTIFIER )
74
+ if (token .getType () != TokenTypes .IDENTIFIER )
74
75
return false ;
75
76
final char [] tokenText = token .getTextArray ();
76
77
final int textOffset = token .getTextOffset ();
@@ -135,7 +136,7 @@ public Iterator<Token> iterator() {
135
136
}
136
137
137
138
public static boolean isDot (Token token ) {
138
- if (token .getType () != token .IDENTIFIER ) return false ;
139
+ if (token .getType () != TokenTypes .IDENTIFIER ) return false ;
139
140
final char [] tokenText = token .getTextArray ();
140
141
return tokenText != null && token .length () == 1 && tokenText [token .getTextOffset ()] == '.' ;
141
142
}
@@ -216,7 +217,7 @@ Token skipNonCode(TokenIterator iter, Token current) {
216
217
int skipToEOL (TokenIterator iter , Token current ) {
217
218
int end = textArea .getDocument ().getLength ();
218
219
for (;;) {
219
- if (current .getType () == current .NULL || !iter .hasNext ())
220
+ if (current .getType () == TokenTypes .NULL || !iter .hasNext ())
220
221
return end ;
221
222
end = current .getEndOffset ();
222
223
current = iter .next ();
@@ -308,7 +309,7 @@ public void addImport(String className) {
308
309
boolean insertLF = false ;
309
310
while (iter .hasNext ()) {
310
311
Token token = iter .next ();
311
- if (token .getType () != token .RESERVED_WORD ) {
312
+ if (token .getType () != TokenTypes .RESERVED_WORD ) {
312
313
insertLF = false ;
313
314
continue ;
314
315
}
0 commit comments