From 13084ad03ac99d4ad1c2d4b5a28df348bca5979d Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 30 Mar 2003 08:36:20 +0000 Subject: More selective about GCC message format, expecting number after first ':' unless ':' followed by '/' or '\' as used on Windows for paths. --- src/LexOthers.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index c8b45b3f8..6d537c9b6 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -361,6 +361,7 @@ static void ColouriseErrorListLine( // unsigned int startLine, unsigned int endPos, Accessor &styler) { + const int unRecognized = 99; if (lineBuffer[0] == '>') { // Command or return status styler.ColourTo(endPos, SCE_ERR_CMD); @@ -425,9 +426,13 @@ static void ColouriseErrorListLine( if ((i+1) < lengthLine) chNext = lineBuffer[i+1]; if (state == 0) { - if ((ch == ':') && Is0To9(chNext)) { + if (ch == ':') { // May be GCC - state = 1; + if ((chNext != '\\') && (chNext != '/')) { + // This check is not completely accurate as may be on + // GTK+ with a file name that includes ':'. + state = 1; + } } else if ((ch == '(') && Is1To9(chNext)) { // May be Microsoft // Check againt '0' often removes phone numbers @@ -436,36 +441,36 @@ static void ColouriseErrorListLine( // May be CTags state = 20; } - } else if ((state == 1) && Is1To9(ch)) { - state = 2; + } else if (state == 1) { + state = Is1To9(ch) ? 2 : unRecognized; } else if (state == 2) { if (ch == ':') { state = 3; // :9.*: is GCC break; } else if (!Is0To9(ch)) { - state = 99; + state = unRecognized; } } else if (state == 10) { - state = Is0To9(ch) ? 11 : 99; + state = Is0To9(ch) ? 11 : unRecognized; } else if (state == 11) { if (ch == ',') { state = 14; } else if (ch == ')') { state = 12; } else if ((ch != ' ') && !Is0To9(ch)) { - state = 99; + state = unRecognized; } } else if (state == 12) { if ((ch == ' ') && (chNext == ':')) state = 13; else - state = 99; + state = unRecognized; } else if (state == 14) { if (ch == ')') { state = 15; break; } else if ((ch != ' ') && !Is0To9(ch)) { - state = 99; + state = unRecognized; } } else if (state == 20) { if ((lineBuffer[i-1] == '\t') && -- cgit v1.2.3