CodeEditor: Minor improvement of LogSyntax.cpp

git-svn-id: svn://ultimatepp.org/upp/trunk@7779 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-10-14 10:57:46 +00:00
parent bb9f6f799b
commit 9872c28807

View file

@ -20,14 +20,14 @@ void LogSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& hls
hls.Put(int(s - s0), hl_style[fp ? INK_CONST_FLOAT : INK_CONST_INT]);
}
else
if(IsAlpha(*s)) {
if(IsAlpha(*s) || *s == '_') {
static Index<String> rws;
ONCELOCK {
rws << "error" << "errors" << "warning" << "warnings" << "failed" << "exit" << "fatal"
<< "failure" << "rejected";
}
String w;
while(IsAlNum(*s))
while(IsAlNum(*s) || *s == '_')
w.Cat(ToLower(*s++));
bool hl = rws.Find(w) >= 0;
hls.Put(w.GetCount(), hl ? err : ink);