diff options
-rw-r--r-- | include/SciLexer.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 1 | ||||
-rw-r--r-- | lexers/LexErrorList.cxx | 18 | ||||
-rw-r--r-- | lexilla/test/examples/errorlist/AllStyles.err | 5 | ||||
-rw-r--r-- | lexilla/test/examples/errorlist/AllStyles.err.styled | 5 | ||||
-rw-r--r-- | lexilla/test/examples/errorlist/SciTE.properties | 1 |
6 files changed, 31 insertions, 0 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h index 4ea1b6f6f..d23e18e0c 100644 --- a/include/SciLexer.h +++ b/include/SciLexer.h @@ -516,6 +516,7 @@ #define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 +#define SCE_ERR_GCC_EXCERPT 25 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 4bf98b1d4..2d53ba391 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -3637,6 +3637,7 @@ val SCE_ERR_VALUE=21 val SCE_ERR_GCC_INCLUDED_FROM=22 val SCE_ERR_ESCSEQ=23 val SCE_ERR_ESCSEQ_UNKNOWN=24 +val SCE_ERR_GCC_EXCERPT=25 val SCE_ERR_ES_BLACK=40 val SCE_ERR_ES_RED=41 val SCE_ERR_ES_GREEN=42 diff --git a/lexers/LexErrorList.cxx b/lexers/LexErrorList.cxx index bf301447a..34bf968fb 100644 --- a/lexers/LexErrorList.cxx +++ b/lexers/LexErrorList.cxx @@ -48,6 +48,19 @@ inline bool AtEOL(Accessor &styler, Sci_PositionU i) { ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } +bool IsGccExcerpt(const char *s) noexcept { + while (*s) { + if (s[0] == ' ' && s[1] == '|' && (s[2] == ' ' || s[2] == '+')) { + return true; + } + if (!(s[0] == ' ' || s[0] == '+' || Is0To9(s[0]))) { + return false; + } + s++; + } + return true; +} + int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLine, Sci_Position &startValue) { if (lineBuffer[0] == '>') { // Command or return status @@ -132,6 +145,11 @@ int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLine, Sci // Microsoft linker warning: // {<object> : } warning LNK9999 return SCE_ERR_MS; + } else if (IsGccExcerpt(lineBuffer)) { + // GCC code excerpt and pointer to issue + // 73 | GTimeVal last_popdown; + // | ^~~~~~~~~~~~ + return SCE_ERR_GCC_EXCERPT; } else { // Look for one of the following formats: // GCC: <filename>:<line>:<message> diff --git a/lexilla/test/examples/errorlist/AllStyles.err b/lexilla/test/examples/errorlist/AllStyles.err index b00a90c6e..b0c8046c2 100644 --- a/lexilla/test/examples/errorlist/AllStyles.err +++ b/lexilla/test/examples/errorlist/AllStyles.err @@ -86,6 +86,11 @@ GCC Include Path 22 In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37, +GCC Pointer 25 + 236 | void gtk_type_init (GTypeDebugFlags debug_flags); + | ^ + + Escape Sequence 23 [K diff --git a/lexilla/test/examples/errorlist/AllStyles.err.styled b/lexilla/test/examples/errorlist/AllStyles.err.styled index b7f89dc02..fe89ef6bc 100644 --- a/lexilla/test/examples/errorlist/AllStyles.err.styled +++ b/lexilla/test/examples/errorlist/AllStyles.err.styled @@ -86,6 +86,11 @@ GCC Include Path 22 {22}In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37, {0} +GCC Pointer 25 +{25} 236 | void gtk_type_init (GTypeDebugFlags debug_flags); + | ^ +{0} + Escape Sequence 23 {23}[K{0} diff --git a/lexilla/test/examples/errorlist/SciTE.properties b/lexilla/test/examples/errorlist/SciTE.properties index 4410986f0..f9e4a20d3 100644 --- a/lexilla/test/examples/errorlist/SciTE.properties +++ b/lexilla/test/examples/errorlist/SciTE.properties @@ -2,3 +2,4 @@ lexer.*.err=errorlist lexer.errorlist.value.separate=1 lexer.errorlist.escape.sequences=1 style.errorlist.23=fore:#000000,back:#FFFFFF,$(error.background) +style.errorlist.25=fore:#CF008F,$(font.monospace.small) |