SciTE does not recognize keywords that are next to end of file. For example "foreach " would be highlighted, but "foreach<EOF>" would not be. This is a problem in the automatic indentation, since it wont recognize the keywords in thease cases.
This is the lexer problem, lexer will colourize the key words when it reads a char after a key word.
When reaches end of file, it will do nothing.
Can I give an advice?
Such as in LexVerilog.cxx,function ColouriseVerilogDoc
if (sc.state == SCE_V_IDENTIFIER) { // add below when for (; sc.More(); sc.Forward()) is broken.
if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (keywords.InList(s)) {
sc.ChangeState(SCE_V_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_V_WORD2);
} else if (keywords3.InList(s)) {
sc.ChangeState(SCE_V_WORD3);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_V_USER);
}
sc.SetState(SCE_V_DEFAULT);
}
}
sc.Complete();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=12579
Originator: NO
Many lexers do not recognize keywords at end of file. I won't be working on this.
Logged In: YES
user_id=1868763
Originator: NO
This is the lexer problem, lexer will colourize the key words when it reads a char after a key word.
When reaches end of file, it will do nothing.
Can I give an advice?
Such as in LexVerilog.cxx,function ColouriseVerilogDoc
if (sc.state == SCE_V_IDENTIFIER) { // add below when for (; sc.More(); sc.Forward()) is broken.
if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (keywords.InList(s)) {
sc.ChangeState(SCE_V_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_V_WORD2);
} else if (keywords3.InList(s)) {
sc.ChangeState(SCE_V_WORD3);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_V_USER);
}
sc.SetState(SCE_V_DEFAULT);
}
}
sc.Complete();
A generic fix for lexers that use StyleContext will be included in 3.3.1.