diff options
-rw-r--r-- | cppcheck.suppress | 3 | ||||
-rw-r--r-- | lexers/LexCPP.cxx | 5 | ||||
-rw-r--r-- | lexilla/test/examples/cpp/SciTE.properties | 5 | ||||
-rw-r--r-- | lexilla/test/examples/cpp/x.cxx | 4 | ||||
-rw-r--r-- | lexilla/test/examples/cpp/x.cxx.styled | 6 |
5 files changed, 17 insertions, 6 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 a839f020a..af60dce3a 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)) { diff --git a/lexilla/test/examples/cpp/SciTE.properties b/lexilla/test/examples/cpp/SciTE.properties index ea4dd39b8..ae3a6e95b 100644 --- a/lexilla/test/examples/cpp/SciTE.properties +++ b/lexilla/test/examples/cpp/SciTE.properties @@ -1,4 +1,5 @@ lexer.*.cxx=cpp -keywords.*.cxx=int +keywords.*.cxx=int let keywords2.*.cxx= -lexer.cpp.track.preprocessor=1
\ No newline at end of file +lexer.cpp.track.preprocessor=1 +lexer.cpp.escape.sequence=1 diff --git a/lexilla/test/examples/cpp/x.cxx b/lexilla/test/examples/cpp/x.cxx index 384997072..8e42167b2 100644 --- a/lexilla/test/examples/cpp/x.cxx +++ b/lexilla/test/examples/cpp/x.cxx @@ -13,4 +13,8 @@ int main() { double x[] = {3.14159,6.02e23,1.6e-19,1.0+1}; int y[] = {75,0113,0x4b}; printf("hello world %d %g\n", y[0], x[0]); + + // JavaScript regular expression (14) tests + let a = /a/; + let b = /[a-z]+/gi; } diff --git a/lexilla/test/examples/cpp/x.cxx.styled b/lexilla/test/examples/cpp/x.cxx.styled index b602717a5..c269ed1b4 100644 --- a/lexilla/test/examples/cpp/x.cxx.styled +++ b/lexilla/test/examples/cpp/x.cxx.styled @@ -12,5 +12,9 @@ {5}int{0} {11}main{10}(){0} {10}{{0} {11}double{0} {11}x{10}[]{0} {10}={0} {10}{{4}3.14159{10},{4}6.02e23{10},{4}1.6e-19{10},{4}1.0{10}+{4}1{10}};{0} {5}int{0} {11}y{10}[]{0} {10}={0} {10}{{4}75{10},{4}0113{10},{4}0x4b{10}};{0} - {11}printf{10}({6}"hello world %d %g\n"{10},{0} {11}y{10}[{4}0{10}],{0} {11}x{10}[{4}0{10}]);{0} + {11}printf{10}({6}"hello world %d %g{27}\n{6}"{10},{0} {11}y{10}[{4}0{10}],{0} {11}x{10}[{4}0{10}]);{0} + + {2}// JavaScript regular expression (14) tests +{0} {5}let{0} {11}a{0} {10}={0} {14}/a/{10};{0} + {5}let{0} {11}b{0} {10}={0} {14}/[a-z]+/gi{10};{0} {10}}{0} |