From 103d6796be9173e35c9ace763a2e3ad01f051d90 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 5 Jan 2019 08:52:28 +1100 Subject: Recognize negative line numbers in GCC-format messages. Cppcheck shows some whole-file errors as line -1. --- doc/ScintillaHistory.html | 5 +++++ lexers/LexErrorList.cxx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 51a438682..bf58633c6 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -566,6 +566,11 @@
  • Updated case conversion and character categories to Unicode 11.
  • +
  • + Errorlist lexer recognizes negative line numbers as some programs show whole-file + errors occurring on line -1. + SciTE's parsing of diagnostics also updated to handle this case. +
  • Added "nim" lexer (SCLEX_NIM) for the Nim language which was previously called Nimrod. For compatibility, the old "nimrod" lexer is still present but is deprecated and will be removed at the diff --git a/lexers/LexErrorList.cxx b/lexers/LexErrorList.cxx index b3dcd2a59..4ca772814 100644 --- a/lexers/LexErrorList.cxx +++ b/lexers/LexErrorList.cxx @@ -175,7 +175,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLi canBeCtags = false; } } else if (state == stGccStart) { // : - state = Is0To9(ch) ? stGccDigit : stUnrecognized; + state = ((ch == '-') || Is0To9(ch)) ? stGccDigit : stUnrecognized; } else if (state == stGccDigit) { // : if (ch == ':') { state = stGccColumn; // :9.*: is GCC -- cgit v1.2.3