| Highlighting keywords problem [message #225553] |
Fri, 03 August 2007 05:47 |
Eclipse User |
|
|
|
Hello,
I'm trying to write an Editor Plug-in for FL language.
I manged to do the highlighting, but I have a problem with the keywords
coloring.
it colors the keywords also when they have a prefix.
for example, "let" is a key word in FL :
let
bullet
in both these words the "let" sequence will be colored (i.e. bul<LET>).
(for words postfix, like "letx" it knows not to color them)
I use a simple WordRule for the scanner:
/***************/
WordRule wordRule = new WordRule(new IWordDetector() {
public boolean isWordStart(char c) {
return !Character.isWhitespace(c);
}
public boolean isWordPart(char c) {
return !(Character.isWhitespace(c)
|| (c == ';') || (c == '('));
}
});
wordRule.addWord("let",keyword);
rules[1] = wordRule;
/***************/
I know the JavaEditor example can distinguish a prefix from a word,
but I can't see where it is defined.
any ideas ?
|
|
|
Powered by
FUDForum. Page generated in 0.11729 seconds