From b2224e19cb9bdd7b1d7344204e07cc3c1fd09a26 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 22 Sep 2013 09:57:57 +1000 Subject: Stricter checking for ctags lines in errorlist lexer. --- lexers/LexOthers.cxx | 13 ++++++++++--- 1 file 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: (): warning|error|note|remark|catastrophic|fatal // Common: () warning|error|note|remark|catastrophic|fatal // Microsoft: (,) - // CTags: \t + // CTags: \t\t // Lua 5 traceback: \t:: // Lua 5.1: : :: 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) { // : 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; -- cgit v1.2.3