diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-04-13 07:41:08 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-04-13 07:41:08 +1000 |
| commit | 6a036ac8001e1a740fd28323ea22d6acfbd29877 (patch) | |
| tree | b516b442fb6ed91bd68511ab6ef697803861ffcf | |
| parent | 45a093223eb08aed5bf0a85dbcf1b986f9750ee6 (diff) | |
| download | scintilla-mirror-6a036ac8001e1a740fd28323ea22d6acfbd29877.tar.gz | |
Backport: Replace islower function and add tests for JavaScript regular expressions.
Backport of changeset 8143:a5eb440dc1e2.
| -rw-r--r-- | cppcheck.suppress | 3 | ||||
| -rw-r--r-- | lexers/LexCPP.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cppcheck.suppress b/cppcheck.suppress index 1d351d90b..ac9aad1ac 100644 --- a/cppcheck.suppress +++ b/cppcheck.suppress @@ -197,6 +197,9 @@ constVariable:scintilla/lexers/LexVHDL.cxx // bp.itBracket not actually redundant as needed by return statements
redundantAssignment:scintilla/lexers/LexCPP.cxx
+// Suppress everything in test example files
+*:scintilla/lexilla/test/examples/*
+
// Suppress everything in catch.hpp as won't be changing
*:scintilla/test/unit/catch.hpp
// For now, suppress all test source files as, since Catch 2, cppcheck shows many warnings showing
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 2fbbf7151..10e38c661 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -9,7 +9,6 @@ #include <cstdlib> #include <cassert> #include <cstring> -#include <cctype> #include <utility> #include <string> @@ -1160,9 +1159,9 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i case SCE_C_REGEX: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT|activitySet); - } else if (! inRERange && sc.ch == '/') { + } else if (!inRERange && sc.ch == '/') { sc.Forward(); - while ((sc.ch < 0x80) && islower(sc.ch)) + while (IsLowerCase(sc.ch)) sc.Forward(); // gobble regex flags sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '\\' && ((sc.currentPos+1) < lineEndNext)) { |
