aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-03-22 01:41:27 +0000
committernyamatongwe <devnull@localhost>2003-03-22 01:41:27 +0000
commit4cfa41b9c48c240cea7d749002c01af200d26854 (patch)
tree258b33109829598e967403bd014eac82f4e4857d /src
parenta834c66eefb063152cd1cba25b7d574582ad7479 (diff)
downloadscintilla-mirror-4cfa41b9c48c240cea7d749002c01af200d26854.tar.gz
Tightened up recognition of GCC, Microsoft and Perl error lines.
Diffstat (limited to 'src')
-rw-r--r--src/LexOthers.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx
index 54ecb6c9d..1b44e1098 100644
--- a/src/LexOthers.cxx
+++ b/src/LexOthers.cxx
@@ -393,7 +393,8 @@ static void ColouriseErrorListLine(
} else if (strstr(lineBuffer, " at " ) &&
(strstr(lineBuffer, " at " ) < (lineBuffer + lengthLine)) &&
strstr(lineBuffer, " line ") &&
- (strstr(lineBuffer, " line ") < (lineBuffer + lengthLine))) {
+ (strstr(lineBuffer, " line ") < (lineBuffer + lengthLine)) &&
+ (strstr(lineBuffer, " at " ) < (strstr(lineBuffer, " line ")))) {
// perl error message
styler.ColourTo(endPos, SCE_ERR_PERL);
} else if ((memcmp(lineBuffer, " at ", 6) == 0) &&
@@ -405,19 +406,23 @@ static void ColouriseErrorListLine(
// Essential Lahey Fortran error message
styler.ColourTo(endPos, SCE_ERR_ELF);
} else {
- // Look for GCC <filename>:<line>:message
- // Look for Microsoft <filename>(line)message
+ // Look for GCC <filename>:<line>: message
+ // Look for Microsoft <filename>(line) :message
// Look for Microsoft <filename>(line,pos)message
// Look for CTags \tmessage
int state = 0;
for (unsigned int i = 0; i < lengthLine; i++) {
char ch = lineBuffer[i];
+ char chNext = ' ';
+ if ((i+1) < lengthLine)
+ chNext = lineBuffer[i+1];
if (state == 0) {
- if ((ch == ':') && isdigit(lineBuffer[i + 1])) {
+ if ((ch == ':') && isdigit(chNext)) {
// May be GCC
state = 1;
- } else if (ch == '(') {
+ } else if ((ch == '(') && isdigit(chNext) && (chNext != '0')) {
// May be Microsoft
+ // Check againt '0' often removes phone numbers
state = 10;
} else if (ch == '\t') {
// May be CTags
@@ -426,7 +431,7 @@ static void ColouriseErrorListLine(
} else if ((state == 1) && isdigit(ch)) {
state = 2;
} else if (state == 2) {
- if (ch == ':') {
+ if ((ch == ':') && (chNext == ' ')) {
state = 3; // :9.*: is GCC
break;
} else if (!isdigit(ch)) {
@@ -442,8 +447,11 @@ static void ColouriseErrorListLine(
} else if ((ch != ' ') && !isdigit(ch)) {
state = 99;
}
- } else if ((state == 12) && (ch == ':')) {
- state = 13;
+ } else if (state == 12) {
+ if ((ch == ' ') && (chNext == ':'))
+ state = 13;
+ else
+ state = 99;
} else if (state == 14) {
if (ch == ')') {
state = 15;