[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Highlighting keywords problem

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 ?