aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2013-09-22 09:57:57 +1000
committerNeil <nyamatongwe@gmail.com>2013-09-22 09:57:57 +1000
commit7dc2b17d566dcf4bcb2975c2938e42c426e06f06 (patch)
treee89bc3f08ae0eb52d4c82421918698fdfb45f07e
parentff60a3c025573e4f73037c2652538fec1c0f0333 (diff)
downloadscintilla-mirror-7dc2b17d566dcf4bcb2975c2938e42c426e06f06.tar.gz
Stricter checking for ctags lines in errorlist lexer.
-rw-r--r--lexers/LexOthers.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/lexers/LexOthers.cxx b/lexers/LexOthers.cxx
index cdb4b3d17..f87e79275 100644
--- a/lexers/LexOthers.cxx
+++ b/lexers/LexOthers.cxx
@@ -954,15 +954,16 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
// Common: <filename>(<line>): warning|error|note|remark|catastrophic|fatal
// Common: <filename>(<line>) warning|error|note|remark|catastrophic|fatal
// Microsoft: <filename>(<line>,<column>)<message>
- // CTags: \t<message>
+ // CTags: <identifier>\t<filename>\t<message>
// Lua 5 traceback: \t<filename>:<line>:<message>
// Lua 5.1: <exe>: <filename>:<line>:<message>
bool initialTab = (lineBuffer[0] == '\t');
bool initialColonPart = false;
+ bool canBeCtags = !initialTab; // For ctags must have an identifier with no spaces then a tab
enum { stInitial,
stGccStart, stGccDigit, stGccColumn, stGcc,
stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet,
- stCtagsStart, stCtagsStartString, stCtagsStringDollar, stCtags,
+ stCtagsStart, stCtagsFile, stCtagsStartString, stCtagsStringDollar, stCtags,
stUnrecognized
} state = stInitial;
for (unsigned int i = 0; i < lengthLine; i++) {
@@ -984,9 +985,11 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
// May be Microsoft
// Check against '0' often removes phone numbers
state = stMsStart;
- } else if ((ch == '\t') && (!initialTab)) {
+ } else if ((ch == '\t') && canBeCtags) {
// May be CTags
state = stCtagsStart;
+ } else if (ch == ' ') {
+ canBeCtags = false;
}
} else if (state == stGccStart) { // <filename>:
state = Is1To9(ch) ? stGccDigit : stUnrecognized;
@@ -1047,6 +1050,10 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
state = stUnrecognized;
}
} else if (state == stCtagsStart) {
+ if (ch == '\t') {
+ state = stCtagsFile;
+ }
+ } else if (state == stCtagsFile) {
if ((lineBuffer[i - 1] == '\t') &&
((ch == '/' && chNext == '^') || Is0To9(ch))) {
state = stCtags;