diff --git a/Makefile.in b/Makefile.in
index de571fc4db..f456892a36 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -249,6 +249,7 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexCSS.o \
wxscintilla_LexD.o \
wxscintilla_LexDMAP.o \
+ wxscintilla_LexDMIS.o \
wxscintilla_LexECL.o \
wxscintilla_LexEiffel.o \
wxscintilla_LexErlang.o \
@@ -17098,6 +17099,9 @@ wxscintilla_LexD.o: $(srcdir)/src/stc/scintilla/lexers/LexD.cxx
wxscintilla_LexDMAP.o: $(srcdir)/src/stc/scintilla/lexers/LexDMAP.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexDMAP.cxx
+wxscintilla_LexDMIS.o: $(srcdir)/src/stc/scintilla/lexers/LexDMIS.cxx
+ $(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexDMIS.cxx
+
wxscintilla_LexECL.o: $(srcdir)/src/stc/scintilla/lexers/LexECL.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexECL.cxx
diff --git a/build/bakefiles/scintilla.bkl b/build/bakefiles/scintilla.bkl
index 9a24e9304f..4b3e95423b 100644
--- a/build/bakefiles/scintilla.bkl
+++ b/build/bakefiles/scintilla.bkl
@@ -82,6 +82,7 @@
src/stc/scintilla/lexers/LexCSS.cxx
src/stc/scintilla/lexers/LexD.cxx
src/stc/scintilla/lexers/LexDMAP.cxx
+ src/stc/scintilla/lexers/LexDMIS.cxx
src/stc/scintilla/lexers/LexECL.cxx
src/stc/scintilla/lexers/LexEiffel.cxx
src/stc/scintilla/lexers/LexErlang.cxx
diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc
index f231e69412..fdf357418f 100644
--- a/build/msw/makefile.bcc
+++ b/build/msw/makefile.bcc
@@ -230,6 +230,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexCSS.obj \
$(OBJS)\wxscintilla_LexD.obj \
$(OBJS)\wxscintilla_LexDMAP.obj \
+ $(OBJS)\wxscintilla_LexDMIS.obj \
$(OBJS)\wxscintilla_LexECL.obj \
$(OBJS)\wxscintilla_LexEiffel.obj \
$(OBJS)\wxscintilla_LexErlang.obj \
@@ -5980,6 +5981,9 @@ $(OBJS)\wxscintilla_LexD.obj: ..\..\src\stc\scintilla\lexers\LexD.cxx
$(OBJS)\wxscintilla_LexDMAP.obj: ..\..\src\stc\scintilla\lexers\LexDMAP.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexDMAP.cxx
+$(OBJS)\wxscintilla_LexDMIS.obj: ..\..\src\stc\scintilla\lexers\LexDMIS.cxx
+ $(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexDMIS.cxx
+
$(OBJS)\wxscintilla_LexECL.obj: ..\..\src\stc\scintilla\lexers\LexECL.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexECL.cxx
diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc
index f9e6858055..58de4691d8 100644
--- a/build/msw/makefile.gcc
+++ b/build/msw/makefile.gcc
@@ -218,6 +218,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexCSS.o \
$(OBJS)\wxscintilla_LexD.o \
$(OBJS)\wxscintilla_LexDMAP.o \
+ $(OBJS)\wxscintilla_LexDMIS.o \
$(OBJS)\wxscintilla_LexECL.o \
$(OBJS)\wxscintilla_LexEiffel.o \
$(OBJS)\wxscintilla_LexErlang.o \
@@ -6155,6 +6156,9 @@ $(OBJS)\wxscintilla_LexD.o: ../../src/stc/scintilla/lexers/LexD.cxx
$(OBJS)\wxscintilla_LexDMAP.o: ../../src/stc/scintilla/lexers/LexDMAP.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
+$(OBJS)\wxscintilla_LexDMIS.o: ../../src/stc/scintilla/lexers/LexDMIS.cxx
+ $(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
+
$(OBJS)\wxscintilla_LexECL.o: ../../src/stc/scintilla/lexers/LexECL.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc
index 7c672251ce..c5dcd0812f 100644
--- a/build/msw/makefile.vc
+++ b/build/msw/makefile.vc
@@ -241,6 +241,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexCSS.obj \
$(OBJS)\wxscintilla_LexD.obj \
$(OBJS)\wxscintilla_LexDMAP.obj \
+ $(OBJS)\wxscintilla_LexDMIS.obj \
$(OBJS)\wxscintilla_LexECL.obj \
$(OBJS)\wxscintilla_LexEiffel.obj \
$(OBJS)\wxscintilla_LexErlang.obj \
@@ -6672,6 +6673,9 @@ $(OBJS)\wxscintilla_LexD.obj: ..\..\src\stc\scintilla\lexers\LexD.cxx
$(OBJS)\wxscintilla_LexDMAP.obj: ..\..\src\stc\scintilla\lexers\LexDMAP.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexDMAP.cxx
+$(OBJS)\wxscintilla_LexDMIS.obj: ..\..\src\stc\scintilla\lexers\LexDMIS.cxx
+ $(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexDMIS.cxx
+
$(OBJS)\wxscintilla_LexECL.obj: ..\..\src\stc\scintilla\lexers\LexECL.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexECL.cxx
diff --git a/build/msw/wx_vc7_wxscintilla.vcproj b/build/msw/wx_vc7_wxscintilla.vcproj
index 0dc370af45..76fefd019b 100644
--- a/build/msw/wx_vc7_wxscintilla.vcproj
+++ b/build/msw/wx_vc7_wxscintilla.vcproj
@@ -376,6 +376,9 @@
+
+
diff --git a/build/msw/wx_vc8_wxscintilla.vcproj b/build/msw/wx_vc8_wxscintilla.vcproj
index 48d22ef8ff..a0226156d7 100644
--- a/build/msw/wx_vc8_wxscintilla.vcproj
+++ b/build/msw/wx_vc8_wxscintilla.vcproj
@@ -850,6 +850,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexDMAP.cxx"
>
+
+
diff --git a/build/msw/wx_vc9_wxscintilla.vcproj b/build/msw/wx_vc9_wxscintilla.vcproj
index 922a184ffd..9d36c7afba 100644
--- a/build/msw/wx_vc9_wxscintilla.vcproj
+++ b/build/msw/wx_vc9_wxscintilla.vcproj
@@ -846,6 +846,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexDMAP.cxx"
>
+
+
diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h
index c8adbb3854..279b0458b2 100644
--- a/include/wx/stc/stc.h
+++ b/include/wx/stc/stc.h
@@ -235,6 +235,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
#define wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
#define wxSTC_FOLDFLAG_LEVELNUMBERS 0x0040
+#define wxSTC_FOLDFLAG_LINESTATE 0x0080
#define wxSTC_TIME_FOREVER 10000000
#define wxSTC_WRAP_NONE 0
#define wxSTC_WRAP_WORD 1
@@ -369,7 +370,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MOD_CHANGEANNOTATION 0x20000
#define wxSTC_MOD_CONTAINER 0x40000
#define wxSTC_MOD_LEXERSTATE 0x80000
-#define wxSTC_MODEVENTMASKALL 0xFFFFF
+#define wxSTC_MOD_INSERTCHECK 0x100000
+#define wxSTC_MODEVENTMASKALL 0x1FFFFF
#define wxSTC_UPDATE_CONTENT 0x1
#define wxSTC_UPDATE_SELECTION 0x2
#define wxSTC_UPDATE_V_SCROLL 0x4
@@ -518,6 +520,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_LEX_RUST 111
#define wxSTC_LEX_DMAP 112
#define wxSTC_LEX_AS 113
+#define wxSTC_LEX_DMIS 114
/// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
/// value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -568,6 +571,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_C_PREPROCESSORCOMMENT 23
#define wxSTC_C_PREPROCESSORCOMMENTDOC 24
#define wxSTC_C_USERLITERAL 25
+#define wxSTC_C_TASKMARKER 26
+#define wxSTC_C_ESCAPESEQUENCE 27
/// Lexical states for SCLEX_D
#define wxSTC_D_DEFAULT 0
@@ -2301,6 +2306,18 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_DMAP_WORD2 9
#define wxSTC_DMAP_WORD3 10
+/// Lexical states for SCLEX_DMIS
+#define wxSTC_DMIS_DEFAULT 0
+#define wxSTC_DMIS_COMMENT 1
+#define wxSTC_DMIS_STRING 2
+#define wxSTC_DMIS_NUMBER 3
+#define wxSTC_DMIS_KEYWORD 4
+#define wxSTC_DMIS_MAJORWORD 5
+#define wxSTC_DMIS_MINORWORD 6
+#define wxSTC_DMIS_UNSUPPORTED_MAJOR 7
+#define wxSTC_DMIS_UNSUPPORTED_MINOR 8
+#define wxSTC_DMIS_LABEL 9
+
//}}}
//----------------------------------------------------------------------
@@ -2666,6 +2683,9 @@ public:
// Insert string at a position.
void InsertText(int pos, const wxString& text);
+ // Change the text that is being inserted in response to SC_MOD_INSERTCHECK
+ void ChangeInsertion(int length, const wxString& text);
+
// Delete all text in the document.
void ClearAll();
diff --git a/interface/wx/stc/stc.h b/interface/wx/stc/stc.h
index a4fa06151c..e04d0bea04 100644
--- a/interface/wx/stc/stc.h
+++ b/interface/wx/stc/stc.h
@@ -191,6 +191,7 @@
#define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
#define wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
#define wxSTC_FOLDFLAG_LEVELNUMBERS 0x0040
+#define wxSTC_FOLDFLAG_LINESTATE 0x0080
#define wxSTC_TIME_FOREVER 10000000
#define wxSTC_WRAP_NONE 0
#define wxSTC_WRAP_WORD 1
@@ -325,7 +326,8 @@
#define wxSTC_MOD_CHANGEANNOTATION 0x20000
#define wxSTC_MOD_CONTAINER 0x40000
#define wxSTC_MOD_LEXERSTATE 0x80000
-#define wxSTC_MODEVENTMASKALL 0xFFFFF
+#define wxSTC_MOD_INSERTCHECK 0x100000
+#define wxSTC_MODEVENTMASKALL 0x1FFFFF
#define wxSTC_UPDATE_CONTENT 0x1
#define wxSTC_UPDATE_SELECTION 0x2
#define wxSTC_UPDATE_V_SCROLL 0x4
@@ -474,6 +476,7 @@
#define wxSTC_LEX_RUST 111
#define wxSTC_LEX_DMAP 112
#define wxSTC_LEX_AS 113
+#define wxSTC_LEX_DMIS 114
/// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
/// value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -524,6 +527,8 @@
#define wxSTC_C_PREPROCESSORCOMMENT 23
#define wxSTC_C_PREPROCESSORCOMMENTDOC 24
#define wxSTC_C_USERLITERAL 25
+#define wxSTC_C_TASKMARKER 26
+#define wxSTC_C_ESCAPESEQUENCE 27
/// Lexical states for SCLEX_D
#define wxSTC_D_DEFAULT 0
@@ -2257,6 +2262,18 @@
#define wxSTC_DMAP_WORD2 9
#define wxSTC_DMAP_WORD3 10
+/// Lexical states for SCLEX_DMIS
+#define wxSTC_DMIS_DEFAULT 0
+#define wxSTC_DMIS_COMMENT 1
+#define wxSTC_DMIS_STRING 2
+#define wxSTC_DMIS_NUMBER 3
+#define wxSTC_DMIS_KEYWORD 4
+#define wxSTC_DMIS_MAJORWORD 5
+#define wxSTC_DMIS_MINORWORD 6
+#define wxSTC_DMIS_UNSUPPORTED_MAJOR 7
+#define wxSTC_DMIS_UNSUPPORTED_MINOR 8
+#define wxSTC_DMIS_LABEL 9
+
//}}}
// Commands that can be bound to keystrokes {{{
@@ -2708,6 +2725,11 @@ public:
*/
void InsertText(int pos, const wxString& text);
+ /**
+ Change the text that is being inserted in response to SC_MOD_INSERTCHECK
+ */
+ void ChangeInsertion(int length, const wxString& text);
+
/**
Delete all text in the document.
*/
diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp
index a22707ce58..a6c7d01aef 100644
--- a/src/stc/ScintillaWX.cpp
+++ b/src/stc/ScintillaWX.cpp
@@ -545,7 +545,7 @@ void ScintillaWX::Paste() {
}
else
{
- InsertPaste(selStart, buf, len);
+ InsertPaste(buf, len);
}
}
#endif // wxUSE_DATAOBJ
diff --git a/src/stc/scintilla/README.txt b/src/stc/scintilla/README.txt
index a4a6618069..039197594a 100644
--- a/src/stc/scintilla/README.txt
+++ b/src/stc/scintilla/README.txt
@@ -3,7 +3,7 @@ directories from the Scintilla source distribution. All other code
needed to implement Scintilla on top of wxWidgets is located in the
directory above this one.
-The current version of the Scintilla code is 3.4.1
+The current version of the Scintilla code is 3.4.2
These are the basic steps needed to update the version of Scintilla used by wxSTC.
diff --git a/src/stc/scintilla/include/Platform.h b/src/stc/scintilla/include/Platform.h
index f8150b992d..7c6875e12e 100644
--- a/src/stc/scintilla/include/Platform.h
+++ b/src/stc/scintilla/include/Platform.h
@@ -77,7 +77,9 @@ namespace Scintilla {
typedef float XYPOSITION;
typedef double XYACCUMULATOR;
-//#define XYPOSITION int
+inline int RoundXYPosition(XYPOSITION xyPos) {
+ return int(xyPos + 0.5);
+}
// Underlying the implementation of the platform classes are platform specific types.
// Sometimes these need to be passed around by client code so they are defined here
@@ -92,7 +94,7 @@ typedef void *IdlerID;
/**
* A geometric point class.
- * Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably.
+ * Point is similar to the Win32 POINT and GTK+ GdkPoint types.
*/
class Point {
public:
@@ -102,6 +104,10 @@ public:
explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) {
}
+ static Point FromInts(int x_, int y_) {
+ return Point(static_cast(x_), static_cast(y_));
+ }
+
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
static Point FromLong(long lpoint);
@@ -109,7 +115,7 @@ public:
/**
* A geometric rectangle class.
- * PRectangle is exactly the same as the Win32 RECT so can be used interchangeably.
+ * PRectangle is similar to the Win32 RECT.
* PRectangles contain their top and left sides, but not their right and bottom sides.
*/
class PRectangle {
@@ -119,10 +125,15 @@ public:
XYPOSITION right;
XYPOSITION bottom;
- PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) :
+ explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) :
left(left_), top(top_), right(right_), bottom(bottom_) {
}
+ static PRectangle FromInts(int left_, int top_, int right_, int bottom_) {
+ return PRectangle(static_cast(left_), static_cast(top_),
+ static_cast(right_), static_cast(bottom_));
+ }
+
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
bool operator==(PRectangle &rc) const {
@@ -512,11 +523,6 @@ public:
}
#endif
-// Shut up annoying Visual C++ warnings:
-#ifdef _MSC_VER
-#pragma warning(disable: 4244 4309 4514 4710)
-#endif
-
#if defined(__GNUC__) && defined(SCINTILLA_QT)
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
diff --git a/src/stc/scintilla/include/SciLexer.h b/src/stc/scintilla/include/SciLexer.h
index cb4079b8cb..54cc8ba7ef 100644
--- a/src/stc/scintilla/include/SciLexer.h
+++ b/src/stc/scintilla/include/SciLexer.h
@@ -126,6 +126,7 @@
#define SCLEX_RUST 111
#define SCLEX_DMAP 112
#define SCLEX_AS 113
+#define SCLEX_DMIS 114
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
@@ -169,6 +170,8 @@
#define SCE_C_PREPROCESSORCOMMENT 23
#define SCE_C_PREPROCESSORCOMMENTDOC 24
#define SCE_C_USERLITERAL 25
+#define SCE_C_TASKMARKER 26
+#define SCE_C_ESCAPESEQUENCE 27
#define SCE_D_DEFAULT 0
#define SCE_D_COMMENT 1
#define SCE_D_COMMENTLINE 2
@@ -1700,6 +1703,16 @@
#define SCE_DMAP_WORD 8
#define SCE_DMAP_WORD2 9
#define SCE_DMAP_WORD3 10
+#define SCE_DMIS_DEFAULT 0
+#define SCE_DMIS_COMMENT 1
+#define SCE_DMIS_STRING 2
+#define SCE_DMIS_NUMBER 3
+#define SCE_DMIS_KEYWORD 4
+#define SCE_DMIS_MAJORWORD 5
+#define SCE_DMIS_MINORWORD 6
+#define SCE_DMIS_UNSUPPORTED_MAJOR 7
+#define SCE_DMIS_UNSUPPORTED_MINOR 8
+#define SCE_DMIS_LABEL 9
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
#endif
diff --git a/src/stc/scintilla/include/Scintilla.h b/src/stc/scintilla/include/Scintilla.h
index 08acc5453b..a579b40dbb 100644
--- a/src/stc/scintilla/include/Scintilla.h
+++ b/src/stc/scintilla/include/Scintilla.h
@@ -61,6 +61,7 @@ inline int isascii(int c) { return !(c & ~0x7F); }
#define SCI_ADDTEXT 2001
#define SCI_ADDSTYLEDTEXT 2002
#define SCI_INSERTTEXT 2003
+#define SCI_CHANGEINSERTION 2672
#define SCI_CLEARALL 2004
#define SCI_DELETERANGE 2645
#define SCI_CLEARDOCUMENTSTYLE 2005
@@ -472,6 +473,7 @@ inline int isascii(int c) { return !(c & ~0x7F); }
#define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
#define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
#define SC_FOLDFLAG_LEVELNUMBERS 0x0040
+#define SC_FOLDFLAG_LINESTATE 0x0080
#define SCI_SETFOLDFLAGS 2233
#define SCI_ENSUREVISIBLEENFORCEPOLICY 2234
#define SCI_SETTABINDENTS 2260
@@ -956,7 +958,8 @@ inline int isascii(int c) { return !(c & ~0x7F); }
#define SC_MOD_CHANGEANNOTATION 0x20000
#define SC_MOD_CONTAINER 0x40000
#define SC_MOD_LEXERSTATE 0x80000
-#define SC_MODEVENTMASKALL 0xFFFFF
+#define SC_MOD_INSERTCHECK 0x100000
+#define SC_MODEVENTMASKALL 0x1FFFFF
#define SC_UPDATE_CONTENT 0x1
#define SC_UPDATE_SELECTION 0x2
#define SC_UPDATE_V_SCROLL 0x4
diff --git a/src/stc/scintilla/include/Scintilla.iface b/src/stc/scintilla/include/Scintilla.iface
index 7040b63a91..f6b17bca83 100644
--- a/src/stc/scintilla/include/Scintilla.iface
+++ b/src/stc/scintilla/include/Scintilla.iface
@@ -98,6 +98,9 @@ fun void AddStyledText=2002(int length, cells c)
# Insert string at a position.
fun void InsertText=2003(position pos, string text)
+# Change the text that is being inserted in response to SC_MOD_INSERTCHECK
+fun void ChangeInsertion=2672(int length, string text)
+
# Delete all text in the document.
fun void ClearAll=2004(,)
@@ -1151,6 +1154,7 @@ val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004
val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008
val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010
val SC_FOLDFLAG_LEVELNUMBERS=0x0040
+val SC_FOLDFLAG_LINESTATE=0x0080
# Set some style options for folding.
set void SetFoldFlags=2233(int flags,)
@@ -2494,7 +2498,8 @@ val SC_MOD_CHANGEMARGIN=0x10000
val SC_MOD_CHANGEANNOTATION=0x20000
val SC_MOD_CONTAINER=0x40000
val SC_MOD_LEXERSTATE=0x80000
-val SC_MODEVENTMASKALL=0xFFFFF
+val SC_MOD_INSERTCHECK=0x100000
+val SC_MODEVENTMASKALL=0x1FFFFF
enu Update=SC_UPDATE_
val SC_UPDATE_CONTENT=0x1
@@ -2659,6 +2664,7 @@ val SCLEX_KVIRC=110
val SCLEX_RUST=111
val SCLEX_DMAP=112
val SCLEX_AS=113
+val SCLEX_DMIS=114
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -2711,6 +2717,8 @@ val SCE_C_HASHQUOTEDSTRING=22
val SCE_C_PREPROCESSORCOMMENT=23
val SCE_C_PREPROCESSORCOMMENTDOC=24
val SCE_C_USERLITERAL=25
+val SCE_C_TASKMARKER=26
+val SCE_C_ESCAPESEQUENCE=27
# Lexical states for SCLEX_D
lex D=SCLEX_D SCE_D_
val SCE_D_DEFAULT=0
@@ -4438,6 +4446,18 @@ val SCE_DMAP_IDENTIFIER=7
val SCE_DMAP_WORD=8
val SCE_DMAP_WORD2=9
val SCE_DMAP_WORD3=10
+# Lexical states for SCLEX_DMIS
+lex DMIS=SCLEX_DMIS SCE_DMIS_
+val SCE_DMIS_DEFAULT=0
+val SCE_DMIS_COMMENT=1
+val SCE_DMIS_STRING=2
+val SCE_DMIS_NUMBER=3
+val SCE_DMIS_KEYWORD=4
+val SCE_DMIS_MAJORWORD=5
+val SCE_DMIS_MINORWORD=6
+val SCE_DMIS_UNSUPPORTED_MAJOR=7
+val SCE_DMIS_UNSUPPORTED_MINOR=8
+val SCE_DMIS_LABEL=9
# Events
diff --git a/src/stc/scintilla/lexers/LexA68k.cxx b/src/stc/scintilla/lexers/LexA68k.cxx
index 6ab03bf0fa..0b600195a7 100644
--- a/src/stc/scintilla/lexers/LexA68k.cxx
+++ b/src/stc/scintilla/lexers/LexA68k.cxx
@@ -117,20 +117,20 @@ static inline bool IsDoxygenChar (const int ch)
static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
{
- // Used to buffer a string, to be able to compare it using built-in functions
- char Buffer[100];
-
-
- // Used to know the length of an operator
- int OpType;
-
+ // Used to buffer a string, to be able to compare it using built-in functions
+ char Buffer[100];
+
+
+ // Used to know the length of an operator
+ int OpType;
+
// Get references to keywords lists
WordList &cpuInstruction = *keywordlists[0];
WordList ®isters = *keywordlists[1];
WordList &directive = *keywordlists[2];
WordList &extInstruction = *keywordlists[3];
- WordList &alert = *keywordlists[4];
+ WordList &alert = *keywordlists[4];
WordList &doxygenKeyword = *keywordlists[5];
@@ -140,109 +140,109 @@ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle,
/************************************************************
*
- * Parse the source
+ * Parse the source
*
************************************************************/
for ( ; sc.More(); sc.Forward())
{
- /************************************************************
- *
- * A style always terminates at the end of a line, even for
- * comments (no multi-lines comments)
- *
- ************************************************************/
- if (sc.atLineStart) {
+ /************************************************************
+ *
+ * A style always terminates at the end of a line, even for
+ * comments (no multi-lines comments)
+ *
+ ************************************************************/
+ if (sc.atLineStart) {
sc.SetState(SCE_A68K_DEFAULT);
- }
+ }
/************************************************************
*
- * If we are not in "default style", check if the style continues
- * In this case, we just have to loop
+ * If we are not in "default style", check if the style continues
+ * In this case, we just have to loop
*
************************************************************/
if (sc.state != SCE_A68K_DEFAULT)
{
- if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number
+ if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number
|| ((sc.state == SCE_A68K_NUMBER_BIN) && IsBin(sc.ch)) // Binary number
|| ((sc.state == SCE_A68K_NUMBER_HEX) && isxdigit(sc.ch)) // Hexa number
- || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument
+ || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument
|| ((sc.state == SCE_A68K_STRING1) && (sc.ch != '\'')) // String single-quoted
|| ((sc.state == SCE_A68K_STRING2) && (sc.ch != '\"')) // String double-quoted
- || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point)
- || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier
- || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local)
- || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword
- || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert
- || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment
+ || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point)
+ || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier
+ || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local)
+ || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword
+ || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert
+ || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment
{
continue;
}
- /************************************************************
- *
- * Check if current state terminates
- *
- ************************************************************/
+ /************************************************************
+ *
+ * Check if current state terminates
+ *
+ ************************************************************/
- // Strings: include terminal ' or " in the current string by skipping it
- if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) {
- sc.Forward();
+ // Strings: include terminal ' or " in the current string by skipping it
+ if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) {
+ sc.Forward();
}
-
-
- // If a macro declaration was terminated with ':', it was a label
- else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) {
- sc.ChangeState(SCE_A68K_LABEL);
+
+
+ // If a macro declaration was terminated with ':', it was a label
+ else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) {
+ sc.ChangeState(SCE_A68K_LABEL);
}
-
- // If it wasn't a Doxygen keyword, change it to normal comment
- else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) {
+
+ // If it wasn't a Doxygen keyword, change it to normal comment
+ else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) {
sc.GetCurrent(Buffer, sizeof(Buffer));
- if (!doxygenKeyword.InList(Buffer)) {
+ if (!doxygenKeyword.InList(Buffer)) {
sc.ChangeState(SCE_A68K_COMMENT);
}
sc.SetState(SCE_A68K_COMMENT);
continue;
}
-
- // If it wasn't an Alert, change it to normal comment
- else if (sc.state == SCE_A68K_COMMENT_SPECIAL) {
- sc.GetCurrent(Buffer, sizeof(Buffer));
- if (!alert.InList(Buffer)) {
+
+ // If it wasn't an Alert, change it to normal comment
+ else if (sc.state == SCE_A68K_COMMENT_SPECIAL) {
+ sc.GetCurrent(Buffer, sizeof(Buffer));
+ if (!alert.InList(Buffer)) {
sc.ChangeState(SCE_A68K_COMMENT);
}
- // Reset style to normal comment, or to Doxygen keyword if it begins with '\'
- if (sc.ch == '\\') {
- sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
- }
- else {
+ // Reset style to normal comment, or to Doxygen keyword if it begins with '\'
+ if (sc.ch == '\\') {
+ sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
+ }
+ else {
sc.SetState(SCE_A68K_COMMENT);
- }
+ }
continue;
}
-
- // If we are in a comment, it's a Doxygen keyword or an Alert
- else if (sc.state == SCE_A68K_COMMENT) {
- if (sc.ch == '\\') {
- sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
- }
- else {
- sc.SetState(SCE_A68K_COMMENT_SPECIAL);
- }
- continue;
+
+ // If we are in a comment, it's a Doxygen keyword or an Alert
+ else if (sc.state == SCE_A68K_COMMENT) {
+ if (sc.ch == '\\') {
+ sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
+ }
+ else {
+ sc.SetState(SCE_A68K_COMMENT_SPECIAL);
+ }
+ continue;
}
-
+
// Check if we are at the end of an identifier
// In this case, colourise it if was a keyword.
- else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) {
+ else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) {
sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context
if (cpuInstruction.InList(Buffer)) { // And check if it belongs to a keyword list
sc.ChangeState(SCE_A68K_CPUINSTRUCTION);
@@ -269,30 +269,30 @@ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle,
*
************************************************************/
- // Something which begins at the beginning of a line, and with
- // - '\' + an identifier start char, or
- // - '\\@' + an identifier start char
- // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration
- if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) {
- sc.SetState(SCE_A68K_LABEL);
- }
-
- if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) {
- sc.Forward(2);
- if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) {
- sc.ChangeState(SCE_A68K_LABEL);
- sc.SetState(SCE_A68K_LABEL);
- }
- }
-
+ // Something which begins at the beginning of a line, and with
+ // - '\' + an identifier start char, or
+ // - '\\@' + an identifier start char
+ // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration
+ if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) {
+ sc.SetState(SCE_A68K_LABEL);
+ }
+
+ if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) {
+ sc.Forward(2);
+ if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) {
+ sc.ChangeState(SCE_A68K_LABEL);
+ sc.SetState(SCE_A68K_LABEL);
+ }
+ }
+
// Label and macro identifiers start at the beginning of a line
- // We set both as a macro id, but if it wasn't one (':' at the end),
- // it will be changed as a label.
+ // We set both as a macro id, but if it wasn't one (':' at the end),
+ // it will be changed as a label.
if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) {
- sc.SetState(SCE_A68K_MACRO_DECLARATION);
+ sc.SetState(SCE_A68K_MACRO_DECLARATION);
}
- else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match
- sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment
+ else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match
+ sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment
}
else if ((sc.ch < 0x80) && isdigit(sc.ch)) { // Decimal numbers haven't prefix
sc.SetState(SCE_A68K_NUMBER_DEC);
@@ -309,7 +309,7 @@ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle,
else if ((sc.ch < 0x80) && (sc.ch == '\"')) { // String (double-quoted)
sc.SetState(SCE_A68K_STRING2);
}
- else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\'
+ else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\'
sc.SetState(SCE_A68K_MACRO_ARG);
}
else if ((sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { // An identifier: constant, label, etc...
diff --git a/src/stc/scintilla/lexers/LexCPP.cxx b/src/stc/scintilla/lexers/LexCPP.cxx
index 04628b4df7..7fe6809918 100644
--- a/src/stc/scintilla/lexers/LexCPP.cxx
+++ b/src/stc/scintilla/lexers/LexCPP.cxx
@@ -36,7 +36,10 @@
using namespace Scintilla;
#endif
-static bool IsSpaceEquiv(int state) {
+namespace {
+ // Use an unnamed namespace to protect the functions and classes from name conflicts
+
+bool IsSpaceEquiv(int state) {
return (state <= SCE_C_COMMENTDOC) ||
// including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE
(state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) ||
@@ -50,7 +53,7 @@ static bool IsSpaceEquiv(int state) {
// a = b+++/ptn/...
// Putting a space between the '++' post-inc operator and the '+' binary op
// fixes this, and is highly recommended for readability anyway.
-static bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) {
+bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) {
int pos = (int) sc.currentPos;
while (--pos > 0) {
char ch = styler[pos];
@@ -61,7 +64,7 @@ static bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) {
return false;
}
-static bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
+bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
// Don't look at styles, so no need to flush.
int pos = (int) sc.currentPos;
int currentLine = styler.GetLine(pos);
@@ -83,7 +86,120 @@ static bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
return !*s;
}
-static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) {
+bool IsSpaceOrTab(int ch) {
+ return ch == ' ' || ch == '\t';
+}
+
+bool OnlySpaceOrTab(const std::string &s) {
+ for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) {
+ if (!IsSpaceOrTab(*it))
+ return false;
+ }
+ return true;
+}
+
+std::vector StringSplit(const std::string &text, int separator) {
+ std::vector vs(text.empty() ? 0 : 1);
+ for (std::string::const_iterator it = text.begin(); it != text.end(); ++it) {
+ if (*it == separator) {
+ vs.push_back(std::string());
+ } else {
+ vs.back() += *it;
+ }
+ }
+ return vs;
+}
+
+struct BracketPair {
+ std::vector::iterator itBracket;
+ std::vector::iterator itEndBracket;
+};
+
+BracketPair FindBracketPair(std::vector &tokens) {
+ BracketPair bp;
+ std::vector::iterator itTok = std::find(tokens.begin(), tokens.end(), "(");
+ bp.itBracket = tokens.end();
+ bp.itEndBracket = tokens.end();
+ if (itTok != tokens.end()) {
+ bp.itBracket = itTok;
+ size_t nest = 0;
+ while (itTok != tokens.end()) {
+ if (*itTok == "(") {
+ nest++;
+ } else if (*itTok == ")") {
+ nest--;
+ if (nest == 0) {
+ bp.itEndBracket = itTok;
+ return bp;
+ }
+ }
+ ++itTok;
+ }
+ }
+ bp.itBracket = tokens.end();
+ return bp;
+}
+
+void highlightTaskMarker(StyleContext &sc, LexAccessor &styler,
+ int activity, WordList &markerList, bool caseSensitive){
+ if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) {
+ const int lengthMarker = 50;
+ char marker[lengthMarker+1];
+ int currPos = (int) sc.currentPos;
+ int i = 0;
+ while (i < lengthMarker) {
+ char ch = styler.SafeGetCharAt(currPos + i);
+ if (IsASpace(ch) || isoperator(ch)) {
+ break;
+ }
+ if (caseSensitive)
+ marker[i] = ch;
+ else
+ marker[i] = static_cast(tolower(ch));
+ i++;
+ }
+ marker[i] = '\0';
+ if (markerList.InList(marker)) {
+ sc.SetState(SCE_C_TASKMARKER|activity);
+ }
+ }
+}
+
+struct EscapeSequence {
+ int digitsLeft;
+ CharacterSet setHexDigits;
+ CharacterSet setOctDigits;
+ CharacterSet setNoneNumeric;
+ CharacterSet *escapeSetValid;
+ EscapeSequence() {
+ digitsLeft = 0;
+ escapeSetValid = 0;
+ setHexDigits = CharacterSet(CharacterSet::setDigits, "ABCDEFabcdef");
+ setOctDigits = CharacterSet(CharacterSet::setNone, "01234567");
+ }
+ void resetEscapeState(int nextChar) {
+ digitsLeft = 0;
+ escapeSetValid = &setNoneNumeric;
+ if (nextChar == 'U') {
+ digitsLeft = 9;
+ escapeSetValid = &setHexDigits;
+ } else if (nextChar == 'u') {
+ digitsLeft = 5;
+ escapeSetValid = &setHexDigits;
+ } else if (nextChar == 'x') {
+ digitsLeft = 5;
+ escapeSetValid = &setHexDigits;
+ } else if (setOctDigits.Contains(nextChar)) {
+ digitsLeft = 3;
+ escapeSetValid = &setOctDigits;
+ }
+ }
+ bool atEscapeEnd(int currChar) const {
+ return (digitsLeft <= 0) || !escapeSetValid->Contains(currChar);
+ }
+};
+
+std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) {
std::string restOfLine;
int i =0;
char ch = styler.SafeGetCharAt(start, '\n');
@@ -100,40 +216,21 @@ static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace
return restOfLine;
}
-static bool IsStreamCommentStyle(int style) {
+bool IsStreamCommentStyle(int style) {
return style == SCE_C_COMMENT ||
style == SCE_C_COMMENTDOC ||
style == SCE_C_COMMENTDOCKEYWORD ||
style == SCE_C_COMMENTDOCKEYWORDERROR;
}
-static std::vector Tokenize(const std::string &s) {
- // Break into space separated tokens
- std::string word;
- std::vector tokens;
- for (const char *cp = s.c_str(); *cp; cp++) {
- if ((*cp == ' ') || (*cp == '\t')) {
- if (!word.empty()) {
- tokens.push_back(word);
- word = "";
- }
- } else {
- word += *cp;
- }
- }
- if (!word.empty()) {
- tokens.push_back(word);
- }
- return tokens;
-}
-
struct PPDefinition {
int line;
std::string key;
std::string value;
bool isUndef;
- PPDefinition(int line_, const std::string &key_, const std::string &value_, bool isUndef_ = false) :
- line(line_), key(key_), value(value_), isUndef(isUndef_) {
+ std::string arguments;
+ PPDefinition(int line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, std::string arguments_="") :
+ line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) {
}
};
@@ -211,6 +308,8 @@ struct OptionsCPP {
bool updatePreprocessor;
bool triplequotedStrings;
bool hashquotedStrings;
+ bool backQuotedStrings;
+ bool escapeSequence;
bool fold;
bool foldSyntaxBased;
bool foldComment;
@@ -229,6 +328,8 @@ struct OptionsCPP {
updatePreprocessor = true;
triplequotedStrings = false;
hashquotedStrings = false;
+ backQuotedStrings = false;
+ escapeSequence = false;
fold = false;
foldSyntaxBased = true;
foldComment = false;
@@ -243,12 +344,13 @@ struct OptionsCPP {
}
};
-static const char *const cppWordLists[] = {
+const char *const cppWordLists[] = {
"Primary keywords and identifiers",
"Secondary keywords and identifiers",
"Documentation comment keywords",
"Global classes and typedefs",
"Preprocessor definitions",
+ "Task marker and error marker keywords",
0,
};
@@ -274,6 +376,12 @@ struct OptionSetCPP : public OptionSet {
DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings,
"Set to 1 to enable highlighting of hash-quoted strings.");
+ DefineProperty("lexer.cpp.backquoted.strings", &OptionsCPP::backQuotedStrings,
+ "Set to 1 to enable highlighting of back-quoted raw strings .");
+
+ DefineProperty("lexer.cpp.escape.sequence", &OptionsCPP::escapeSequence,
+ "Set to 1 to enable highlighting of escape sequences in strings");
+
DefineProperty("fold", &OptionsCPP::fold);
DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
@@ -312,7 +420,9 @@ struct OptionSetCPP : public OptionSet {
}
};
-static const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
+const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
+
+}
class LexerCPP : public ILexerWithSubStyles {
bool caseSensitive;
@@ -321,6 +431,7 @@ class LexerCPP : public ILexerWithSubStyles {
CharacterSet setArithmethicOp;
CharacterSet setRelOp;
CharacterSet setLogicalOp;
+ CharacterSet setWordStart;
PPStates vlls;
std::vector ppDefineHistory;
WordList keywords;
@@ -328,9 +439,26 @@ class LexerCPP : public ILexerWithSubStyles {
WordList keywords3;
WordList keywords4;
WordList ppDefinitions;
- std::map preprocessorDefinitionsStart;
+ WordList markerList;
+ struct SymbolValue {
+ std::string value;
+ std::string arguments;
+ SymbolValue(const std::string &value_="", const std::string &arguments_="") : value(value_), arguments(arguments_) {
+ }
+ SymbolValue &operator = (const std::string &value_) {
+ value = value_;
+ arguments.clear();
+ return *this;
+ }
+ bool IsMacro() const {
+ return !arguments.empty();
+ }
+ };
+ typedef std::map SymbolTable;
+ SymbolTable preprocessorDefinitionsStart;
OptionsCPP options;
OptionSetCPP osCPP;
+ EscapeSequence escapeSeq;
SparseState rawStringTerminators;
enum { activeFlag = 0x40 };
enum { ssIdentifier, ssDocKeyword };
@@ -394,7 +522,7 @@ public:
}
int SCI_METHOD PrimaryStyleFromStyle(int style) {
return MaskActive(style);
- }
+ }
void SCI_METHOD FreeSubStyles() {
subStyles.Free();
}
@@ -417,8 +545,9 @@ public:
static int MaskActive(int style) {
return style & ~activeFlag;
}
- void EvaluateTokens(std::vector &tokens);
- bool EvaluateExpression(const std::string &expr, const std::map &preprocessorDefinitions);
+ void EvaluateTokens(std::vector &tokens, const SymbolTable &preprocessorDefinitions);
+ std::vector Tokenize(const std::string &expr) const;
+ bool EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions);
};
int SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) {
@@ -452,6 +581,9 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
case 4:
wordListN = &ppDefinitions;
break;
+ case 5:
+ wordListN = &markerList;
+ break;
}
int firstModification = -1;
if (wordListN) {
@@ -469,7 +601,16 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
if (cpEquals) {
std::string name(cpDefinition, cpEquals - cpDefinition);
std::string val(cpEquals+1);
- preprocessorDefinitionsStart[name] = val;
+ size_t bracket = name.find('(');
+ size_t bracketEnd = name.find(')');
+ if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) {
+ // Macro
+ std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1);
+ name = name.substr(0, bracket);
+ preprocessorDefinitionsStart[name] = SymbolValue(val, args);
+ } else {
+ preprocessorDefinitionsStart[name] = val;
+ }
} else {
std::string name(cpDefinition);
std::string val("1");
@@ -499,7 +640,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]");
- CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
+ setWordStart = CharacterSet(CharacterSet::setAlpha, "_", 0x80, true);
CharacterSet setInvalidRawFirst(CharacterSet::setNone, " )\\\t\v\f\n");
@@ -511,6 +652,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
int visibleChars = 0;
bool lastWordWasUUID = false;
int styleBeforeDCKeyword = SCE_C_DEFAULT;
+ int styleBeforeTaskMarker = SCE_C_DEFAULT;
bool continuationLine = false;
bool isIncludePreprocessor = false;
bool isStringInPreprocessor = false;
@@ -540,7 +682,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
}
- StyleContext sc(startPos, length, initStyle, styler, static_cast(0xff));
+ StyleContext sc(startPos, length, initStyle, styler, static_cast(0xff));
LinePPState preproc = vlls.ForLine(lineCurrent);
bool definitionsChanged = false;
@@ -556,12 +698,12 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
definitionsChanged = true;
}
- std::map preprocessorDefinitions = preprocessorDefinitionsStart;
+ SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart;
for (std::vector::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) {
if (itDef->isUndef)
preprocessorDefinitions.erase(itDef->key);
else
- preprocessorDefinitions[itDef->key] = itDef->value;
+ preprocessorDefinitions[itDef->key] = SymbolValue(itDef->value, itDef->arguments);
}
std::string rawStringTerminator = rawStringTerminators.ValueAt(lineCurrent-1);
@@ -581,13 +723,13 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
// Inside inactive preprocessor declaration, state will be reset anyway at the end of this block.
if ((sc.state == SCE_C_STRING) || (sc.state == SCE_C_CHARACTER)) {
// Prevent SCE_C_STRINGEOL from leaking back to previous line which
- // ends with a line continuation by locking in the state upto this position.
+ // ends with a line continuation by locking in the state up to this position.
sc.SetState(sc.state);
}
if ((MaskActive(sc.state) == SCE_C_PREPROCESSOR) && (!continuationLine)) {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
- // Reset states to begining of colourise so no surprises
+ // Reset states to beginning of colourise so no surprises
// if different sets of lines lexed.
visibleChars = 0;
lastWordWasUUID = false;
@@ -725,6 +867,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
if (sc.Match('*', '/')) {
sc.Forward();
sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ styleBeforeTaskMarker = SCE_C_COMMENT;
+ highlightTaskMarker(sc, styler, activitySet, markerList, caseSensitive);
}
break;
case SCE_C_COMMENTDOC:
@@ -742,6 +887,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
case SCE_C_COMMENTLINE:
if (sc.atLineStart && !continuationLine) {
sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ styleBeforeTaskMarker = SCE_C_COMMENTLINE;
+ highlightTaskMarker(sc, styler, activitySet, markerList, caseSensitive);
}
break;
case SCE_C_COMMENTLINEDOC:
@@ -794,9 +942,11 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
isIncludePreprocessor = false;
}
} else if (sc.ch == '\\') {
- if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
- sc.Forward();
+ if (options.escapeSequence) {
+ sc.SetState(SCE_C_ESCAPESEQUENCE|activitySet);
+ escapeSeq.resetEscapeState(sc.chNext);
}
+ sc.Forward(); // Skip all characters after the backslash
} else if (sc.ch == '\"') {
if (sc.chNext == '_') {
sc.ChangeState(SCE_C_USERLITERAL|activitySet);
@@ -805,6 +955,24 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
}
break;
+ case SCE_C_ESCAPESEQUENCE:
+ escapeSeq.digitsLeft--;
+ if (!escapeSeq.atEscapeEnd(sc.ch)) {
+ break;
+ }
+ if (sc.ch == '"') {
+ sc.SetState(SCE_C_STRING|activitySet);
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ } else if (sc.ch == '\\') {
+ escapeSeq.resetEscapeState(sc.chNext);
+ sc.Forward();
+ } else {
+ sc.SetState(SCE_C_STRING|activitySet);
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_C_STRINGEOL|activitySet);
+ }
+ }
+ break;
case SCE_C_HASHQUOTEDSTRING:
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
@@ -880,6 +1048,12 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
if (sc.atLineEnd || sc.ch == ')') {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
+ break;
+ case SCE_C_TASKMARKER:
+ if (isoperator(sc.ch) || IsASpace(sc.ch)) {
+ sc.SetState(styleBeforeTaskMarker|activitySet);
+ styleBeforeTaskMarker = SCE_C_DEFAULT;
+ }
}
if (sc.atLineEnd && !atLineEndBeforeSwitch) {
@@ -900,6 +1074,10 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
} else if (options.hashquotedStrings && sc.Match('#', '\"')) {
sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet);
sc.Forward();
+ } else if (options.backQuotedStrings && sc.Match('`')) {
+ sc.SetState(SCE_C_STRINGRAW|activitySet);
+ rawStringTerminator = "`";
+ sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
if (lastWordWasUUID) {
sc.SetState(SCE_C_UUID|activitySet);
@@ -1018,19 +1196,35 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
} else if (sc.Match("define")) {
if (options.updatePreprocessor && !preproc.IsInactive()) {
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true);
- if (restOfLine.find(")") == std::string::npos) { // Don't handle macros with arguments
- std::vector tokens = Tokenize(restOfLine);
- std::string key;
- std::string value("1");
- if (tokens.size() >= 1) {
- key = tokens[0];
- if (tokens.size() >= 2) {
- value = tokens[1];
- }
- preprocessorDefinitions[key] = value;
- ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
- definitionsChanged = true;
- }
+ size_t startName = 0;
+ while ((startName < restOfLine.length()) && IsSpaceOrTab(restOfLine[startName]))
+ startName++;
+ size_t endName = startName;
+ while ((endName < restOfLine.length()) && setWord.Contains(static_cast(restOfLine[endName])))
+ endName++;
+ std::string key = restOfLine.substr(startName, endName-startName);
+ if (restOfLine[endName] == '(') {
+ // Macro
+ size_t endArgs = endName;
+ while ((endArgs < restOfLine.length()) && (restOfLine[endArgs] != ')'))
+ endArgs++;
+ std::string args = restOfLine.substr(endName + 1, endArgs - endName - 1);
+ size_t startValue = endArgs+1;
+ while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
+ startValue++;
+ std::string value = restOfLine.substr(startValue);
+ preprocessorDefinitions[key] = SymbolValue(value, args);
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value, false, args));
+ definitionsChanged = true;
+ } else {
+ // Value
+ size_t startValue = endName;
+ while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
+ startValue++;
+ std::string value = restOfLine.substr(startValue);
+ preprocessorDefinitions[key] = value;
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
+ definitionsChanged = true;
}
}
} else if (sc.Match("undef")) {
@@ -1180,19 +1374,36 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
}
}
-void LexerCPP::EvaluateTokens(std::vector &tokens) {
+void LexerCPP::EvaluateTokens(std::vector &tokens, const SymbolTable &preprocessorDefinitions) {
- // Evaluate defined() statements to either 0 or 1
- for (size_t i=0; (i+2))
- tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 4);
- val = "1";
+ if (tokens[i+1] == "(") {
+ if (((i + 2))
+ SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i+2]);
+ if (it != preprocessorDefinitions.end()) {
+ val = "1";
+ }
+ tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 4);
+ } else {
+ // Spurious '(' so erase as more likely to result in false
+ tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 2);
+ }
+ } else {
+ // defined
+ SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i+1]);
+ if (it != preprocessorDefinitions.end()) {
+ val = "1";
+ }
}
tokens[i] = val;
} else {
@@ -1200,21 +1411,82 @@ void LexerCPP::EvaluateTokens(std::vector &tokens) {
}
}
+ // Evaluate identifiers
+ const size_t maxIterations = 100;
+ size_t iterations = 0; // Limit number of iterations in case there is a recursive macro.
+ for (size_t i = 0; (i(tokens[i][0]))) {
+ SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i]);
+ if (it != preprocessorDefinitions.end()) {
+ // Tokenize value
+ std::vector macroTokens = Tokenize(it->second.value);
+ if (it->second.IsMacro()) {
+ if ((i + 1 < tokens.size()) && (tokens.at(i + 1) == "(")) {
+ // Create map of argument name to value
+ std::vector argumentNames = StringSplit(it->second.arguments, ',');
+ std::map arguments;
+ size_t arg = 0;
+ size_t tok = i+2;
+ while ((tok < tokens.size()) && (arg < argumentNames.size()) && (tokens.at(tok) != ")")) {
+ if (tokens.at(tok) != ",") {
+ arguments[argumentNames.at(arg)] = tokens.at(tok);
+ arg++;
+ }
+ tok++;
+ }
+
+ // Remove invocation
+ tokens.erase(tokens.begin() + i, tokens.begin() + tok + 1);
+
+ // Substitute values into macro
+ macroTokens.erase(std::remove_if(macroTokens.begin(), macroTokens.end(), OnlySpaceOrTab), macroTokens.end());
+
+ for (size_t iMacro = 0; iMacro < macroTokens.size();) {
+ if (setWordStart.Contains(static_cast(macroTokens[iMacro][0]))) {
+ std::map::const_iterator itFind = arguments.find(macroTokens[iMacro]);
+ if (itFind != arguments.end()) {
+ // TODO: Possible that value will be expression so should insert tokenized form
+ macroTokens[iMacro] = itFind->second;
+ }
+ }
+ iMacro++;
+ }
+
+ // Insert results back into tokens
+ tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
+
+ } else {
+ i++;
+ }
+ } else {
+ // Remove invocation
+ tokens.erase(tokens.begin() + i);
+ // Insert results back into tokens
+ tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
+ }
+ } else {
+ // Identifier not found
+ tokens.erase(tokens.begin() + i);
+ }
+ } else {
+ i++;
+ }
+ }
+
// Find bracketed subexpressions and recurse on them
- std::vector::iterator itBracket = std::find(tokens.begin(), tokens.end(), "(");
- std::vector::iterator itEndBracket = std::find(tokens.begin(), tokens.end(), ")");
- while ((itBracket != tokens.end()) && (itEndBracket != tokens.end()) && (itEndBracket > itBracket)) {
- std::vector inBracket(itBracket + 1, itEndBracket);
- EvaluateTokens(inBracket);
+ BracketPair bracketPair = FindBracketPair(tokens);
+ while (bracketPair.itBracket != tokens.end()) {
+ std::vector inBracket(bracketPair.itBracket + 1, bracketPair.itEndBracket);
+ EvaluateTokens(inBracket, preprocessorDefinitions);
// The insertion is done before the removal because there were failures with the opposite approach
- tokens.insert(itBracket, inBracket.begin(), inBracket.end());
- itBracket = std::find(tokens.begin(), tokens.end(), "(");
- itEndBracket = std::find(tokens.begin(), tokens.end(), ")");
- tokens.erase(itBracket, itEndBracket + 1);
+ tokens.insert(bracketPair.itBracket, inBracket.begin(), inBracket.end());
- itBracket = std::find(tokens.begin(), tokens.end(), "(");
- itEndBracket = std::find(tokens.begin(), tokens.end(), ")");
+ bracketPair = FindBracketPair(tokens);
+ tokens.erase(bracketPair.itBracket, bracketPair.itEndBracket + 1);
+
+ bracketPair = FindBracketPair(tokens);
}
// Evaluate logical negations
@@ -1283,45 +1555,51 @@ void LexerCPP::EvaluateTokens(std::vector &tokens) {
}
}
-bool LexerCPP::EvaluateExpression(const std::string &expr, const std::map &preprocessorDefinitions) {
- // Break into tokens, replacing with definitions
- std::string word;
+std::vector LexerCPP::Tokenize(const std::string &expr) const {
+ // Break into tokens
std::vector tokens;
const char *cp = expr.c_str();
- for (;;) {
+ while (*cp) {
+ std::string word;
if (setWord.Contains(static_cast(*cp))) {
+ // Identifiers and numbers
+ while (setWord.Contains(static_cast(*cp))) {
+ word += *cp;
+ cp++;
+ }
+ } else if (IsSpaceOrTab(*cp)) {
+ while (IsSpaceOrTab(*cp)) {
+ word += *cp;
+ cp++;
+ }
+ } else if (setRelOp.Contains(static_cast(*cp))) {
word += *cp;
+ cp++;
+ if (setRelOp.Contains(static_cast(*cp))) {
+ word += *cp;
+ cp++;
+ }
+ } else if (setLogicalOp.Contains(static_cast(*cp))) {
+ word += *cp;
+ cp++;
+ if (setLogicalOp.Contains(static_cast(*cp))) {
+ word += *cp;
+ cp++;
+ }
} else {
- std::map::const_iterator it = preprocessorDefinitions.find(word);
- if (it != preprocessorDefinitions.end()) {
- tokens.push_back(it->second);
- } else if (!word.empty() && ((word[0] >= '0' && word[0] <= '9') || (word == "defined"))) {
- tokens.push_back(word);
- }
- word = "";
- if (!*cp) {
- break;
- }
- if ((*cp != ' ') && (*cp != '\t')) {
- std::string op(cp, 1);
- if (setRelOp.Contains(static_cast(*cp))) {
- if (setRelOp.Contains(static_cast(cp[1]))) {
- op += cp[1];
- cp++;
- }
- } else if (setLogicalOp.Contains(static_cast(*cp))) {
- if (setLogicalOp.Contains(static_cast(cp[1]))) {
- op += cp[1];
- cp++;
- }
- }
- tokens.push_back(op);
- }
+ // Should handle strings, characters, and comments here
+ word += *cp;
+ cp++;
}
- cp++;
+ tokens.push_back(word);
}
+ return tokens;
+}
- EvaluateTokens(tokens);
+bool LexerCPP::EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions) {
+ std::vector tokens = Tokenize(expr);
+
+ EvaluateTokens(tokens, preprocessorDefinitions);
// "0" or "" -> false else true
bool isFalse = tokens.empty() ||
diff --git a/src/stc/scintilla/lexers/LexCoffeeScript.cxx b/src/stc/scintilla/lexers/LexCoffeeScript.cxx
index fc9b4998a9..c52a5a42bf 100644
--- a/src/stc/scintilla/lexers/LexCoffeeScript.cxx
+++ b/src/stc/scintilla/lexers/LexCoffeeScript.cxx
@@ -158,7 +158,7 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart) {
- // Reset states to begining of colourise so no surprises
+ // Reset states to beginning of colourise so no surprises
// if different sets of lines lexed.
visibleChars = 0;
lastWordWasUUID = false;
diff --git a/src/stc/scintilla/lexers/LexDMIS.cxx b/src/stc/scintilla/lexers/LexDMIS.cxx
new file mode 100644
index 0000000000..7f23ba96b7
--- /dev/null
+++ b/src/stc/scintilla/lexers/LexDMIS.cxx
@@ -0,0 +1,355 @@
+// Scintilla source code edit control
+/** @file LexDMIS.cxx
+ ** Lexer for DMIS.
+ **/
+// Copyright 1998-2005 by Neil Hodgson
+// Copyright 2013-2014 by Andreas Tscharner
+// The License.txt file describes the conditions under which this software may be distributed.
+
+
+#include
+#include
+#include
+#include
+
+#include "ILexer.h"
+#include "SciLexer.h"
+#include "Scintilla.h"
+
+#include "LexerModule.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "WordList.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static const char *const DMISWordListDesc[] = {
+ "DMIS Major Words",
+ "DMIS Minor Words",
+ "Unsupported DMIS Major Words",
+ "Unsupported DMIS Minor Words",
+ "Keywords for code folding start",
+ "Corresponding keywords for code folding end",
+ 0
+};
+
+
+class LexerDMIS : public ILexer
+{
+ private:
+ char *m_wordListSets;
+ WordList m_majorWords;
+ WordList m_minorWords;
+ WordList m_unsupportedMajor;
+ WordList m_unsupportedMinor;
+ WordList m_codeFoldingStart;
+ WordList m_codeFoldingEnd;
+
+ char * SCI_METHOD UpperCase(char *item);
+ void SCI_METHOD InitWordListSets(void);
+
+ public:
+ LexerDMIS(void);
+ virtual ~LexerDMIS(void);
+
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+
+ void SCI_METHOD Release() {
+ delete this;
+ }
+
+ const char * SCI_METHOD PropertyNames() {
+ return NULL;
+ }
+
+ int SCI_METHOD PropertyType(const char *) {
+ return -1;
+ }
+
+ const char * SCI_METHOD DescribeProperty(const char *) {
+ return NULL;
+ }
+
+ int SCI_METHOD PropertySet(const char *, const char *) {
+ return -1;
+ }
+
+ int SCI_METHOD WordListSet(int n, const char *wl);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return NULL;
+ }
+
+ static ILexer *LexerFactoryDMIS() {
+ return new LexerDMIS;
+ }
+
+ const char * SCI_METHOD DescribeWordListSets();
+ void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+};
+
+
+char * SCI_METHOD LexerDMIS::UpperCase(char *item)
+{
+ char *itemStart;
+
+
+ itemStart = item;
+ while (item && *item) {
+ *item = toupper(*item);
+ item++;
+ };
+ return itemStart;
+}
+
+void SCI_METHOD LexerDMIS::InitWordListSets(void)
+{
+ size_t totalLen = 0;
+
+
+ for (int i=0; DMISWordListDesc[i]; i++) {
+ totalLen += strlen(DMISWordListDesc[i]);
+ totalLen++;
+ };
+
+ totalLen++;
+ this->m_wordListSets = new char[totalLen];
+ memset(this->m_wordListSets, 0, totalLen);
+
+ for (int i=0; DMISWordListDesc[i]; i++) {
+ strcat(this->m_wordListSets, DMISWordListDesc[i]);
+ strcat(this->m_wordListSets, "\n");
+ };
+}
+
+
+LexerDMIS::LexerDMIS(void) {
+ this->InitWordListSets();
+
+ this->m_majorWords.Clear();
+ this->m_minorWords.Clear();
+ this->m_unsupportedMajor.Clear();
+ this->m_unsupportedMinor.Clear();
+ this->m_codeFoldingStart.Clear();
+ this->m_codeFoldingEnd.Clear();
+}
+
+LexerDMIS::~LexerDMIS(void) {
+ delete[] this->m_wordListSets;
+}
+
+int SCI_METHOD LexerDMIS::WordListSet(int n, const char *wl)
+{
+ switch (n) {
+ case 0:
+ this->m_majorWords.Clear();
+ this->m_majorWords.Set(wl);
+ break;
+ case 1:
+ this->m_minorWords.Clear();
+ this->m_minorWords.Set(wl);
+ break;
+ case 2:
+ this->m_unsupportedMajor.Clear();
+ this->m_unsupportedMajor.Set(wl);
+ break;
+ case 3:
+ this->m_unsupportedMinor.Clear();
+ this->m_unsupportedMinor.Set(wl);
+ break;
+ case 4:
+ this->m_codeFoldingStart.Clear();
+ this->m_codeFoldingStart.Set(wl);
+ break;
+ case 5:
+ this->m_codeFoldingEnd.Clear();
+ this->m_codeFoldingEnd.Set(wl);
+ break;
+ default:
+ return -1;
+ break;
+ }
+
+ return 0;
+}
+
+const char * SCI_METHOD LexerDMIS::DescribeWordListSets()
+{
+ return this->m_wordListSets;
+}
+
+void SCI_METHOD LexerDMIS::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess)
+{
+ const unsigned int MAX_STR_LEN = 100;
+
+ LexAccessor styler(pAccess);
+ StyleContext scCTX(startPos, lengthDoc, initStyle, styler);
+ CharacterSet setDMISNumber(CharacterSet::setDigits, ".-+eE");
+ CharacterSet setDMISWordStart(CharacterSet::setAlpha, "-234", 0x80, true);
+ CharacterSet setDMISWord(CharacterSet::setAlpha);
+
+
+ bool isIFLine = false;
+
+ for (; scCTX.More(); scCTX.Forward()) {
+ if (scCTX.atLineEnd) {
+ isIFLine = false;
+ };
+
+ switch (scCTX.state) {
+ case SCE_DMIS_DEFAULT:
+ if (scCTX.Match('$', '$')) {
+ scCTX.SetState(SCE_DMIS_COMMENT);
+ scCTX.Forward();
+ };
+ if (scCTX.Match('\'')) {
+ scCTX.SetState(SCE_DMIS_STRING);
+ };
+ if (IsADigit(scCTX.ch) || ((scCTX.Match('-') || scCTX.Match('+')) && IsADigit(scCTX.chNext))) {
+ scCTX.SetState(SCE_DMIS_NUMBER);
+ break;
+ };
+ if (setDMISWordStart.Contains(scCTX.ch)) {
+ scCTX.SetState(SCE_DMIS_KEYWORD);
+ };
+ if (scCTX.Match('(') && (!isIFLine)) {
+ scCTX.SetState(SCE_DMIS_LABEL);
+ };
+ break;
+
+ case SCE_DMIS_COMMENT:
+ if (scCTX.atLineEnd) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+
+ case SCE_DMIS_STRING:
+ if (scCTX.Match('\'')) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+
+ case SCE_DMIS_NUMBER:
+ if (!setDMISNumber.Contains(scCTX.ch)) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+
+ case SCE_DMIS_KEYWORD:
+ if (!setDMISWord.Contains(scCTX.ch)) {
+ char tmpStr[MAX_STR_LEN];
+ memset(tmpStr, 0, MAX_STR_LEN*sizeof(char));
+ scCTX.GetCurrent(tmpStr, (MAX_STR_LEN-1));
+ strncpy(tmpStr, this->UpperCase(tmpStr), (MAX_STR_LEN-1));
+
+ if (this->m_minorWords.InList(tmpStr)) {
+ scCTX.ChangeState(SCE_DMIS_MINORWORD);
+ };
+ if (this->m_majorWords.InList(tmpStr)) {
+ isIFLine = (strcmp(tmpStr, "IF") == 0);
+ scCTX.ChangeState(SCE_DMIS_MAJORWORD);
+ };
+ if (this->m_unsupportedMajor.InList(tmpStr)) {
+ scCTX.ChangeState(SCE_DMIS_UNSUPPORTED_MAJOR);
+ };
+ if (this->m_unsupportedMinor.InList(tmpStr)) {
+ scCTX.ChangeState(SCE_DMIS_UNSUPPORTED_MINOR);
+ };
+
+ if (scCTX.Match('(') && (!isIFLine)) {
+ scCTX.SetState(SCE_DMIS_LABEL);
+ } else {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ };
+ break;
+
+ case SCE_DMIS_LABEL:
+ if (scCTX.Match(')')) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+ };
+ };
+ scCTX.Complete();
+}
+
+void SCI_METHOD LexerDMIS::Fold(unsigned int startPos, int lengthDoc, int, IDocument *pAccess)
+{
+ const int MAX_STR_LEN = 100;
+
+ LexAccessor styler(pAccess);
+ unsigned int endPos = startPos + lengthDoc;
+ char chNext = styler[startPos];
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ int strPos = 0;
+ bool foldWordPossible = false;
+ CharacterSet setDMISFoldWord(CharacterSet::setAlpha);
+ char *tmpStr;
+
+
+ tmpStr = new char[MAX_STR_LEN];
+ memset(tmpStr, 0, MAX_STR_LEN*sizeof(char));
+
+ for (unsigned int i=startPos; i= (MAX_STR_LEN-1)) {
+ strPos = MAX_STR_LEN-1;
+ };
+
+ int style = styler.StyleAt(i);
+ bool noFoldPos = ((style == SCE_DMIS_COMMENT) || (style == SCE_DMIS_STRING));
+
+ if (foldWordPossible) {
+ if (setDMISFoldWord.Contains(ch)) {
+ tmpStr[strPos++] = ch;
+ } else {
+ tmpStr = this->UpperCase(tmpStr);
+ if (this->m_codeFoldingStart.InList(tmpStr) && (!noFoldPos)) {
+ levelCurrent++;
+ };
+ if (this->m_codeFoldingEnd.InList(tmpStr) && (!noFoldPos)) {
+ levelCurrent--;
+ };
+ memset(tmpStr, 0, MAX_STR_LEN*sizeof(char));
+ strPos = 0;
+ foldWordPossible = false;
+ };
+ } else {
+ if (setDMISFoldWord.Contains(ch)) {
+ tmpStr[strPos++] = ch;
+ foldWordPossible = true;
+ };
+ };
+
+ if (atEOL || (i == (endPos-1))) {
+ int lev = levelPrev;
+
+ if (levelCurrent > levelPrev) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ };
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ };
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ };
+ };
+ delete[] tmpStr;
+}
+
+
+LexerModule lmDMIS(SCLEX_DMIS, LexerDMIS::LexerFactoryDMIS, "DMIS", DMISWordListDesc);
diff --git a/src/stc/scintilla/lexers/LexFortran.cxx b/src/stc/scintilla/lexers/LexFortran.cxx
index 0c65a6ca50..5deaf11737 100644
--- a/src/stc/scintilla/lexers/LexFortran.cxx
+++ b/src/stc/scintilla/lexers/LexFortran.cxx
@@ -1,7 +1,7 @@
// Scintilla source code edit control
/** @file LexFortran.cxx
** Lexer for Fortran.
- ** Writen by Chuan-jian Shen, Last changed Sep. 2003
+ ** Written by Chuan-jian Shen, Last changed Sep. 2003
**/
// Copyright 1998-2001 by Neil Hodgson
// The License.txt file describes the conditions under which this software may be distributed.
@@ -455,11 +455,11 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
if (strcmp(s, "do") == 0 && IsADigit(chNextNonBlank)) {
// Remove delta for do-label
levelDeltaNext -= wordLevelDelta;
- }
}
+ }
strcpy(prevWord, s);
}
- }
+ }
if (atEOL) {
int lev = levelCurrent;
if (visibleChars == 0 && foldCompact)
diff --git a/src/stc/scintilla/lexers/LexHTML.cxx b/src/stc/scintilla/lexers/LexHTML.cxx
index 5ea24d481d..f5da934d2a 100644
--- a/src/stc/scintilla/lexers/LexHTML.cxx
+++ b/src/stc/scintilla/lexers/LexHTML.cxx
@@ -577,7 +577,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords
// Lexer for HTML requires more lexical states (8 bits worth) than most lexers
- styler.StartAt(startPos, static_cast(STYLE_MAX));
+ styler.StartAt(startPos, static_cast(STYLE_MAX));
char prevWord[200];
prevWord[0] = '\0';
char phpStringDelimiter[200]; // PHP is not limited in length, we are
@@ -609,7 +609,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (startPos == 0)
state = SCE_H_DEFAULT;
}
- styler.StartAt(startPos, static_cast(STYLE_MAX));
+ styler.StartAt(startPos, static_cast(STYLE_MAX));
int lineCurrent = styler.GetLine(startPos);
int lineState;
@@ -811,8 +811,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
styler.SetLineState(lineCurrent,
((inScriptType & 0x03) << 0) |
- ((tagOpened & 0x01) << 2) |
- ((tagClosing & 0x01) << 3) |
+ ((tagOpened ? 1 : 0) << 2) |
+ ((tagClosing ? 1 : 0) << 3) |
((aspScript & 0x0F) << 4) |
((clientScript & 0x0F) << 8) |
((beforePreProc & 0xFF) << 12));
diff --git a/src/stc/scintilla/lexers/LexKVIrc.cxx b/src/stc/scintilla/lexers/LexKVIrc.cxx
index 67bcb43a6c..958a2cf67c 100644
--- a/src/stc/scintilla/lexers/LexKVIrc.cxx
+++ b/src/stc/scintilla/lexers/LexKVIrc.cxx
@@ -359,7 +359,7 @@ static void FoldKVIrcDoc(unsigned int startPos, int length, int /*initStyle - un
WordList *[], Accessor &styler)
{
/* Based on CMake's folder */
-
+
/* Exiting if folding isnt enabled */
if ( styler.GetPropertyInt("fold") == 0 )
return;
diff --git a/src/stc/scintilla/lexers/LexLaTeX.cxx b/src/stc/scintilla/lexers/LexLaTeX.cxx
index 7cfa8a197f..f8af1e7dcc 100644
--- a/src/stc/scintilla/lexers/LexLaTeX.cxx
+++ b/src/stc/scintilla/lexers/LexLaTeX.cxx
@@ -60,7 +60,7 @@ private:
if (static_cast(modes.size()) > numLines * 2 + 256)
modes.resize(numLines + 128);
}
-
+
vector saves;
void setSave(int line, const latexFoldSave &save) {
if (line >= static_cast(saves.size())) saves.resize(line + 1);
@@ -192,7 +192,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
int state = initStyle;
if (state == SCE_L_ERROR || state == SCE_L_SHORTCMD || state == SCE_L_SPECIAL) // should not happen
latexStateReset(mode, state);
-
+
char chNext = styler.SafeGetCharAt(startPos);
char chVerbatimDelim = '\0';
styler.StartSegment(startPos);
@@ -207,7 +207,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
chNext = styler.SafeGetCharAt(i + 1);
continue;
}
-
+
if (ch == '\r' || ch == '\n')
setMode(styler.GetLine(i), mode);
@@ -256,7 +256,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
state = SCE_L_COMMENT;
break;
}
- break;
+ break;
// These 3 will never be reached.
case SCE_L_ERROR:
case SCE_L_SPECIAL:
@@ -400,7 +400,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
chNext = styler.SafeGetCharAt(i + 1);
mode = 0;
state = SCE_L_DEFAULT;
- } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation}
+ } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation}
styler.ColourTo(i, SCE_L_SHORTCMD);
}
break;
diff --git a/src/stc/scintilla/lexers/LexLua.cxx b/src/stc/scintilla/lexers/LexLua.cxx
index 62bb44dd1c..fd0d70fd4d 100644
--- a/src/stc/scintilla/lexers/LexLua.cxx
+++ b/src/stc/scintilla/lexers/LexLua.cxx
@@ -141,7 +141,7 @@ static void ColouriseLuaDoc(
char s[100];
while (setWord.Contains(c = sc.GetRelative(ln))) { // get potential label
if (i < 90)
- s[i++] = c;
+ s[i++] = static_cast(c);
ln++;
}
s[i] = '\0'; int lbl = ln;
diff --git a/src/stc/scintilla/lexers/LexMatlab.cxx b/src/stc/scintilla/lexers/LexMatlab.cxx
index 6fbbc438e0..a8ac03cc7f 100644
--- a/src/stc/scintilla/lexers/LexMatlab.cxx
+++ b/src/stc/scintilla/lexers/LexMatlab.cxx
@@ -64,7 +64,7 @@ static void ColouriseMatlabOctaveDoc(
styler.StartAt(startPos);
- // boolean for when the ' is allowed to be transpose vs the start/end
+ // boolean for when the ' is allowed to be transpose vs the start/end
// of a string
bool transpose = false;
@@ -82,14 +82,14 @@ static void ColouriseMatlabOctaveDoc(
for (; sc.More(); sc.Forward(), column++) {
- if(sc.atLineStart) {
- // set the line state to the current commentDepth
+ if(sc.atLineStart) {
+ // set the line state to the current commentDepth
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
// reset the column to 0, nonSpace to -1 (not set)
column = 0;
- nonSpaceColumn = -1;
+ nonSpaceColumn = -1;
}
// save the column position of first non space character in a line
@@ -108,7 +108,7 @@ static void ColouriseMatlabOctaveDoc(
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
transpose = true;
} else if(sc.ch == '.' && sc.chNext == '.') {
- // we werent an operator, but a '...'
+ // we werent an operator, but a '...'
sc.ChangeState(SCE_MATLAB_COMMENT);
transpose = false;
} else {
@@ -161,8 +161,8 @@ static void ColouriseMatlabOctaveDoc(
} else if (sc.state == SCE_MATLAB_COMMENT) {
// end or start of a nested a block comment?
if( IsCommentChar(sc.ch) && sc.chNext == '}' && nonSpaceColumn == column) {
- if(commentDepth > 0) commentDepth --;
-
+ if(commentDepth > 0) commentDepth --;
+
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
sc.Forward();
@@ -174,7 +174,7 @@ static void ColouriseMatlabOctaveDoc(
}
else if( IsCommentChar(sc.ch) && sc.chNext == '{' && nonSpaceColumn == column)
{
- commentDepth ++;
+ commentDepth ++;
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
diff --git a/src/stc/scintilla/lexers/LexPO.cxx b/src/stc/scintilla/lexers/LexPO.cxx
index fb0c769241..7b44107cfa 100644
--- a/src/stc/scintilla/lexers/LexPO.cxx
+++ b/src/stc/scintilla/lexers/LexPO.cxx
@@ -41,7 +41,7 @@ static void ColourisePODoc(unsigned int startPos, int length, int initStyle, Wor
int curLine = styler.GetLine(startPos);
// the line state holds the last state on or before the line that isn't the default style
int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : SCE_PO_DEFAULT;
-
+
for (; sc.More(); sc.Forward()) {
// whether we should leave a state
switch (sc.state) {
@@ -57,19 +57,19 @@ static void ColourisePODoc(unsigned int startPos, int length, int initStyle, Wor
// on its own like a keyword rather than changing the whole flags style
sc.ChangeState(SCE_PO_FUZZY);
break;
-
+
case SCE_PO_MSGCTXT:
case SCE_PO_MSGID:
case SCE_PO_MSGSTR:
if (isspacechar(sc.ch))
sc.SetState(SCE_PO_DEFAULT);
break;
-
+
case SCE_PO_ERROR:
if (sc.atLineEnd)
sc.SetState(SCE_PO_DEFAULT);
break;
-
+
case SCE_PO_MSGCTXT_TEXT:
case SCE_PO_MSGID_TEXT:
case SCE_PO_MSGSTR_TEXT:
@@ -92,7 +92,7 @@ static void ColourisePODoc(unsigned int startPos, int length, int initStyle, Wor
}
break;
}
-
+
// whether we should enter a new state
if (sc.state == SCE_PO_DEFAULT) {
// forward to the first non-white character on the line
@@ -103,11 +103,11 @@ static void ColourisePODoc(unsigned int startPos, int length, int initStyle, Wor
// and anyway the styling don't use line state for comments
if (curLineState == SCE_PO_COMMENT)
curLineState = SCE_PO_DEFAULT;
-
+
while (sc.More() && ! sc.atLineEnd && isspacechar(sc.ch))
sc.Forward();
}
-
+
if (atLineStart && sc.ch == '#') {
if (sc.chNext == '.')
sc.SetState(SCE_PO_PROGRAMMER_COMMENT);
@@ -134,11 +134,11 @@ static void ColourisePODoc(unsigned int startPos, int length, int initStyle, Wor
sc.SetState(SCE_PO_ERROR);
} else if (! isspacechar(sc.ch))
sc.SetState(SCE_PO_ERROR);
-
+
if (sc.state != SCE_PO_DEFAULT)
curLineState = sc.state;
}
-
+
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
curLine = styler.GetLine(sc.currentPos);
@@ -163,7 +163,7 @@ static void FoldPODoc(unsigned int startPos, int length, int, WordList *[], Acce
return;
bool foldCompact = styler.GetPropertyInt("fold.compact") != 0;
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
-
+
unsigned int endPos = startPos + length;
int curLine = styler.GetLine(startPos);
int lineState = styler.GetLineState(curLine);
@@ -172,17 +172,17 @@ static void FoldPODoc(unsigned int startPos, int length, int, WordList *[], Acce
int nextLevel;
int visible = 0;
int chNext = styler[startPos];
-
+
for (unsigned int i = startPos; i < endPos; i++) {
int ch = chNext;
chNext = styler.SafeGetCharAt(i+1);
-
+
if (! isspacechar(ch)) {
visible++;
} else if ((ch == '\r' && chNext != '\n') || ch == '\n' || i+1 >= endPos) {
int lvl = level;
int nextLine = curLine + 1;
-
+
nextLineState = styler.GetLineState(nextLine);
if ((lineState != SCE_PO_COMMENT || foldComment) &&
nextLineState == lineState &&
@@ -190,14 +190,14 @@ static void FoldPODoc(unsigned int startPos, int length, int, WordList *[], Acce
nextLevel = SC_FOLDLEVELBASE + 1;
else
nextLevel = SC_FOLDLEVELBASE;
-
+
if (nextLevel > level)
lvl |= SC_FOLDLEVELHEADERFLAG;
if (visible == 0 && foldCompact)
lvl |= SC_FOLDLEVELWHITEFLAG;
-
+
styler.SetLevel(curLine, lvl);
-
+
lineState = nextLineState;
curLine = nextLine;
level = nextLevel;
diff --git a/src/stc/scintilla/lexers/LexPerl.cxx b/src/stc/scintilla/lexers/LexPerl.cxx
index 5a7447af31..8fa516b34f 100644
--- a/src/stc/scintilla/lexers/LexPerl.cxx
+++ b/src/stc/scintilla/lexers/LexPerl.cxx
@@ -662,7 +662,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
} else if (initStyle == SCE_PL_POD
|| initStyle == SCE_PL_POD_VERB
) {
- // POD backtracking finds preceeding blank lines and goes back past them
+ // POD backtracking finds preceding blank lines and goes back past them
int ln = styler.GetLine(startPos);
if (ln > 0) {
initStyle = styler.StyleAt(styler.LineStart(--ln));
@@ -1159,12 +1159,12 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
sc.ForwardSetState(SCE_PL_DEFAULT);
HereDoc.State = 3;
} else {
- // invalid indentifier; inexact fallback, but hey
+ // invalid identifier; inexact fallback, but hey
sc.ChangeState(SCE_PL_IDENTIFIER);
sc.SetState(SCE_PL_DEFAULT);
}
} else {
- sc.ChangeState(SCE_PL_DEFAULT); // invalid indentifier
+ sc.ChangeState(SCE_PL_DEFAULT); // invalid identifier
}
backFlag = BACK_NONE;
break;
diff --git a/src/stc/scintilla/lexers/LexRuby.cxx b/src/stc/scintilla/lexers/LexRuby.cxx
index 833ad59288..e19a5147e7 100644
--- a/src/stc/scintilla/lexers/LexRuby.cxx
+++ b/src/stc/scintilla/lexers/LexRuby.cxx
@@ -731,7 +731,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
// If anyone runs into this problem, I recommend raising this
// value slightly higher to replacing the fixed array with a linked
- // list. Keep in mind this code will be called everytime the lexer
+ // list. Keep in mind this code will be called every time the lexer
// is invoked.
#define INNER_STRINGS_MAX_COUNT 5
diff --git a/src/stc/scintilla/lexers/LexRust.cxx b/src/stc/scintilla/lexers/LexRust.cxx
index 501b9a8230..bf59933afb 100644
--- a/src/stc/scintilla/lexers/LexRust.cxx
+++ b/src/stc/scintilla/lexers/LexRust.cxx
@@ -292,7 +292,7 @@ static void ScanNumber(Accessor& styler, int& pos) {
error = true;
}
}
-
+
c = styler.SafeGetCharAt(pos, '\0');
if (c == 'f') {
error |= base != 10;
@@ -600,7 +600,7 @@ static void ResumeRawString(Accessor &styler, int& pos, int max, int num_hashes)
} else if (pos >= max) {
styler.ColourTo(pos - 1, SCE_RUST_STRINGR);
break;
- } else {
+ } else {
pos++;
}
}
diff --git a/src/stc/scintilla/lexers/LexSTTXT.cxx b/src/stc/scintilla/lexers/LexSTTXT.cxx
index 49ac7bdbb1..e1d2d371fe 100644
--- a/src/stc/scintilla/lexers/LexSTTXT.cxx
+++ b/src/stc/scintilla/lexers/LexSTTXT.cxx
@@ -33,9 +33,9 @@ static void ClassifySTTXTWord(WordList *keywordlists[], StyleContext &sc)
char s[256] = { 0 };
sc.GetCurrentLowered(s, sizeof(s));
- if ((*keywordlists[0]).InList(s)) {
- sc.ChangeState(SCE_STTXT_KEYWORD);
- }
+ if ((*keywordlists[0]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_KEYWORD);
+ }
else if ((*keywordlists[1]).InList(s)) {
sc.ChangeState(SCE_STTXT_TYPE);
@@ -72,8 +72,8 @@ static void ColouriseSTTXTDoc (unsigned int startPos, int length, int initStyle,
CharacterSet setOperator(CharacterSet::setNone,",.+-*/:;<=>[]()%&");
CharacterSet setDataTime(CharacterSet::setDigits,"_.-:dmshDMSH");
- for ( ; sc.More() ; sc.Forward())
- {
+ for ( ; sc.More() ; sc.Forward())
+ {
if(sc.atLineStart && sc.state != SCE_STTXT_COMMENT)
sc.SetState(SCE_STTXT_DEFAULT);
@@ -181,7 +181,7 @@ static void ColouriseSTTXTDoc (unsigned int startPos, int length, int initStyle,
else if (setOperator.Contains(sc.ch))
sc.SetState(SCE_STTXT_OPERATOR);
}
- }
+ }
if (sc.state == SCE_STTXT_IDENTIFIER && setWord.Contains(sc.chPrev))
ClassifySTTXTWord(keywordlists, sc);
@@ -355,7 +355,7 @@ static void FoldSTTXTDoc(unsigned int startPos, int length, int initStyle, WordL
}
if ( foldComment && atEOL && ( IsCommentLine(lineCurrent, styler,false)
|| IsCommentLine(lineCurrent,styler,true))) {
- if(!IsCommentLine(lineCurrent-1, styler,true) && IsCommentLine(lineCurrent+1, styler,true))
+ if(!IsCommentLine(lineCurrent-1, styler,true) && IsCommentLine(lineCurrent+1, styler,true))
levelCurrent++;
if (IsCommentLine(lineCurrent-1, styler,true) && !IsCommentLine(lineCurrent+1, styler,true))
levelCurrent--;
diff --git a/src/stc/scintilla/lexers/LexVisualProlog.cxx b/src/stc/scintilla/lexers/LexVisualProlog.cxx
index b89353dc7b..0acdb26a1c 100644
--- a/src/stc/scintilla/lexers/LexVisualProlog.cxx
+++ b/src/stc/scintilla/lexers/LexVisualProlog.cxx
@@ -396,7 +396,7 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
int lineState = 0;
- if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) {
+ if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) {
lineState = closingQuote;
} else if (SCE_VISUALPROLOG_COMMENT_BLOCK == sc.state) {
lineState = nestLevel;
diff --git a/src/stc/scintilla/lexlib/LexerModule.h b/src/stc/scintilla/lexlib/LexerModule.h
index e502541b2d..35fa30c69b 100644
--- a/src/stc/scintilla/lexlib/LexerModule.h
+++ b/src/stc/scintilla/lexlib/LexerModule.h
@@ -72,7 +72,7 @@ inline int Maximum(int a, int b) {
// Shut up annoying Visual C++ warnings:
#ifdef _MSC_VER
-#pragma warning(disable: 4244 4309 4514 4710)
+#pragma warning(disable: 4244 4309)
#endif
#ifdef SCI_NAMESPACE
diff --git a/src/stc/scintilla/lexlib/PropSetSimple.cxx b/src/stc/scintilla/lexlib/PropSetSimple.cxx
index 6f4553a07c..6592d70eb3 100644
--- a/src/stc/scintilla/lexlib/PropSetSimple.cxx
+++ b/src/stc/scintilla/lexlib/PropSetSimple.cxx
@@ -11,11 +11,6 @@
#include
#include
-#ifdef _MSC_VER
-// Visual C++ doesn't like unreachable code in its own headers.
-#pragma warning(disable: 4018 4100 4245 4511 4512 4663 4702)
-#endif
-
#include
#include