diff options
author | nyamatongwe <devnull@localhost> | 2000-08-30 02:10:56 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-08-30 02:10:56 +0000 |
commit | bf1c3c2594606ee77d7450222afbe4284adbcc6d (patch) | |
tree | 8530393749d064413402831a2e096abb040a2cbc | |
parent | 27103d76bfd65b8083393a9906531fdf4cac9f88 (diff) | |
download | scintilla-mirror-bf1c3c2594606ee77d7450222afbe4284adbcc6d.tar.gz |
Perl error format supported.
SCE_ERR_* symbols replace inline constants.
-rw-r--r-- | include/SciLexer.h | 9 | ||||
-rw-r--r-- | include/Scintilla.iface | 7 | ||||
-rw-r--r-- | src/LexOthers.cxx | 20 |
3 files changed, 29 insertions, 7 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h index cb52493c2..f6253d30d 100644 --- a/include/SciLexer.h +++ b/include/SciLexer.h @@ -210,4 +210,13 @@ #define SCE_LUA_IDENTIFIER 11 #define SCE_LUA_STRINGEOL 12 +// Lexical states for SCLEX_ERRORLIST +#define SCE_ERR_DEFAULT 0 +#define SCE_ERR_PYTHON 1 +#define SCE_ERR_GCC 2 +#define SCE_ERR_MS 3 +#define SCE_ERR_CMD 4 +#define SCE_ERR_BORLAND 5 +#define SCE_ERR_PERL 6 + #endif diff --git a/include/Scintilla.iface b/include/Scintilla.iface index c691ad386..dce7cb4c6 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1233,6 +1233,13 @@ val SCE_LUA_PREPROCESSOR=9 val SCE_LUA_OPERATOR=10 val SCE_LUA_IDENTIFIER=11 val SCE_LUA_STRINGEOL=12 +val SCE_ERR_DEFAULT=0 +val SCE_ERR_PYTHON=1 +val SCE_ERR_GCC=2 +val SCE_ERR_MS=3 +val SCE_ERR_CMD=4 +val SCE_ERR_BORLAND=5 +val SCE_ERR_PERL=6 ################################################ # From WinDefs.h diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index edbf5d06f..dd8603368 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -166,15 +166,21 @@ static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[ static void ColouriseErrorListLine(char *lineBuffer, int lengthLine, int endPos, Accessor &styler) { if (lineBuffer[0] == '>') { // Command or return status - styler.ColourTo(endPos, 4); + styler.ColourTo(endPos, SCE_ERR_CMD); } else if (strstr(lineBuffer, "File \"") && strstr(lineBuffer, ", line ")) { - styler.ColourTo(endPos, 1); + styler.ColourTo(endPos, SCE_ERR_PYTHON); } else if (0 == strncmp(lineBuffer, "Error ", strlen("Error "))) { // Borland error message - styler.ColourTo(endPos, 5); + styler.ColourTo(endPos, SCE_ERR_BORLAND); } else if (0 == strncmp(lineBuffer, "Warning ", strlen("Warning "))) { // Borland warning message - styler.ColourTo(endPos, 5); + styler.ColourTo(endPos, SCE_ERR_BORLAND); + } else if (strstr(lineBuffer, " at " ) && + strstr(lineBuffer, " at " ) < lineBuffer+lengthLine && + strstr(lineBuffer, " line ") && + strstr(lineBuffer, " line ") < lineBuffer+lengthLine) { + // perl error message + styler.ColourTo(endPos, SCE_ERR_PERL); } else { // Look for <filename>:<line>:message // Look for <filename>(line)message @@ -208,11 +214,11 @@ static void ColouriseErrorListLine(char *lineBuffer, int lengthLine, int endPos, } } if (state == 3) { - styler.ColourTo(endPos, 2); + styler.ColourTo(endPos, SCE_ERR_GCC); } else if ((state == 13) || (state == 14) || (state == 15)) { - styler.ColourTo(endPos, 3); + styler.ColourTo(endPos, SCE_ERR_MS); } else { - styler.ColourTo(endPos, 0); + styler.ColourTo(endPos, SCE_ERR_DEFAULT); } } } |