From 7ee3fd1754d2073652b2ba44bf2ccd77d46ca6d4 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 15 Oct 2007 12:35:40 +0000 Subject: Patch from SteveD to recognise Lua 5.1 error messages. --- src/LexOthers.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index 58aa6f78c..fbc3b2891 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -901,7 +901,9 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin // Microsoft: (,) // CTags: \t // Lua 5 traceback: \t:: + // Lua 5.1: : :: bool initialTab = (lineBuffer[0] == '\t'); + bool initialColonPart = false; enum { stInitial, stGccStart, stGccDigit, stGcc, stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet, @@ -916,10 +918,12 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin if (state == stInitial) { if (ch == ':') { // May be GCC, or might be Lua 5 (Lua traceback same but with tab prefix) - if ((chNext != '\\') && (chNext != '/')) { + if ((chNext != '\\') && (chNext != '/') && (chNext != ' ')) { // This check is not completely accurate as may be on // GTK+ with a file name that includes ':'. - state = stGccStart; + state = stGccStart; + } else if (chNext == ' ') { // indicates a Lua 5.1 error message + initialColonPart = true; } } else if ((ch == '(') && Is1To9(chNext) && (!initialTab)) { // May be Microsoft @@ -995,7 +999,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin } } if (state == stGcc) { - return SCE_ERR_GCC; + return initialColonPart ? SCE_ERR_LUA : SCE_ERR_GCC; } else if ((state == stMsVc) || (state == stMsDotNet)) { return SCE_ERR_MS; } else if ((state == stCtagsStringDollar) || (state == stCtags)) { -- cgit v1.2.3