Upgrade included Scintilla to version 3.3.9.

Closes #15742.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-03-12 13:23:54 +00:00
parent b356d1d3c7
commit d6ace87b61
164 changed files with 14615 additions and 4325 deletions

View File

@@ -247,6 +247,7 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexCsound.o \
wxscintilla_LexCSS.o \
wxscintilla_LexD.o \
wxscintilla_LexDMAP.o \
wxscintilla_LexECL.o \
wxscintilla_LexEiffel.o \
wxscintilla_LexErlang.o \
@@ -260,6 +261,8 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexHTML.o \
wxscintilla_LexInno.o \
wxscintilla_LexKix.o \
wxscintilla_LexKVIrc.o \
wxscintilla_LexLaTeX.o \
wxscintilla_LexLisp.o \
wxscintilla_LexLout.o \
wxscintilla_LexLua.o \
@@ -281,6 +284,7 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexPB.o \
wxscintilla_LexPerl.o \
wxscintilla_LexPLM.o \
wxscintilla_LexPO.o \
wxscintilla_LexPOV.o \
wxscintilla_LexPowerPro.o \
wxscintilla_LexPowerShell.o \
@@ -290,6 +294,7 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexR.o \
wxscintilla_LexRebol.o \
wxscintilla_LexRuby.o \
wxscintilla_LexRust.o \
wxscintilla_LexScriptol.o \
wxscintilla_LexSmalltalk.o \
wxscintilla_LexSML.o \
@@ -297,6 +302,7 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexSpecman.o \
wxscintilla_LexSpice.o \
wxscintilla_LexSQL.o \
wxscintilla_LexSTTXT.o \
wxscintilla_LexTACL.o \
wxscintilla_LexTADS3.o \
wxscintilla_LexTAL.o \
@@ -310,6 +316,7 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_LexVisualProlog.o \
wxscintilla_LexYAML.o \
wxscintilla_Accessor.o \
wxscintilla_CharacterCategory.o \
wxscintilla_CharacterSet.o \
wxscintilla_LexerBase.o \
wxscintilla_LexerModule.o \
@@ -320,6 +327,8 @@ WXSCINTILLA_OBJECTS = \
wxscintilla_WordList.o \
wxscintilla_AutoComplete.o \
wxscintilla_CallTip.o \
wxscintilla_CaseConvert.o \
wxscintilla_CaseFolder.o \
wxscintilla_Catalogue.o \
wxscintilla_CellBuffer.o \
wxscintilla_CharClassify.o \
@@ -16600,6 +16609,9 @@ wxscintilla_LexCSS.o: $(srcdir)/src/stc/scintilla/lexers/LexCSS.cxx
wxscintilla_LexD.o: $(srcdir)/src/stc/scintilla/lexers/LexD.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(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_LexECL.o: $(srcdir)/src/stc/scintilla/lexers/LexECL.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexECL.cxx
@@ -16639,6 +16651,12 @@ wxscintilla_LexInno.o: $(srcdir)/src/stc/scintilla/lexers/LexInno.cxx
wxscintilla_LexKix.o: $(srcdir)/src/stc/scintilla/lexers/LexKix.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexKix.cxx
wxscintilla_LexKVIrc.o: $(srcdir)/src/stc/scintilla/lexers/LexKVIrc.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexKVIrc.cxx
wxscintilla_LexLaTeX.o: $(srcdir)/src/stc/scintilla/lexers/LexLaTeX.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexLaTeX.cxx
wxscintilla_LexLisp.o: $(srcdir)/src/stc/scintilla/lexers/LexLisp.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexLisp.cxx
@@ -16702,6 +16720,9 @@ wxscintilla_LexPerl.o: $(srcdir)/src/stc/scintilla/lexers/LexPerl.cxx
wxscintilla_LexPLM.o: $(srcdir)/src/stc/scintilla/lexers/LexPLM.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexPLM.cxx
wxscintilla_LexPO.o: $(srcdir)/src/stc/scintilla/lexers/LexPO.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexPO.cxx
wxscintilla_LexPOV.o: $(srcdir)/src/stc/scintilla/lexers/LexPOV.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexPOV.cxx
@@ -16729,6 +16750,9 @@ wxscintilla_LexRebol.o: $(srcdir)/src/stc/scintilla/lexers/LexRebol.cxx
wxscintilla_LexRuby.o: $(srcdir)/src/stc/scintilla/lexers/LexRuby.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexRuby.cxx
wxscintilla_LexRust.o: $(srcdir)/src/stc/scintilla/lexers/LexRust.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexRust.cxx
wxscintilla_LexScriptol.o: $(srcdir)/src/stc/scintilla/lexers/LexScriptol.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexScriptol.cxx
@@ -16750,6 +16774,9 @@ wxscintilla_LexSpice.o: $(srcdir)/src/stc/scintilla/lexers/LexSpice.cxx
wxscintilla_LexSQL.o: $(srcdir)/src/stc/scintilla/lexers/LexSQL.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexSQL.cxx
wxscintilla_LexSTTXT.o: $(srcdir)/src/stc/scintilla/lexers/LexSTTXT.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexSTTXT.cxx
wxscintilla_LexTACL.o: $(srcdir)/src/stc/scintilla/lexers/LexTACL.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexers/LexTACL.cxx
@@ -16789,6 +16816,9 @@ wxscintilla_LexYAML.o: $(srcdir)/src/stc/scintilla/lexers/LexYAML.cxx
wxscintilla_Accessor.o: $(srcdir)/src/stc/scintilla/lexlib/Accessor.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexlib/Accessor.cxx
wxscintilla_CharacterCategory.o: $(srcdir)/src/stc/scintilla/lexlib/CharacterCategory.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexlib/CharacterCategory.cxx
wxscintilla_CharacterSet.o: $(srcdir)/src/stc/scintilla/lexlib/CharacterSet.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/lexlib/CharacterSet.cxx
@@ -16819,6 +16849,12 @@ wxscintilla_AutoComplete.o: $(srcdir)/src/stc/scintilla/src/AutoComplete.cxx
wxscintilla_CallTip.o: $(srcdir)/src/stc/scintilla/src/CallTip.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/CallTip.cxx
wxscintilla_CaseConvert.o: $(srcdir)/src/stc/scintilla/src/CaseConvert.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/CaseConvert.cxx
wxscintilla_CaseFolder.o: $(srcdir)/src/stc/scintilla/src/CaseFolder.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/CaseFolder.cxx
wxscintilla_Catalogue.o: $(srcdir)/src/stc/scintilla/src/Catalogue.cxx
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/Catalogue.cxx
@@ -40771,6 +40807,7 @@ ALL_GUI_DIST: ALL_DIST
mkdir $(DISTDIR)/include/wx/generic/private
mkdir $(DISTDIR)/include/wx/html
mkdir $(DISTDIR)/include/wx/richtext
mkdir $(DISTDIR)/include/wx/richtext/bitmaps
mkdir $(DISTDIR)/include/wx/aui
mkdir $(DISTDIR)/include/wx/ribbon
mkdir $(DISTDIR)/include/wx/persist
@@ -40788,6 +40825,7 @@ ALL_GUI_DIST: ALL_DIST
$(CP_P) $(INCDIR)/wx/generic/private/*.h $(DISTDIR)/include/wx/generic/private
$(CP_P) $(INCDIR)/wx/html/*.h $(DISTDIR)/include/wx/html
$(CP_P) $(INCDIR)/wx/richtext/*.h $(DISTDIR)/include/wx/richtext
$(CP_P) $(INCDIR)/wx/richtext/bitmaps/*.xpm $(DISTDIR)/include/wx/richtext/bitmaps
$(CP_P) $(INCDIR)/wx/aui/*.h $(DISTDIR)/include/wx/aui
$(CP_P) $(INCDIR)/wx/ribbon/*.h $(DISTDIR)/include/wx/ribbon
$(CP_P) $(INCDIR)/wx/persist/*.h $(DISTDIR)/include/wx/persist
@@ -40898,6 +40936,7 @@ BASE_DIST: ALL_DIST INTL_DIST
mkdir $(DISTDIR)/include/wx/msw
mkdir $(DISTDIR)/include/wx/html
mkdir $(DISTDIR)/include/wx/richtext
mkdir $(DISTDIR)/include/wx/richtext/bitmaps
mkdir $(DISTDIR)/include/wx/aui
mkdir $(DISTDIR)/include/wx/ribbon
mkdir $(DISTDIR)/include/wx/persist

View File

@@ -81,6 +81,7 @@
src/stc/scintilla/lexers/LexCsound.cxx
src/stc/scintilla/lexers/LexCSS.cxx
src/stc/scintilla/lexers/LexD.cxx
src/stc/scintilla/lexers/LexDMAP.cxx
src/stc/scintilla/lexers/LexECL.cxx
src/stc/scintilla/lexers/LexEiffel.cxx
src/stc/scintilla/lexers/LexErlang.cxx
@@ -94,6 +95,8 @@
src/stc/scintilla/lexers/LexHTML.cxx
src/stc/scintilla/lexers/LexInno.cxx
src/stc/scintilla/lexers/LexKix.cxx
src/stc/scintilla/lexers/LexKVIrc.cxx
src/stc/scintilla/lexers/LexLaTeX.cxx
src/stc/scintilla/lexers/LexLisp.cxx
src/stc/scintilla/lexers/LexLout.cxx
src/stc/scintilla/lexers/LexLua.cxx
@@ -115,6 +118,7 @@
src/stc/scintilla/lexers/LexPB.cxx
src/stc/scintilla/lexers/LexPerl.cxx
src/stc/scintilla/lexers/LexPLM.cxx
src/stc/scintilla/lexers/LexPO.cxx
src/stc/scintilla/lexers/LexPOV.cxx
src/stc/scintilla/lexers/LexPowerPro.cxx
src/stc/scintilla/lexers/LexPowerShell.cxx
@@ -124,6 +128,7 @@
src/stc/scintilla/lexers/LexR.cxx
src/stc/scintilla/lexers/LexRebol.cxx
src/stc/scintilla/lexers/LexRuby.cxx
src/stc/scintilla/lexers/LexRust.cxx
src/stc/scintilla/lexers/LexScriptol.cxx
src/stc/scintilla/lexers/LexSmalltalk.cxx
src/stc/scintilla/lexers/LexSML.cxx
@@ -131,6 +136,7 @@
src/stc/scintilla/lexers/LexSpecman.cxx
src/stc/scintilla/lexers/LexSpice.cxx
src/stc/scintilla/lexers/LexSQL.cxx
src/stc/scintilla/lexers/LexSTTXT.cxx
src/stc/scintilla/lexers/LexTACL.cxx
src/stc/scintilla/lexers/LexTADS3.cxx
src/stc/scintilla/lexers/LexTAL.cxx
@@ -144,6 +150,7 @@
src/stc/scintilla/lexers/LexVisualProlog.cxx
src/stc/scintilla/lexers/LexYAML.cxx
src/stc/scintilla/lexlib/Accessor.cxx
src/stc/scintilla/lexlib/CharacterCategory.cxx
src/stc/scintilla/lexlib/CharacterSet.cxx
src/stc/scintilla/lexlib/LexerBase.cxx
src/stc/scintilla/lexlib/LexerModule.cxx
@@ -154,6 +161,8 @@
src/stc/scintilla/lexlib/WordList.cxx
src/stc/scintilla/src/AutoComplete.cxx
src/stc/scintilla/src/CallTip.cxx
src/stc/scintilla/src/CaseConvert.cxx
src/stc/scintilla/src/CaseFolder.cxx
src/stc/scintilla/src/Catalogue.cxx
src/stc/scintilla/src/CellBuffer.cxx
src/stc/scintilla/src/CharClassify.cxx

View File

@@ -229,6 +229,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexCsound.obj \
$(OBJS)\wxscintilla_LexCSS.obj \
$(OBJS)\wxscintilla_LexD.obj \
$(OBJS)\wxscintilla_LexDMAP.obj \
$(OBJS)\wxscintilla_LexECL.obj \
$(OBJS)\wxscintilla_LexEiffel.obj \
$(OBJS)\wxscintilla_LexErlang.obj \
@@ -242,6 +243,8 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexHTML.obj \
$(OBJS)\wxscintilla_LexInno.obj \
$(OBJS)\wxscintilla_LexKix.obj \
$(OBJS)\wxscintilla_LexKVIrc.obj \
$(OBJS)\wxscintilla_LexLaTeX.obj \
$(OBJS)\wxscintilla_LexLisp.obj \
$(OBJS)\wxscintilla_LexLout.obj \
$(OBJS)\wxscintilla_LexLua.obj \
@@ -263,6 +266,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexPB.obj \
$(OBJS)\wxscintilla_LexPerl.obj \
$(OBJS)\wxscintilla_LexPLM.obj \
$(OBJS)\wxscintilla_LexPO.obj \
$(OBJS)\wxscintilla_LexPOV.obj \
$(OBJS)\wxscintilla_LexPowerPro.obj \
$(OBJS)\wxscintilla_LexPowerShell.obj \
@@ -272,6 +276,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexR.obj \
$(OBJS)\wxscintilla_LexRebol.obj \
$(OBJS)\wxscintilla_LexRuby.obj \
$(OBJS)\wxscintilla_LexRust.obj \
$(OBJS)\wxscintilla_LexScriptol.obj \
$(OBJS)\wxscintilla_LexSmalltalk.obj \
$(OBJS)\wxscintilla_LexSML.obj \
@@ -279,6 +284,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexSpecman.obj \
$(OBJS)\wxscintilla_LexSpice.obj \
$(OBJS)\wxscintilla_LexSQL.obj \
$(OBJS)\wxscintilla_LexSTTXT.obj \
$(OBJS)\wxscintilla_LexTACL.obj \
$(OBJS)\wxscintilla_LexTADS3.obj \
$(OBJS)\wxscintilla_LexTAL.obj \
@@ -292,6 +298,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexVisualProlog.obj \
$(OBJS)\wxscintilla_LexYAML.obj \
$(OBJS)\wxscintilla_Accessor.obj \
$(OBJS)\wxscintilla_CharacterCategory.obj \
$(OBJS)\wxscintilla_CharacterSet.obj \
$(OBJS)\wxscintilla_LexerBase.obj \
$(OBJS)\wxscintilla_LexerModule.obj \
@@ -302,6 +309,8 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_WordList.obj \
$(OBJS)\wxscintilla_AutoComplete.obj \
$(OBJS)\wxscintilla_CallTip.obj \
$(OBJS)\wxscintilla_CaseConvert.obj \
$(OBJS)\wxscintilla_CaseFolder.obj \
$(OBJS)\wxscintilla_Catalogue.obj \
$(OBJS)\wxscintilla_CellBuffer.obj \
$(OBJS)\wxscintilla_CharClassify.obj \
@@ -5969,6 +5978,9 @@ $(OBJS)\wxscintilla_LexCSS.obj: ..\..\src\stc\scintilla\lexers\LexCSS.cxx
$(OBJS)\wxscintilla_LexD.obj: ..\..\src\stc\scintilla\lexers\LexD.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\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_LexECL.obj: ..\..\src\stc\scintilla\lexers\LexECL.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexECL.cxx
@@ -6008,6 +6020,12 @@ $(OBJS)\wxscintilla_LexInno.obj: ..\..\src\stc\scintilla\lexers\LexInno.cxx
$(OBJS)\wxscintilla_LexKix.obj: ..\..\src\stc\scintilla\lexers\LexKix.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexKix.cxx
$(OBJS)\wxscintilla_LexKVIrc.obj: ..\..\src\stc\scintilla\lexers\LexKVIrc.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexKVIrc.cxx
$(OBJS)\wxscintilla_LexLaTeX.obj: ..\..\src\stc\scintilla\lexers\LexLaTeX.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexLaTeX.cxx
$(OBJS)\wxscintilla_LexLisp.obj: ..\..\src\stc\scintilla\lexers\LexLisp.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexLisp.cxx
@@ -6071,6 +6089,9 @@ $(OBJS)\wxscintilla_LexPerl.obj: ..\..\src\stc\scintilla\lexers\LexPerl.cxx
$(OBJS)\wxscintilla_LexPLM.obj: ..\..\src\stc\scintilla\lexers\LexPLM.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexPLM.cxx
$(OBJS)\wxscintilla_LexPO.obj: ..\..\src\stc\scintilla\lexers\LexPO.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexPO.cxx
$(OBJS)\wxscintilla_LexPOV.obj: ..\..\src\stc\scintilla\lexers\LexPOV.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexPOV.cxx
@@ -6098,6 +6119,9 @@ $(OBJS)\wxscintilla_LexRebol.obj: ..\..\src\stc\scintilla\lexers\LexRebol.cxx
$(OBJS)\wxscintilla_LexRuby.obj: ..\..\src\stc\scintilla\lexers\LexRuby.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexRuby.cxx
$(OBJS)\wxscintilla_LexRust.obj: ..\..\src\stc\scintilla\lexers\LexRust.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexRust.cxx
$(OBJS)\wxscintilla_LexScriptol.obj: ..\..\src\stc\scintilla\lexers\LexScriptol.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexScriptol.cxx
@@ -6119,6 +6143,9 @@ $(OBJS)\wxscintilla_LexSpice.obj: ..\..\src\stc\scintilla\lexers\LexSpice.cxx
$(OBJS)\wxscintilla_LexSQL.obj: ..\..\src\stc\scintilla\lexers\LexSQL.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexSQL.cxx
$(OBJS)\wxscintilla_LexSTTXT.obj: ..\..\src\stc\scintilla\lexers\LexSTTXT.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexSTTXT.cxx
$(OBJS)\wxscintilla_LexTACL.obj: ..\..\src\stc\scintilla\lexers\LexTACL.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexTACL.cxx
@@ -6158,6 +6185,9 @@ $(OBJS)\wxscintilla_LexYAML.obj: ..\..\src\stc\scintilla\lexers\LexYAML.cxx
$(OBJS)\wxscintilla_Accessor.obj: ..\..\src\stc\scintilla\lexlib\Accessor.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexlib\Accessor.cxx
$(OBJS)\wxscintilla_CharacterCategory.obj: ..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx
$(OBJS)\wxscintilla_CharacterSet.obj: ..\..\src\stc\scintilla\lexlib\CharacterSet.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexlib\CharacterSet.cxx
@@ -6188,6 +6218,12 @@ $(OBJS)\wxscintilla_AutoComplete.obj: ..\..\src\stc\scintilla\src\AutoComplete.c
$(OBJS)\wxscintilla_CallTip.obj: ..\..\src\stc\scintilla\src\CallTip.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\CallTip.cxx
$(OBJS)\wxscintilla_CaseConvert.obj: ..\..\src\stc\scintilla\src\CaseConvert.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\CaseConvert.cxx
$(OBJS)\wxscintilla_CaseFolder.obj: ..\..\src\stc\scintilla\src\CaseFolder.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\CaseFolder.cxx
$(OBJS)\wxscintilla_Catalogue.obj: ..\..\src\stc\scintilla\src\Catalogue.cxx
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\Catalogue.cxx

View File

@@ -217,6 +217,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexCsound.o \
$(OBJS)\wxscintilla_LexCSS.o \
$(OBJS)\wxscintilla_LexD.o \
$(OBJS)\wxscintilla_LexDMAP.o \
$(OBJS)\wxscintilla_LexECL.o \
$(OBJS)\wxscintilla_LexEiffel.o \
$(OBJS)\wxscintilla_LexErlang.o \
@@ -230,6 +231,8 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexHTML.o \
$(OBJS)\wxscintilla_LexInno.o \
$(OBJS)\wxscintilla_LexKix.o \
$(OBJS)\wxscintilla_LexKVIrc.o \
$(OBJS)\wxscintilla_LexLaTeX.o \
$(OBJS)\wxscintilla_LexLisp.o \
$(OBJS)\wxscintilla_LexLout.o \
$(OBJS)\wxscintilla_LexLua.o \
@@ -251,6 +254,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexPB.o \
$(OBJS)\wxscintilla_LexPerl.o \
$(OBJS)\wxscintilla_LexPLM.o \
$(OBJS)\wxscintilla_LexPO.o \
$(OBJS)\wxscintilla_LexPOV.o \
$(OBJS)\wxscintilla_LexPowerPro.o \
$(OBJS)\wxscintilla_LexPowerShell.o \
@@ -260,6 +264,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexR.o \
$(OBJS)\wxscintilla_LexRebol.o \
$(OBJS)\wxscintilla_LexRuby.o \
$(OBJS)\wxscintilla_LexRust.o \
$(OBJS)\wxscintilla_LexScriptol.o \
$(OBJS)\wxscintilla_LexSmalltalk.o \
$(OBJS)\wxscintilla_LexSML.o \
@@ -267,6 +272,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexSpecman.o \
$(OBJS)\wxscintilla_LexSpice.o \
$(OBJS)\wxscintilla_LexSQL.o \
$(OBJS)\wxscintilla_LexSTTXT.o \
$(OBJS)\wxscintilla_LexTACL.o \
$(OBJS)\wxscintilla_LexTADS3.o \
$(OBJS)\wxscintilla_LexTAL.o \
@@ -280,6 +286,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexVisualProlog.o \
$(OBJS)\wxscintilla_LexYAML.o \
$(OBJS)\wxscintilla_Accessor.o \
$(OBJS)\wxscintilla_CharacterCategory.o \
$(OBJS)\wxscintilla_CharacterSet.o \
$(OBJS)\wxscintilla_LexerBase.o \
$(OBJS)\wxscintilla_LexerModule.o \
@@ -290,6 +297,8 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_WordList.o \
$(OBJS)\wxscintilla_AutoComplete.o \
$(OBJS)\wxscintilla_CallTip.o \
$(OBJS)\wxscintilla_CaseConvert.o \
$(OBJS)\wxscintilla_CaseFolder.o \
$(OBJS)\wxscintilla_Catalogue.o \
$(OBJS)\wxscintilla_CellBuffer.o \
$(OBJS)\wxscintilla_CharClassify.o \
@@ -6140,6 +6149,9 @@ $(OBJS)\wxscintilla_LexCSS.o: ../../src/stc/scintilla/lexers/LexCSS.cxx
$(OBJS)\wxscintilla_LexD.o: ../../src/stc/scintilla/lexers/LexD.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexDMAP.o: ../../src/stc/scintilla/lexers/LexDMAP.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexECL.o: ../../src/stc/scintilla/lexers/LexECL.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
@@ -6179,6 +6191,12 @@ $(OBJS)\wxscintilla_LexInno.o: ../../src/stc/scintilla/lexers/LexInno.cxx
$(OBJS)\wxscintilla_LexKix.o: ../../src/stc/scintilla/lexers/LexKix.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexKVIrc.o: ../../src/stc/scintilla/lexers/LexKVIrc.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexLaTeX.o: ../../src/stc/scintilla/lexers/LexLaTeX.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexLisp.o: ../../src/stc/scintilla/lexers/LexLisp.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
@@ -6242,6 +6260,9 @@ $(OBJS)\wxscintilla_LexPerl.o: ../../src/stc/scintilla/lexers/LexPerl.cxx
$(OBJS)\wxscintilla_LexPLM.o: ../../src/stc/scintilla/lexers/LexPLM.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexPO.o: ../../src/stc/scintilla/lexers/LexPO.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexPOV.o: ../../src/stc/scintilla/lexers/LexPOV.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
@@ -6269,6 +6290,9 @@ $(OBJS)\wxscintilla_LexRebol.o: ../../src/stc/scintilla/lexers/LexRebol.cxx
$(OBJS)\wxscintilla_LexRuby.o: ../../src/stc/scintilla/lexers/LexRuby.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexRust.o: ../../src/stc/scintilla/lexers/LexRust.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexScriptol.o: ../../src/stc/scintilla/lexers/LexScriptol.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
@@ -6290,6 +6314,9 @@ $(OBJS)\wxscintilla_LexSpice.o: ../../src/stc/scintilla/lexers/LexSpice.cxx
$(OBJS)\wxscintilla_LexSQL.o: ../../src/stc/scintilla/lexers/LexSQL.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexSTTXT.o: ../../src/stc/scintilla/lexers/LexSTTXT.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_LexTACL.o: ../../src/stc/scintilla/lexers/LexTACL.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
@@ -6329,6 +6356,9 @@ $(OBJS)\wxscintilla_LexYAML.o: ../../src/stc/scintilla/lexers/LexYAML.cxx
$(OBJS)\wxscintilla_Accessor.o: ../../src/stc/scintilla/lexlib/Accessor.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_CharacterCategory.o: ../../src/stc/scintilla/lexlib/CharacterCategory.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_CharacterSet.o: ../../src/stc/scintilla/lexlib/CharacterSet.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
@@ -6359,6 +6389,12 @@ $(OBJS)\wxscintilla_AutoComplete.o: ../../src/stc/scintilla/src/AutoComplete.cxx
$(OBJS)\wxscintilla_CallTip.o: ../../src/stc/scintilla/src/CallTip.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_CaseConvert.o: ../../src/stc/scintilla/src/CaseConvert.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_CaseFolder.o: ../../src/stc/scintilla/src/CaseFolder.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\wxscintilla_Catalogue.o: ../../src/stc/scintilla/src/Catalogue.cxx
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<

View File

@@ -240,6 +240,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexCsound.obj \
$(OBJS)\wxscintilla_LexCSS.obj \
$(OBJS)\wxscintilla_LexD.obj \
$(OBJS)\wxscintilla_LexDMAP.obj \
$(OBJS)\wxscintilla_LexECL.obj \
$(OBJS)\wxscintilla_LexEiffel.obj \
$(OBJS)\wxscintilla_LexErlang.obj \
@@ -253,6 +254,8 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexHTML.obj \
$(OBJS)\wxscintilla_LexInno.obj \
$(OBJS)\wxscintilla_LexKix.obj \
$(OBJS)\wxscintilla_LexKVIrc.obj \
$(OBJS)\wxscintilla_LexLaTeX.obj \
$(OBJS)\wxscintilla_LexLisp.obj \
$(OBJS)\wxscintilla_LexLout.obj \
$(OBJS)\wxscintilla_LexLua.obj \
@@ -274,6 +277,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexPB.obj \
$(OBJS)\wxscintilla_LexPerl.obj \
$(OBJS)\wxscintilla_LexPLM.obj \
$(OBJS)\wxscintilla_LexPO.obj \
$(OBJS)\wxscintilla_LexPOV.obj \
$(OBJS)\wxscintilla_LexPowerPro.obj \
$(OBJS)\wxscintilla_LexPowerShell.obj \
@@ -283,6 +287,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexR.obj \
$(OBJS)\wxscintilla_LexRebol.obj \
$(OBJS)\wxscintilla_LexRuby.obj \
$(OBJS)\wxscintilla_LexRust.obj \
$(OBJS)\wxscintilla_LexScriptol.obj \
$(OBJS)\wxscintilla_LexSmalltalk.obj \
$(OBJS)\wxscintilla_LexSML.obj \
@@ -290,6 +295,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexSpecman.obj \
$(OBJS)\wxscintilla_LexSpice.obj \
$(OBJS)\wxscintilla_LexSQL.obj \
$(OBJS)\wxscintilla_LexSTTXT.obj \
$(OBJS)\wxscintilla_LexTACL.obj \
$(OBJS)\wxscintilla_LexTADS3.obj \
$(OBJS)\wxscintilla_LexTAL.obj \
@@ -303,6 +309,7 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_LexVisualProlog.obj \
$(OBJS)\wxscintilla_LexYAML.obj \
$(OBJS)\wxscintilla_Accessor.obj \
$(OBJS)\wxscintilla_CharacterCategory.obj \
$(OBJS)\wxscintilla_CharacterSet.obj \
$(OBJS)\wxscintilla_LexerBase.obj \
$(OBJS)\wxscintilla_LexerModule.obj \
@@ -313,6 +320,8 @@ WXSCINTILLA_OBJECTS = \
$(OBJS)\wxscintilla_WordList.obj \
$(OBJS)\wxscintilla_AutoComplete.obj \
$(OBJS)\wxscintilla_CallTip.obj \
$(OBJS)\wxscintilla_CaseConvert.obj \
$(OBJS)\wxscintilla_CaseFolder.obj \
$(OBJS)\wxscintilla_Catalogue.obj \
$(OBJS)\wxscintilla_CellBuffer.obj \
$(OBJS)\wxscintilla_CharClassify.obj \
@@ -6655,6 +6664,9 @@ $(OBJS)\wxscintilla_LexCSS.obj: ..\..\src\stc\scintilla\lexers\LexCSS.cxx
$(OBJS)\wxscintilla_LexD.obj: ..\..\src\stc\scintilla\lexers\LexD.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\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_LexECL.obj: ..\..\src\stc\scintilla\lexers\LexECL.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexECL.cxx
@@ -6694,6 +6706,12 @@ $(OBJS)\wxscintilla_LexInno.obj: ..\..\src\stc\scintilla\lexers\LexInno.cxx
$(OBJS)\wxscintilla_LexKix.obj: ..\..\src\stc\scintilla\lexers\LexKix.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexKix.cxx
$(OBJS)\wxscintilla_LexKVIrc.obj: ..\..\src\stc\scintilla\lexers\LexKVIrc.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexKVIrc.cxx
$(OBJS)\wxscintilla_LexLaTeX.obj: ..\..\src\stc\scintilla\lexers\LexLaTeX.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexLaTeX.cxx
$(OBJS)\wxscintilla_LexLisp.obj: ..\..\src\stc\scintilla\lexers\LexLisp.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexLisp.cxx
@@ -6757,6 +6775,9 @@ $(OBJS)\wxscintilla_LexPerl.obj: ..\..\src\stc\scintilla\lexers\LexPerl.cxx
$(OBJS)\wxscintilla_LexPLM.obj: ..\..\src\stc\scintilla\lexers\LexPLM.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexPLM.cxx
$(OBJS)\wxscintilla_LexPO.obj: ..\..\src\stc\scintilla\lexers\LexPO.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexPO.cxx
$(OBJS)\wxscintilla_LexPOV.obj: ..\..\src\stc\scintilla\lexers\LexPOV.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexPOV.cxx
@@ -6784,6 +6805,9 @@ $(OBJS)\wxscintilla_LexRebol.obj: ..\..\src\stc\scintilla\lexers\LexRebol.cxx
$(OBJS)\wxscintilla_LexRuby.obj: ..\..\src\stc\scintilla\lexers\LexRuby.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexRuby.cxx
$(OBJS)\wxscintilla_LexRust.obj: ..\..\src\stc\scintilla\lexers\LexRust.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexRust.cxx
$(OBJS)\wxscintilla_LexScriptol.obj: ..\..\src\stc\scintilla\lexers\LexScriptol.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexScriptol.cxx
@@ -6805,6 +6829,9 @@ $(OBJS)\wxscintilla_LexSpice.obj: ..\..\src\stc\scintilla\lexers\LexSpice.cxx
$(OBJS)\wxscintilla_LexSQL.obj: ..\..\src\stc\scintilla\lexers\LexSQL.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexSQL.cxx
$(OBJS)\wxscintilla_LexSTTXT.obj: ..\..\src\stc\scintilla\lexers\LexSTTXT.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexSTTXT.cxx
$(OBJS)\wxscintilla_LexTACL.obj: ..\..\src\stc\scintilla\lexers\LexTACL.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexers\LexTACL.cxx
@@ -6844,6 +6871,9 @@ $(OBJS)\wxscintilla_LexYAML.obj: ..\..\src\stc\scintilla\lexers\LexYAML.cxx
$(OBJS)\wxscintilla_Accessor.obj: ..\..\src\stc\scintilla\lexlib\Accessor.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexlib\Accessor.cxx
$(OBJS)\wxscintilla_CharacterCategory.obj: ..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx
$(OBJS)\wxscintilla_CharacterSet.obj: ..\..\src\stc\scintilla\lexlib\CharacterSet.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\lexlib\CharacterSet.cxx
@@ -6874,6 +6904,12 @@ $(OBJS)\wxscintilla_AutoComplete.obj: ..\..\src\stc\scintilla\src\AutoComplete.c
$(OBJS)\wxscintilla_CallTip.obj: ..\..\src\stc\scintilla\src\CallTip.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\CallTip.cxx
$(OBJS)\wxscintilla_CaseConvert.obj: ..\..\src\stc\scintilla\src\CaseConvert.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\CaseConvert.cxx
$(OBJS)\wxscintilla_CaseFolder.obj: ..\..\src\stc\scintilla\src\CaseFolder.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\CaseFolder.cxx
$(OBJS)\wxscintilla_Catalogue.obj: ..\..\src\stc\scintilla\src\Catalogue.cxx
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) ..\..\src\stc\scintilla\src\Catalogue.cxx

View File

@@ -3847,6 +3847,7 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_LexCsound.obj &
$(OBJS)\wxscintilla_LexCSS.obj &
$(OBJS)\wxscintilla_LexD.obj &
$(OBJS)\wxscintilla_LexDMAP.obj &
$(OBJS)\wxscintilla_LexECL.obj &
$(OBJS)\wxscintilla_LexEiffel.obj &
$(OBJS)\wxscintilla_LexErlang.obj &
@@ -3860,6 +3861,8 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_LexHTML.obj &
$(OBJS)\wxscintilla_LexInno.obj &
$(OBJS)\wxscintilla_LexKix.obj &
$(OBJS)\wxscintilla_LexKVIrc.obj &
$(OBJS)\wxscintilla_LexLaTeX.obj &
$(OBJS)\wxscintilla_LexLisp.obj &
$(OBJS)\wxscintilla_LexLout.obj &
$(OBJS)\wxscintilla_LexLua.obj &
@@ -3881,6 +3884,7 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_LexPB.obj &
$(OBJS)\wxscintilla_LexPerl.obj &
$(OBJS)\wxscintilla_LexPLM.obj &
$(OBJS)\wxscintilla_LexPO.obj &
$(OBJS)\wxscintilla_LexPOV.obj &
$(OBJS)\wxscintilla_LexPowerPro.obj &
$(OBJS)\wxscintilla_LexPowerShell.obj &
@@ -3890,6 +3894,7 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_LexR.obj &
$(OBJS)\wxscintilla_LexRebol.obj &
$(OBJS)\wxscintilla_LexRuby.obj &
$(OBJS)\wxscintilla_LexRust.obj &
$(OBJS)\wxscintilla_LexScriptol.obj &
$(OBJS)\wxscintilla_LexSmalltalk.obj &
$(OBJS)\wxscintilla_LexSML.obj &
@@ -3897,6 +3902,7 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_LexSpecman.obj &
$(OBJS)\wxscintilla_LexSpice.obj &
$(OBJS)\wxscintilla_LexSQL.obj &
$(OBJS)\wxscintilla_LexSTTXT.obj &
$(OBJS)\wxscintilla_LexTACL.obj &
$(OBJS)\wxscintilla_LexTADS3.obj &
$(OBJS)\wxscintilla_LexTAL.obj &
@@ -3910,6 +3916,7 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_LexVisualProlog.obj &
$(OBJS)\wxscintilla_LexYAML.obj &
$(OBJS)\wxscintilla_Accessor.obj &
$(OBJS)\wxscintilla_CharacterCategory.obj &
$(OBJS)\wxscintilla_CharacterSet.obj &
$(OBJS)\wxscintilla_LexerBase.obj &
$(OBJS)\wxscintilla_LexerModule.obj &
@@ -3920,6 +3927,8 @@ WXSCINTILLA_OBJECTS = &
$(OBJS)\wxscintilla_WordList.obj &
$(OBJS)\wxscintilla_AutoComplete.obj &
$(OBJS)\wxscintilla_CallTip.obj &
$(OBJS)\wxscintilla_CaseConvert.obj &
$(OBJS)\wxscintilla_CaseFolder.obj &
$(OBJS)\wxscintilla_Catalogue.obj &
$(OBJS)\wxscintilla_CellBuffer.obj &
$(OBJS)\wxscintilla_CharClassify.obj &
@@ -6412,6 +6421,9 @@ $(OBJS)\wxscintilla_LexCSS.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\Lex
$(OBJS)\wxscintilla_LexD.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexD.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexDMAP.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexDMAP.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexECL.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexECL.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
@@ -6451,6 +6463,12 @@ $(OBJS)\wxscintilla_LexInno.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\Le
$(OBJS)\wxscintilla_LexKix.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexKix.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexKVIrc.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexKVIrc.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexLaTeX.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexLaTeX.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexLisp.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexLisp.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
@@ -6514,6 +6532,9 @@ $(OBJS)\wxscintilla_LexPerl.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\Le
$(OBJS)\wxscintilla_LexPLM.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexPLM.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexPO.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexPO.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexPOV.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexPOV.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
@@ -6541,6 +6562,9 @@ $(OBJS)\wxscintilla_LexRebol.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\L
$(OBJS)\wxscintilla_LexRuby.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexRuby.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexRust.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexRust.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexScriptol.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexScriptol.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
@@ -6562,6 +6586,9 @@ $(OBJS)\wxscintilla_LexSpice.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\L
$(OBJS)\wxscintilla_LexSQL.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexSQL.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexSTTXT.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexSTTXT.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_LexTACL.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\LexTACL.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
@@ -6601,6 +6628,9 @@ $(OBJS)\wxscintilla_LexYAML.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexers\Le
$(OBJS)\wxscintilla_Accessor.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexlib\Accessor.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_CharacterCategory.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_CharacterSet.obj : .AUTODEPEND ..\..\src\stc\scintilla\lexlib\CharacterSet.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
@@ -6631,6 +6661,12 @@ $(OBJS)\wxscintilla_AutoComplete.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\
$(OBJS)\wxscintilla_CallTip.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\CallTip.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_CaseConvert.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\CaseConvert.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_CaseFolder.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\CaseFolder.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
$(OBJS)\wxscintilla_Catalogue.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\Catalogue.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<

View File

@@ -396,8 +396,11 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\stc\scintilla\lexlib\Accessor.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\AutoComplete.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CallTip.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CaseConvert.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CaseFolder.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\Catalogue.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CellBuffer.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CharClassify.cxx" />
@@ -434,6 +437,7 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexCrontab.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexCsound.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexD.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexDMAP.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexECL.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexEScript.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexEiffel.cxx" />
@@ -447,6 +451,8 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexHaskell.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexInno.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKix.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLatex.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLisp.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLout.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLua.cxx" />
@@ -466,6 +472,7 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexOthers.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPB.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPLM.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPO.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPOV.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPS.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPascal.cxx" />
@@ -477,8 +484,10 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexR.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRebol.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRuby.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRust.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSML.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSQL.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexScriptol.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSmalltalk.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSorcus.cxx" />

View File

@@ -14,12 +14,21 @@
<ClCompile Include="..\..\src\stc\scintilla\lexlib\Accessor.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\AutoComplete.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CallTip.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CaseConvert.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CaseFolder.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\Catalogue.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -128,6 +137,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexD.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexDMAP.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexECL.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -167,6 +179,12 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKix.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLatex.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLisp.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -224,6 +242,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPLM.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPO.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPOV.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -263,6 +284,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSQL.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexScriptol.cxx">
<Filter>Source Files</Filter>
</ClCompile>

View File

@@ -434,8 +434,11 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\stc\scintilla\lexlib\Accessor.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\AutoComplete.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CallTip.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CaseConvert.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CaseFolder.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\Catalogue.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CellBuffer.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CharClassify.cxx" />
@@ -472,6 +475,7 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexCrontab.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexCsound.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexD.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexDMAP.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexECL.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexEScript.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexEiffel.cxx" />
@@ -485,6 +489,8 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexHaskell.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexInno.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKix.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLatex.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLisp.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLout.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLua.cxx" />
@@ -504,6 +510,7 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexOthers.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPB.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPLM.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPO.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPOV.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPS.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPascal.cxx" />
@@ -515,8 +522,10 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexR.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRebol.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRuby.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRust.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSML.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSQL.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexScriptol.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSmalltalk.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSorcus.cxx" />

View File

@@ -14,12 +14,21 @@
<ClCompile Include="..\..\src\stc\scintilla\lexlib\Accessor.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\AutoComplete.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CallTip.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CaseConvert.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CaseFolder.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\Catalogue.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -128,6 +137,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexD.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexDMAP.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexECL.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -167,6 +179,12 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKix.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLatex.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLisp.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -224,6 +242,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPLM.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPO.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPOV.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -263,6 +284,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSQL.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexScriptol.cxx">
<Filter>Source Files</Filter>
</ClCompile>

View File

@@ -434,8 +434,11 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\stc\scintilla\lexlib\Accessor.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\AutoComplete.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CallTip.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CaseConvert.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CaseFolder.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\Catalogue.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CellBuffer.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\src\CharClassify.cxx" />
@@ -472,6 +475,7 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexCrontab.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexCsound.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexD.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexDMAP.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexECL.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexEScript.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexEiffel.cxx" />
@@ -485,6 +489,8 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexHaskell.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexInno.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKix.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLatex.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLisp.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLout.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLua.cxx" />
@@ -504,6 +510,7 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexOthers.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPB.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPLM.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPO.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPOV.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPS.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPascal.cxx" />
@@ -515,8 +522,10 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexR.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRebol.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRuby.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexRust.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSML.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSQL.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexScriptol.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSmalltalk.cxx" />
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSorcus.cxx" />

View File

@@ -14,12 +14,21 @@
<ClCompile Include="..\..\src\stc\scintilla\lexlib\Accessor.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\AutoComplete.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CallTip.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CaseConvert.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\CaseFolder.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\src\Catalogue.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -128,6 +137,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexD.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexDMAP.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexECL.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -167,6 +179,12 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKix.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLatex.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexLisp.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -224,6 +242,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPLM.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPO.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexPOV.cxx">
<Filter>Source Files</Filter>
</ClCompile>
@@ -263,6 +284,9 @@
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSQL.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stc\scintilla\lexers\LexScriptol.cxx">
<Filter>Source Files</Filter>
</ClCompile>

View File

@@ -256,6 +256,12 @@
<File
RelativePath="..\..\src\stc\scintilla\src\CallTip.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\CaseConvert.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\CaseFolder.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\Catalogue.cxx">
</File>
@@ -265,6 +271,9 @@
<File
RelativePath="..\..\src\stc\scintilla\src\CharClassify.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexlib\CharacterSet.cxx">
</File>
@@ -364,6 +373,9 @@
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexD.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexDMAP.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexECL.cxx">
</File>
@@ -400,9 +412,15 @@
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexInno.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexKix.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexLaTeX.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexLisp.cxx">
</File>
@@ -460,6 +478,9 @@
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPLM.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPO.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPOV.cxx">
</File>
@@ -493,12 +514,18 @@
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexRuby.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexRust.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSML.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSQL.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx">
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexScriptol.cxx">
</File>

View File

@@ -365,6 +365,14 @@
RelativePath="..\..\src\stc\scintilla\src\CallTip.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\CaseConvert.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\CaseFolder.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\Catalogue.cxx"
>
@@ -377,6 +385,10 @@
RelativePath="..\..\src\stc\scintilla\src\CharClassify.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexlib\CharacterSet.cxx"
>
@@ -509,6 +521,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexD.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexDMAP.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexECL.cxx"
>
@@ -557,10 +573,18 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexInno.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexKix.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexLaTeX.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexLisp.cxx"
>
@@ -637,6 +661,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexPLM.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPO.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPOV.cxx"
>
@@ -681,6 +709,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexRuby.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexRust.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSML.cxx"
>
@@ -689,6 +721,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexSQL.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexScriptol.cxx"
>

View File

@@ -363,6 +363,14 @@
RelativePath="..\..\src\stc\scintilla\src\CallTip.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\CaseConvert.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\CaseFolder.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\src\Catalogue.cxx"
>
@@ -375,6 +383,10 @@
RelativePath="..\..\src\stc\scintilla\src\CharClassify.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexlib\CharacterSet.cxx"
>
@@ -507,6 +519,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexD.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexDMAP.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexECL.cxx"
>
@@ -555,10 +571,18 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexInno.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexKVIrc.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexKix.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexLaTeX.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexLisp.cxx"
>
@@ -635,6 +659,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexPLM.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPO.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexPOV.cxx"
>
@@ -679,6 +707,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexRuby.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexRust.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSML.cxx"
>
@@ -687,6 +719,10 @@
RelativePath="..\..\src\stc\scintilla\lexers\LexSQL.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexSTTXT.cxx"
>
</File>
<File
RelativePath="..\..\src\stc\scintilla\lexers\LexScriptol.cxx"
>

View File

@@ -147,6 +147,14 @@ SOURCE=..\..\src\stc\scintilla\src\CallTip.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\src\CaseConvert.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\src\CaseFolder.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\src\Catalogue.cxx
# End Source File
# Begin Source File
@@ -159,6 +167,10 @@ SOURCE=..\..\src\stc\scintilla\src\CharClassify.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexlib\CharacterCategory.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexlib\CharacterSet.cxx
# End Source File
# Begin Source File
@@ -291,6 +303,10 @@ SOURCE=..\..\src\stc\scintilla\lexers\LexD.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexDMAP.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexECL.cxx
# End Source File
# Begin Source File
@@ -339,10 +355,18 @@ SOURCE=..\..\src\stc\scintilla\lexers\LexInno.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexKVIrc.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexKix.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexLaTeX.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexLisp.cxx
# End Source File
# Begin Source File
@@ -419,6 +443,10 @@ SOURCE=..\..\src\stc\scintilla\lexers\LexPLM.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexPO.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexPOV.cxx
# End Source File
# Begin Source File
@@ -463,6 +491,10 @@ SOURCE=..\..\src\stc\scintilla\lexers\LexRuby.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexRust.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexSML.cxx
# End Source File
# Begin Source File
@@ -471,6 +503,10 @@ SOURCE=..\..\src\stc\scintilla\lexers\LexSQL.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexSTTXT.cxx
# End Source File
# Begin Source File
SOURCE=..\..\src\stc\scintilla\lexers\LexScriptol.cxx
# End Source File
# Begin Source File

View File

@@ -38,6 +38,7 @@ All (GUI):
- Optimized wxRTC insertion and deletion when floating objects are present.
- Added on-demand image loading option to wxRTC.
- Add wxFont::GetBaseFont() (Melroy Tellis).
- Update included Scintilla to version 3.3.9 (Christian Walther).
wxGTK:

View File

@@ -111,6 +111,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MARK_AVAILABLE 28
#define wxSTC_MARK_UNDERLINE 29
#define wxSTC_MARK_RGBAIMAGE 30
#define wxSTC_MARK_BOOKMARK 31
#define wxSTC_MARK_CHARACTER 10000
/// Markers used for outlining column.
@@ -122,6 +123,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MARKNUM_FOLDER 30
#define wxSTC_MARKNUM_FOLDEROPEN 31
#define wxSTC_MASK_FOLDERS 0xFE000000
#define wxSTC_MAX_MARGIN 4
#define wxSTC_MARGIN_SYMBOL 0
#define wxSTC_MARGIN_NUMBER 1
#define wxSTC_MARGIN_BACK 2
@@ -186,6 +188,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_INDIC_DOTS 10
#define wxSTC_INDIC_SQUIGGLELOW 11
#define wxSTC_INDIC_DOTBOX 12
#define wxSTC_INDIC_SQUIGGLEPIXMAP 13
#define wxSTC_INDIC_COMPOSITIONTHICK 14
#define wxSTC_INDIC_MAX 31
#define wxSTC_INDIC_CONTAINER 8
#define wxSTC_INDIC0_MASK 0x20
@@ -211,8 +215,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
/// PrintColourMode - only the default-background is forced to be white for printing.
#define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
#define wxSTC_FIND_WHOLEWORD 2
#define wxSTC_FIND_MATCHCASE 4
#define wxSTC_FIND_WHOLEWORD 0x2
#define wxSTC_FIND_MATCHCASE 0x4
#define wxSTC_FIND_WORDSTART 0x00100000
#define wxSTC_FIND_REGEXP 0x00200000
#define wxSTC_FIND_POSIX 0x00400000
@@ -220,6 +224,12 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_FOLDLEVELWHITEFLAG 0x1000
#define wxSTC_FOLDLEVELHEADERFLAG 0x2000
#define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
#define wxSTC_FOLDACTION_CONTRACT 0
#define wxSTC_FOLDACTION_EXPAND 1
#define wxSTC_FOLDACTION_TOGGLE 2
#define wxSTC_AUTOMATICFOLD_SHOW 0x0001
#define wxSTC_AUTOMATICFOLD_CLICK 0x0002
#define wxSTC_AUTOMATICFOLD_CHANGE 0x0004
#define wxSTC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
#define wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
#define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
@@ -298,6 +308,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_SEL_THIN 3
#define wxSTC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0
#define wxSTC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
#define wxSTC_ORDER_PRESORTED 0
#define wxSTC_ORDER_PERFORMSORT 1
#define wxSTC_ORDER_CUSTOM 2
#define wxSTC_CARETSTICKY_OFF 0
#define wxSTC_CARETSTICKY_ON 1
#define wxSTC_CARETSTICKY_WHITESPACE 2
@@ -492,6 +505,11 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_LEX_ECL 105
#define wxSTC_LEX_OSCRIPT 106
#define wxSTC_LEX_VISUALPROLOG 107
#define wxSTC_LEX_LITERATEHASKELL 108
#define wxSTC_LEX_STTXT 109
#define wxSTC_LEX_KVIRC 110
#define wxSTC_LEX_RUST 111
#define wxSTC_LEX_DMAP 112
/// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
/// value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -540,6 +558,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_C_TRIPLEVERBATIM 21
#define wxSTC_C_HASHQUOTEDSTRING 22
#define wxSTC_C_PREPROCESSORCOMMENT 23
#define wxSTC_C_PREPROCESSORCOMMENTDOC 24
#define wxSTC_C_USERLITERAL 25
/// Lexical states for SCLEX_D
#define wxSTC_D_DEFAULT 0
@@ -830,6 +850,10 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_B_ERROR 16
#define wxSTC_B_HEXNUMBER 17
#define wxSTC_B_BINNUMBER 18
#define wxSTC_B_COMMENTBLOCK 19
#define wxSTC_B_DOCLINE 20
#define wxSTC_B_DOCBLOCK 21
#define wxSTC_B_DOCKEYWORD 22
/// Lexical states for SCLEX_PROPERTIES
#define wxSTC_PROPS_DEFAULT 0
@@ -900,6 +924,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_ERR_TIDY 19
#define wxSTC_ERR_JAVA_STACK 20
#define wxSTC_ERR_VALUE 21
#define wxSTC_ERR_GCC_INCLUDED_FROM 22
/// Lexical states for SCLEX_BATCH
#define wxSTC_BAT_DEFAULT 0
@@ -1525,6 +1550,12 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_HA_COMMENTBLOCK 14
#define wxSTC_HA_COMMENTBLOCK2 15
#define wxSTC_HA_COMMENTBLOCK3 16
#define wxSTC_HA_PRAGMA 17
#define wxSTC_HA_PREPROCESSOR 18
#define wxSTC_HA_STRINGEOL 19
#define wxSTC_HA_RESERVED_OPERATOR 20
#define wxSTC_HA_LITERATE_COMMENT 21
#define wxSTC_HA_LITERATE_CODEDELIM 22
/// Lexical states of SCLEX_TADS3
#define wxSTC_T3_DEFAULT 0
@@ -1831,7 +1862,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_R_INFIX 10
#define wxSTC_R_INFIXEOL 11
/// Lexical state for SCLEX_MAGIKSF
/// Lexical state for SCLEX_MAGIK
#define wxSTC_MAGIK_DEFAULT 0
#define wxSTC_MAGIK_COMMENT 1
#define wxSTC_MAGIK_HYPER_COMMENT 16
@@ -1865,6 +1896,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_POWERSHELL_FUNCTION 11
#define wxSTC_POWERSHELL_USER1 12
#define wxSTC_POWERSHELL_COMMENTSTREAM 13
#define wxSTC_POWERSHELL_HERE_STRING 14
#define wxSTC_POWERSHELL_HERE_CHARACTER 15
#define wxSTC_POWERSHELL_COMMENTDOCKEYWORD 16
/// Lexical state for SCLEX_MYSQL
#define wxSTC_MYSQL_DEFAULT 0
@@ -1889,6 +1923,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MYSQL_USER2 19
#define wxSTC_MYSQL_USER3 20
#define wxSTC_MYSQL_HIDDENCOMMAND 21
#define wxSTC_MYSQL_PLACEHOLDER 22
/// Lexical state for SCLEX_PO
#define wxSTC_PO_DEFAULT 0
@@ -1900,6 +1935,13 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_PO_MSGCTXT 6
#define wxSTC_PO_MSGCTXT_TEXT 7
#define wxSTC_PO_FUZZY 8
#define wxSTC_PO_PROGRAMMER_COMMENT 9
#define wxSTC_PO_REFERENCE 10
#define wxSTC_PO_FLAGS 11
#define wxSTC_PO_MSGID_TEXT_EOL 12
#define wxSTC_PO_MSGSTR_TEXT_EOL 13
#define wxSTC_PO_MSGCTXT_TEXT_EOL 14
#define wxSTC_PO_ERROR 15
/// Lexical states for SCLEX_PASCAL
#define wxSTC_PAS_DEFAULT 0
@@ -2082,7 +2124,6 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_COFFEESCRIPT_GLOBALCLASS 19
#define wxSTC_COFFEESCRIPT_STRINGRAW 20
#define wxSTC_COFFEESCRIPT_TRIPLEVERBATIM 21
#define wxSTC_COFFEESCRIPT_HASHQUOTEDSTRING 22
#define wxSTC_COFFEESCRIPT_COMMENTBLOCK 22
#define wxSTC_COFFEESCRIPT_VERBOSE_REGEX 23
#define wxSTC_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
@@ -2180,6 +2221,86 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21
#define wxSTC_VISUALPROLOG_STRING_VERBATIM_EOL 22
/// Lexical states for SCLEX_STTXT
#define wxSTC_STTXT_DEFAULT 0
#define wxSTC_STTXT_COMMENT 1
#define wxSTC_STTXT_COMMENTLINE 2
#define wxSTC_STTXT_KEYWORD 3
#define wxSTC_STTXT_TYPE 4
#define wxSTC_STTXT_FUNCTION 5
#define wxSTC_STTXT_FB 6
#define wxSTC_STTXT_NUMBER 7
#define wxSTC_STTXT_HEXNUMBER 8
#define wxSTC_STTXT_PRAGMA 9
#define wxSTC_STTXT_OPERATOR 10
#define wxSTC_STTXT_CHARACTER 11
#define wxSTC_STTXT_STRING1 12
#define wxSTC_STTXT_STRING2 13
#define wxSTC_STTXT_STRINGEOL 14
#define wxSTC_STTXT_IDENTIFIER 15
#define wxSTC_STTXT_DATETIME 16
#define wxSTC_STTXT_VARS 17
#define wxSTC_STTXT_PRAGMAS 18
/// Lexical states for SCLEX_KVIRC
#define wxSTC_KVIRC_DEFAULT 0
#define wxSTC_KVIRC_COMMENT 1
#define wxSTC_KVIRC_COMMENTBLOCK 2
#define wxSTC_KVIRC_STRING 3
#define wxSTC_KVIRC_WORD 4
#define wxSTC_KVIRC_KEYWORD 5
#define wxSTC_KVIRC_FUNCTION_KEYWORD 6
#define wxSTC_KVIRC_FUNCTION 7
#define wxSTC_KVIRC_VARIABLE 8
#define wxSTC_KVIRC_NUMBER 9
#define wxSTC_KVIRC_OPERATOR 10
#define wxSTC_KVIRC_STRING_FUNCTION 11
#define wxSTC_KVIRC_STRING_VARIABLE 12
/// Lexical states for SCLEX_RUST
#define wxSTC_RUST_DEFAULT 0
#define wxSTC_RUST_COMMENTBLOCK 1
#define wxSTC_RUST_COMMENTLINE 2
#define wxSTC_RUST_COMMENTBLOCKDOC 3
#define wxSTC_RUST_COMMENTLINEDOC 4
#define wxSTC_RUST_NUMBER 5
#define wxSTC_RUST_WORD 6
#define wxSTC_RUST_WORD2 7
#define wxSTC_RUST_WORD3 8
#define wxSTC_RUST_WORD4 9
#define wxSTC_RUST_WORD5 10
#define wxSTC_RUST_WORD6 11
#define wxSTC_RUST_WORD7 12
#define wxSTC_RUST_STRING 13
#define wxSTC_RUST_STRINGR 14
#define wxSTC_RUST_CHARACTER 15
#define wxSTC_RUST_OPERATOR 16
#define wxSTC_RUST_IDENTIFIER 17
#define wxSTC_RUST_LIFETIME 18
#define wxSTC_RUST_MACRO 19
#define wxSTC_RUST_LEXERROR 20
/// Lexical states for SCLEX_DMAP
#define wxSTC_DMAP_DEFAULT 0
#define wxSTC_DMAP_COMMENT 1
#define wxSTC_DMAP_NUMBER 2
#define wxSTC_DMAP_STRING1 3
#define wxSTC_DMAP_STRING2 4
#define wxSTC_DMAP_STRINGEOL 5
#define wxSTC_DMAP_OPERATOR 6
#define wxSTC_DMAP_IDENTIFIER 7
#define wxSTC_DMAP_WORD 8
#define wxSTC_DMAP_WORD2 9
#define wxSTC_DMAP_WORD3 10
/// Events
/// GTK+ Specific to work around focus and accelerator problems:
/// Line end types which may be used in addition to LF, CR, and CRLF
/// SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator,
/// U+2029 Paragraph Separator, and U+0085 Next Line
#define wxSTC_LINE_END_TYPE_DEFAULT 0
#define wxSTC_LINE_END_TYPE_UNICODE 1
//}}}
//----------------------------------------------------------------------
@@ -2475,6 +2596,13 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
/// Scroll to end of document.
#define wxSTC_CMD_SCROLLTOEND 2629
/// Move caret to before first visible character on display line.
/// If already there move to first character on display line.
#define wxSTC_CMD_VCHOMEDISPLAY 2652
/// Like VCHomeDisplay but extending selection to new caret position.
#define wxSTC_CMD_VCHOMEDISPLAYEXTEND 2653
//}}}
//----------------------------------------------------------------------
@@ -3185,6 +3313,11 @@ public:
// Ensure the caret is visible.
void EnsureCaretVisible();
// Scroll the argument positions and the range between them into view giving
// priority to the primary position then the secondary position.
// This may be used to make a search match visible.
void ScrollRange(int secondary, int primary);
// Replace the selected text with the argument text.
void ReplaceSelection(const wxString& text);
@@ -3286,6 +3419,9 @@ public:
// Retrieve the position where the caret was before displaying the call tip.
int CallTipPosAtStart();
// Set the start position in order to change when backspacing removes the calltip.
void CallTipSetPosAtStart(int posStart);
// Highlight a segment of the definition.
void CallTipSetHighlight(int start, int end);
@@ -3348,9 +3484,27 @@ public:
// Switch a header line between expanded and contracted.
void ToggleFold(int line);
// Expand or contract a fold header.
void FoldLine(int line, int action);
// Expand or contract a fold header and its children.
void FoldChildren(int line, int action);
// Expand a fold header and all children. Use the level argument instead of the line's current level.
void ExpandChildren(int line, int level);
// Expand or contract all fold headers.
void FoldAll(int action);
// Ensure a particular line is visible by expanding any header line hiding it.
void EnsureVisible(int line);
// Set automatic folding behaviours.
void SetAutomaticFold(int automaticFold);
// Get automatic folding behaviours.
int GetAutomaticFold() const;
// Set some style options for folding.
void SetFoldFlags(int flags);
@@ -3873,6 +4027,10 @@ public:
// page into account. Maximum value returned is the last position in the document.
int PositionAfter(int pos);
// Given a valid document position, return a position that differs in a number
// of characters. Returned value is always between 0 and last position in document.
int PositionRelative(int pos, int relative);
// Copy a range of text to the clipboard. Positions are clipped into the document.
void CopyRange(int start, int end);
@@ -3971,6 +4129,12 @@ public:
// Get auto-completion case insensitive behaviour.
int AutoCompGetCaseInsensitiveBehaviour() const;
// Set the way autocompletion lists are ordered.
void AutoCompSetOrder(int order);
// Get the way autocompletion lists are ordered.
int AutoCompGetOrder() const;
// Enlarge the document to a particular size of text bytes.
void Allocate(int bytes);
@@ -4162,6 +4326,12 @@ public:
// Get the start of the range of style numbers used for annotations
int AnnotationGetStyleOffset() const;
// Release all extended (>255) style numbers
void ReleaseAllExtendedStyles();
// Allocate some extended (>255) style numbers and return the start of the range
int AllocateExtendedStyles(int numberStyles);
// Add a container action to the undo stack
void AddUndoAction(int token, int flags);
@@ -4172,6 +4342,12 @@ public:
// Return INVALID_POSITION if not close to text.
int CharPositionFromPointClose(int x, int y);
// Set whether switching to rectangular mode while selecting with the mouse is allowed.
void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch);
// Whether switching to rectangular mode while selecting with the mouse is allowed.
bool GetMouseSelectionRectangularSwitch() const;
// Set whether multiple selections can be made
void SetMultipleSelection(bool multipleSelection);
@@ -4199,12 +4375,18 @@ public:
// How many selections are there?
int GetSelections() const;
// Is every selected range empty?
bool GetSelectionEmpty() const;
// Clear selections to a single empty stream selection
void ClearSelections();
// Add a selection
int AddSelection(int caret, int anchor);
// Drop one selection
void DropSelectionN(int selection);
// Set the main selection
void SetMainSelection(int selection);
@@ -4305,6 +4487,9 @@ public:
// Set the height for future RGBA image data.
void RGBAImageSetHeight(int height);
// Set the scale factor in percent for future RGBA image data.
void RGBAImageSetScale(int scalePercent);
// Define a marker from RGBA data.
// It has the width and height from RGBAImageSetWidth/Height
void MarkerDefineRGBAImage(int markerNumber, const unsigned char* pixels);
@@ -4328,6 +4513,28 @@ public:
// Create an ILoader*.
void* CreateLoader(int bytes) const;
// Move caret to before first visible character on display line.
// If already there move to first character on display line.
void VCHomeDisplay();
// Like VCHomeDisplay but extending selection to new caret position.
void VCHomeDisplayExtend();
// Is the caret line always visible?
bool GetCaretLineVisibleAlways() const;
// Sets the caret line to always visible.
void SetCaretLineVisibleAlways(bool alwaysVisible);
// Set the way a character is drawn.
void SetRepresentation(const wxString& encodedCharacter, const wxString& representation);
// Get the way a character is drawn.
wxString GetRepresentation(const wxString& encodedCharacter) const;
// Remove a character representation.
void ClearRepresentation(const wxString& encodedCharacter);
// Start notifying the container of all key presses and commands.
void StartRecord();
@@ -4381,6 +4588,47 @@ public:
// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
wxString DescribeKeyWordSets() const;
// Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding.
void SetLineEndTypesAllowed(int lineEndBitSet);
// Get the line end types currently allowed.
int GetLineEndTypesAllowed() const;
// Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation.
int GetLineEndTypesActive() const;
// Bit set of LineEndType enumertion for which line ends beyond the standard
// LF, CR, and CRLF are supported by the lexer.
int GetLineEndTypesSupported() const;
// Allocate a set of sub styles for a particular base style, returning start of range
int AllocateSubStyles(int styleBase, int numberStyles);
// The starting style number for the sub styles associated with a base style
int GetSubStylesStart(int styleBase) const;
// The number of sub styles associated with a base style
int GetSubStylesLength(int styleBase) const;
// For a sub style, return the base style, else return the argument.
int GetStyleFromSubStyle(int subStyle) const;
// For a secondary style, return the primary style, else return the argument.
int GetPrimaryStyleFromStyle(int style) const;
// Free allocated sub styles
void FreeSubStyles();
// Set the identifiers that are shown in a particular style
void SetIdentifiers(int style, const wxString& identifiers);
// Where styles are duplicated by a feature such as active/inactive code
// return the distance between the two types.
int DistanceToSecondaryStyles() const;
// Get the set of base styles that can be extended with sub styles
wxString GetSubStyleBases() const;
//}}}
//----------------------------------------------------------------------

View File

@@ -67,6 +67,7 @@
#define wxSTC_MARK_AVAILABLE 28
#define wxSTC_MARK_UNDERLINE 29
#define wxSTC_MARK_RGBAIMAGE 30
#define wxSTC_MARK_BOOKMARK 31
#define wxSTC_MARK_CHARACTER 10000
/// Markers used for outlining column.
@@ -78,6 +79,7 @@
#define wxSTC_MARKNUM_FOLDER 30
#define wxSTC_MARKNUM_FOLDEROPEN 31
#define wxSTC_MASK_FOLDERS 0xFE000000
#define wxSTC_MAX_MARGIN 4
#define wxSTC_MARGIN_SYMBOL 0
#define wxSTC_MARGIN_NUMBER 1
#define wxSTC_MARGIN_BACK 2
@@ -142,6 +144,8 @@
#define wxSTC_INDIC_DOTS 10
#define wxSTC_INDIC_SQUIGGLELOW 11
#define wxSTC_INDIC_DOTBOX 12
#define wxSTC_INDIC_SQUIGGLEPIXMAP 13
#define wxSTC_INDIC_COMPOSITIONTHICK 14
#define wxSTC_INDIC_MAX 31
#define wxSTC_INDIC_CONTAINER 8
#define wxSTC_INDIC0_MASK 0x20
@@ -167,8 +171,8 @@
/// PrintColourMode - only the default-background is forced to be white for printing.
#define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
#define wxSTC_FIND_WHOLEWORD 2
#define wxSTC_FIND_MATCHCASE 4
#define wxSTC_FIND_WHOLEWORD 0x2
#define wxSTC_FIND_MATCHCASE 0x4
#define wxSTC_FIND_WORDSTART 0x00100000
#define wxSTC_FIND_REGEXP 0x00200000
#define wxSTC_FIND_POSIX 0x00400000
@@ -176,6 +180,12 @@
#define wxSTC_FOLDLEVELWHITEFLAG 0x1000
#define wxSTC_FOLDLEVELHEADERFLAG 0x2000
#define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
#define wxSTC_FOLDACTION_CONTRACT 0
#define wxSTC_FOLDACTION_EXPAND 1
#define wxSTC_FOLDACTION_TOGGLE 2
#define wxSTC_AUTOMATICFOLD_SHOW 0x0001
#define wxSTC_AUTOMATICFOLD_CLICK 0x0002
#define wxSTC_AUTOMATICFOLD_CHANGE 0x0004
#define wxSTC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
#define wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
#define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
@@ -254,6 +264,9 @@
#define wxSTC_SEL_THIN 3
#define wxSTC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0
#define wxSTC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
#define wxSTC_ORDER_PRESORTED 0
#define wxSTC_ORDER_PERFORMSORT 1
#define wxSTC_ORDER_CUSTOM 2
#define wxSTC_CARETSTICKY_OFF 0
#define wxSTC_CARETSTICKY_ON 1
#define wxSTC_CARETSTICKY_WHITESPACE 2
@@ -448,6 +461,11 @@
#define wxSTC_LEX_ECL 105
#define wxSTC_LEX_OSCRIPT 106
#define wxSTC_LEX_VISUALPROLOG 107
#define wxSTC_LEX_LITERATEHASKELL 108
#define wxSTC_LEX_STTXT 109
#define wxSTC_LEX_KVIRC 110
#define wxSTC_LEX_RUST 111
#define wxSTC_LEX_DMAP 112
/// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
/// value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -496,6 +514,8 @@
#define wxSTC_C_TRIPLEVERBATIM 21
#define wxSTC_C_HASHQUOTEDSTRING 22
#define wxSTC_C_PREPROCESSORCOMMENT 23
#define wxSTC_C_PREPROCESSORCOMMENTDOC 24
#define wxSTC_C_USERLITERAL 25
/// Lexical states for SCLEX_D
#define wxSTC_D_DEFAULT 0
@@ -786,6 +806,10 @@
#define wxSTC_B_ERROR 16
#define wxSTC_B_HEXNUMBER 17
#define wxSTC_B_BINNUMBER 18
#define wxSTC_B_COMMENTBLOCK 19
#define wxSTC_B_DOCLINE 20
#define wxSTC_B_DOCBLOCK 21
#define wxSTC_B_DOCKEYWORD 22
/// Lexical states for SCLEX_PROPERTIES
#define wxSTC_PROPS_DEFAULT 0
@@ -856,6 +880,7 @@
#define wxSTC_ERR_TIDY 19
#define wxSTC_ERR_JAVA_STACK 20
#define wxSTC_ERR_VALUE 21
#define wxSTC_ERR_GCC_INCLUDED_FROM 22
/// Lexical states for SCLEX_BATCH
#define wxSTC_BAT_DEFAULT 0
@@ -1481,6 +1506,12 @@
#define wxSTC_HA_COMMENTBLOCK 14
#define wxSTC_HA_COMMENTBLOCK2 15
#define wxSTC_HA_COMMENTBLOCK3 16
#define wxSTC_HA_PRAGMA 17
#define wxSTC_HA_PREPROCESSOR 18
#define wxSTC_HA_STRINGEOL 19
#define wxSTC_HA_RESERVED_OPERATOR 20
#define wxSTC_HA_LITERATE_COMMENT 21
#define wxSTC_HA_LITERATE_CODEDELIM 22
/// Lexical states of SCLEX_TADS3
#define wxSTC_T3_DEFAULT 0
@@ -1787,7 +1818,7 @@
#define wxSTC_R_INFIX 10
#define wxSTC_R_INFIXEOL 11
/// Lexical state for SCLEX_MAGIKSF
/// Lexical state for SCLEX_MAGIK
#define wxSTC_MAGIK_DEFAULT 0
#define wxSTC_MAGIK_COMMENT 1
#define wxSTC_MAGIK_HYPER_COMMENT 16
@@ -1821,6 +1852,9 @@
#define wxSTC_POWERSHELL_FUNCTION 11
#define wxSTC_POWERSHELL_USER1 12
#define wxSTC_POWERSHELL_COMMENTSTREAM 13
#define wxSTC_POWERSHELL_HERE_STRING 14
#define wxSTC_POWERSHELL_HERE_CHARACTER 15
#define wxSTC_POWERSHELL_COMMENTDOCKEYWORD 16
/// Lexical state for SCLEX_MYSQL
#define wxSTC_MYSQL_DEFAULT 0
@@ -1845,6 +1879,7 @@
#define wxSTC_MYSQL_USER2 19
#define wxSTC_MYSQL_USER3 20
#define wxSTC_MYSQL_HIDDENCOMMAND 21
#define wxSTC_MYSQL_PLACEHOLDER 22
/// Lexical state for SCLEX_PO
#define wxSTC_PO_DEFAULT 0
@@ -1856,6 +1891,13 @@
#define wxSTC_PO_MSGCTXT 6
#define wxSTC_PO_MSGCTXT_TEXT 7
#define wxSTC_PO_FUZZY 8
#define wxSTC_PO_PROGRAMMER_COMMENT 9
#define wxSTC_PO_REFERENCE 10
#define wxSTC_PO_FLAGS 11
#define wxSTC_PO_MSGID_TEXT_EOL 12
#define wxSTC_PO_MSGSTR_TEXT_EOL 13
#define wxSTC_PO_MSGCTXT_TEXT_EOL 14
#define wxSTC_PO_ERROR 15
/// Lexical states for SCLEX_PASCAL
#define wxSTC_PAS_DEFAULT 0
@@ -2038,7 +2080,6 @@
#define wxSTC_COFFEESCRIPT_GLOBALCLASS 19
#define wxSTC_COFFEESCRIPT_STRINGRAW 20
#define wxSTC_COFFEESCRIPT_TRIPLEVERBATIM 21
#define wxSTC_COFFEESCRIPT_HASHQUOTEDSTRING 22
#define wxSTC_COFFEESCRIPT_COMMENTBLOCK 22
#define wxSTC_COFFEESCRIPT_VERBOSE_REGEX 23
#define wxSTC_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
@@ -2136,6 +2177,86 @@
#define wxSTC_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21
#define wxSTC_VISUALPROLOG_STRING_VERBATIM_EOL 22
/// Lexical states for SCLEX_STTXT
#define wxSTC_STTXT_DEFAULT 0
#define wxSTC_STTXT_COMMENT 1
#define wxSTC_STTXT_COMMENTLINE 2
#define wxSTC_STTXT_KEYWORD 3
#define wxSTC_STTXT_TYPE 4
#define wxSTC_STTXT_FUNCTION 5
#define wxSTC_STTXT_FB 6
#define wxSTC_STTXT_NUMBER 7
#define wxSTC_STTXT_HEXNUMBER 8
#define wxSTC_STTXT_PRAGMA 9
#define wxSTC_STTXT_OPERATOR 10
#define wxSTC_STTXT_CHARACTER 11
#define wxSTC_STTXT_STRING1 12
#define wxSTC_STTXT_STRING2 13
#define wxSTC_STTXT_STRINGEOL 14
#define wxSTC_STTXT_IDENTIFIER 15
#define wxSTC_STTXT_DATETIME 16
#define wxSTC_STTXT_VARS 17
#define wxSTC_STTXT_PRAGMAS 18
/// Lexical states for SCLEX_KVIRC
#define wxSTC_KVIRC_DEFAULT 0
#define wxSTC_KVIRC_COMMENT 1
#define wxSTC_KVIRC_COMMENTBLOCK 2
#define wxSTC_KVIRC_STRING 3
#define wxSTC_KVIRC_WORD 4
#define wxSTC_KVIRC_KEYWORD 5
#define wxSTC_KVIRC_FUNCTION_KEYWORD 6
#define wxSTC_KVIRC_FUNCTION 7
#define wxSTC_KVIRC_VARIABLE 8
#define wxSTC_KVIRC_NUMBER 9
#define wxSTC_KVIRC_OPERATOR 10
#define wxSTC_KVIRC_STRING_FUNCTION 11
#define wxSTC_KVIRC_STRING_VARIABLE 12
/// Lexical states for SCLEX_RUST
#define wxSTC_RUST_DEFAULT 0
#define wxSTC_RUST_COMMENTBLOCK 1
#define wxSTC_RUST_COMMENTLINE 2
#define wxSTC_RUST_COMMENTBLOCKDOC 3
#define wxSTC_RUST_COMMENTLINEDOC 4
#define wxSTC_RUST_NUMBER 5
#define wxSTC_RUST_WORD 6
#define wxSTC_RUST_WORD2 7
#define wxSTC_RUST_WORD3 8
#define wxSTC_RUST_WORD4 9
#define wxSTC_RUST_WORD5 10
#define wxSTC_RUST_WORD6 11
#define wxSTC_RUST_WORD7 12
#define wxSTC_RUST_STRING 13
#define wxSTC_RUST_STRINGR 14
#define wxSTC_RUST_CHARACTER 15
#define wxSTC_RUST_OPERATOR 16
#define wxSTC_RUST_IDENTIFIER 17
#define wxSTC_RUST_LIFETIME 18
#define wxSTC_RUST_MACRO 19
#define wxSTC_RUST_LEXERROR 20
/// Lexical states for SCLEX_DMAP
#define wxSTC_DMAP_DEFAULT 0
#define wxSTC_DMAP_COMMENT 1
#define wxSTC_DMAP_NUMBER 2
#define wxSTC_DMAP_STRING1 3
#define wxSTC_DMAP_STRING2 4
#define wxSTC_DMAP_STRINGEOL 5
#define wxSTC_DMAP_OPERATOR 6
#define wxSTC_DMAP_IDENTIFIER 7
#define wxSTC_DMAP_WORD 8
#define wxSTC_DMAP_WORD2 9
#define wxSTC_DMAP_WORD3 10
/// Events
/// GTK+ Specific to work around focus and accelerator problems:
/// Line end types which may be used in addition to LF, CR, and CRLF
/// SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator,
/// U+2029 Paragraph Separator, and U+0085 Next Line
#define wxSTC_LINE_END_TYPE_DEFAULT 0
#define wxSTC_LINE_END_TYPE_UNICODE 1
//}}}
// Commands that can be bound to keystrokes {{{
@@ -2429,6 +2550,13 @@
/// Scroll to end of document.
#define wxSTC_CMD_SCROLLTOEND 2629
/// Move caret to before first visible character on display line.
/// If already there move to first character on display line.
#define wxSTC_CMD_VCHOMEDISPLAY 2652
/// Like VCHomeDisplay but extending selection to new caret position.
#define wxSTC_CMD_VCHOMEDISPLAYEXTEND 2653
//}}}
@@ -3619,6 +3747,13 @@ public:
*/
void EnsureCaretVisible();
/**
Scroll the argument positions and the range between them into view giving
priority to the primary position then the secondary position.
This may be used to make a search match visible.
*/
void ScrollRange(int secondary, int primary);
/**
Replace the selected text with the argument text.
*/
@@ -3780,6 +3915,11 @@ public:
*/
int CallTipPosAtStart();
/**
Set the start position in order to change when backspacing removes the calltip.
*/
void CallTipSetPosAtStart(int posStart);
/**
Highlight a segment of the definition.
*/
@@ -3882,11 +4022,41 @@ public:
*/
void ToggleFold(int line);
/**
Expand or contract a fold header.
*/
void FoldLine(int line, int action);
/**
Expand or contract a fold header and its children.
*/
void FoldChildren(int line, int action);
/**
Expand a fold header and all children. Use the level argument instead of the line's current level.
*/
void ExpandChildren(int line, int level);
/**
Expand or contract all fold headers.
*/
void FoldAll(int action);
/**
Ensure a particular line is visible by expanding any header line hiding it.
*/
void EnsureVisible(int line);
/**
Set automatic folding behaviours.
*/
void SetAutomaticFold(int automaticFold);
/**
Get automatic folding behaviours.
*/
int GetAutomaticFold() const;
/**
Set some style options for folding.
*/
@@ -4729,6 +4899,12 @@ public:
*/
int PositionAfter(int pos);
/**
Given a valid document position, return a position that differs in a number
of characters. Returned value is always between 0 and last position in document.
*/
int PositionRelative(int pos, int relative);
/**
Copy a range of text to the clipboard. Positions are clipped into the document.
*/
@@ -4889,6 +5065,16 @@ public:
*/
int AutoCompGetCaseInsensitiveBehaviour() const;
/**
Set the way autocompletion lists are ordered.
*/
void AutoCompSetOrder(int order);
/**
Get the way autocompletion lists are ordered.
*/
int AutoCompGetOrder() const;
/**
Enlarge the document to a particular size of text bytes.
*/
@@ -5204,6 +5390,16 @@ public:
*/
int AnnotationGetStyleOffset() const;
/**
Release all extended (>255) style numbers
*/
void ReleaseAllExtendedStyles();
/**
Allocate some extended (>255) style numbers and return the start of the range
*/
int AllocateExtendedStyles(int numberStyles);
/**
Add a container action to the undo stack
*/
@@ -5220,6 +5416,16 @@ public:
*/
int CharPositionFromPointClose(int x, int y);
/**
Set whether switching to rectangular mode while selecting with the mouse is allowed.
*/
void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch);
/**
Whether switching to rectangular mode while selecting with the mouse is allowed.
*/
bool GetMouseSelectionRectangularSwitch() const;
/**
Set whether multiple selections can be made
*/
@@ -5265,6 +5471,11 @@ public:
*/
int GetSelections() const;
/**
Is every selected range empty?
*/
bool GetSelectionEmpty() const;
/**
Clear selections to a single empty stream selection
*/
@@ -5275,6 +5486,11 @@ public:
*/
int AddSelection(int caret, int anchor);
/**
Drop one selection
*/
void DropSelectionN(int selection);
/**
Set the main selection
*/
@@ -5425,6 +5641,11 @@ public:
*/
void RGBAImageSetHeight(int height);
/**
Set the scale factor in percent for future RGBA image data.
*/
void RGBAImageSetScale(int scalePercent);
/**
Define a marker from RGBA data.
It has the width and height from RGBAImageSetWidth/Height
@@ -5462,6 +5683,42 @@ public:
*/
void* CreateLoader(int bytes) const;
/**
Move caret to before first visible character on display line.
If already there move to first character on display line.
*/
void VCHomeDisplay();
/**
Like VCHomeDisplay but extending selection to new caret position.
*/
void VCHomeDisplayExtend();
/**
Is the caret line always visible?
*/
bool GetCaretLineVisibleAlways() const;
/**
Sets the caret line to always visible.
*/
void SetCaretLineVisibleAlways(bool alwaysVisible);
/**
Set the way a character is drawn.
*/
void SetRepresentation(const wxString& encodedCharacter, const wxString& representation);
/**
Get the way a character is drawn.
*/
wxString GetRepresentation(const wxString& encodedCharacter) const;
/**
Remove a character representation.
*/
void ClearRepresentation(const wxString& encodedCharacter);
/**
Start notifying the container of all key presses and commands.
*/
@@ -5549,6 +5806,73 @@ public:
*/
wxString DescribeKeyWordSets() const;
/**
Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding.
*/
void SetLineEndTypesAllowed(int lineEndBitSet);
/**
Get the line end types currently allowed.
*/
int GetLineEndTypesAllowed() const;
/**
Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation.
*/
int GetLineEndTypesActive() const;
/**
Bit set of LineEndType enumertion for which line ends beyond the standard
LF, CR, and CRLF are supported by the lexer.
*/
int GetLineEndTypesSupported() const;
/**
Allocate a set of sub styles for a particular base style, returning start of range
*/
int AllocateSubStyles(int styleBase, int numberStyles);
/**
The starting style number for the sub styles associated with a base style
*/
int GetSubStylesStart(int styleBase) const;
/**
The number of sub styles associated with a base style
*/
int GetSubStylesLength(int styleBase) const;
/**
For a sub style, return the base style, else return the argument.
*/
int GetStyleFromSubStyle(int subStyle) const;
/**
For a secondary style, return the primary style, else return the argument.
*/
int GetPrimaryStyleFromStyle(int style) const;
/**
Free allocated sub styles
*/
void FreeSubStyles();
/**
Set the identifiers that are shown in a particular style
*/
void SetIdentifiers(int style, const wxString& identifiers);
/**
Where styles are duplicated by a feature such as active/inactive code
return the distance between the two types.
*/
int DistanceToSecondaryStyles() const;
/**
Get the set of base styles that can be extended with sub styles
*/
wxString GetSubStyleBases() const;
//}}}

View File

@@ -283,7 +283,7 @@ void ScintillaWX::Finalise() {
void ScintillaWX::StartDrag() {
#if wxUSE_DRAG_AND_DROP
wxString dragText = stc2wx(drag.s, drag.len);
wxString dragText = stc2wx(drag.Data(), drag.Length());
// Send an event to allow the drag text to be changed
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
@@ -420,7 +420,7 @@ bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
int horizEnd = scrollWidth;
if (horizEnd < 0)
horizEnd = 0;
if (!horizontalScrollBarVisible || (wrapState != eWrapNone))
if (!horizontalScrollBarVisible || Wrapping())
horizEnd = 0;
int pageWidth = rcText.Width();
@@ -523,12 +523,12 @@ void ScintillaWX::Paste() {
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
#if wxUSE_CLIPBOARD
if ( !st.len )
if ( !st.LengthWithTerminator() )
return;
wxTheClipboard->UsePrimarySelection(false);
if (wxTheClipboard->Open()) {
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
wxString text = wxTextBuffer::Translate(stc2wx(st.Data(), st.Length()));
wxTheClipboard->SetData(new wxTextDataObject(text));
wxTheClipboard->Close();
}
@@ -591,7 +591,7 @@ void ScintillaWX::ClaimSelection() {
CopySelectionRange(&st);
wxTheClipboard->UsePrimarySelection(true);
if (wxTheClipboard->Open()) {
wxString text = stc2wx(st.s, st.len);
wxString text = stc2wx(st.Data(), st.Length());
wxTheClipboard->SetData(new wxTextDataObject(text));
wxTheClipboard->Close();
}

View File

@@ -25,6 +25,7 @@
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
// These are all Scintilla headers
#include "Platform.h"
@@ -43,7 +44,6 @@
#include "WordList.h"
#endif
#include "ContractionState.h"
#include "SVector.h"
#include "CellBuffer.h"
#include "CallTip.h"
#include "KeyMap.h"
@@ -55,6 +55,7 @@
#include "ViewStyle.h"
#include "CharClassify.h"
#include "Decoration.h"
#include "CaseFolder.h"
#include "Document.h"
#include "Selection.h"
#include "PositionCache.h"

View File

@@ -55,7 +55,8 @@ cmdValues = [ 2011,
(2450, 2455),
2518,
(2619, 2621),
(2628, 2629)
(2628, 2629),
(2652, 2653)
]
@@ -405,6 +406,8 @@ methodOverrideMap = {
'AutoCGetMaxHeight' : ('AutoCompGetMaxHeight', 0, 0, 0),
'AutoCSetCaseInsensitiveBehaviour' : ('AutoCompSetCaseInsensitiveBehaviour', 0, 0, 0),
'AutoCGetCaseInsensitiveBehaviour' : ('AutoCompGetCaseInsensitiveBehaviour', 0, 0, 0),
'AutoCSetOrder' : ('AutoCompSetOrder', 0, 0, 0),
'AutoCGetOrder' : ('AutoCompGetOrder', 0, 0, 0),
'RegisterImage' :
(0,
@@ -584,6 +587,7 @@ methodOverrideMap = {
'GetDirectPointer' : (None, 0, 0, 0),
'CallTipPosStart' : ('CallTipPosAtStart', 0, 0, 0),
'CallTipSetPosStart': ('CallTipSetPosAtStart', 0, 0, 0),
'CallTipSetHlt' : ('CallTipSetHighlight', 0, 0, 0),
'CallTipSetBack' : ('CallTipSetBackground', 0, 0, 0),
'CallTipSetFore' : ('CallTipSetForeground', 0, 0, 0),
@@ -913,6 +917,22 @@ methodOverrideMap = {
return (void*)(sptr_t)SendMsg(%s, bytes); """,
0),
'GetRepresentation' :
(0,
'wxString %s(const wxString& encodedCharacter) const;',
'''wxString %s(const wxString& encodedCharacter) const {
int msg = %s;
int len = SendMsg(msg, (sptr_t)(const char*)wx2stc(encodedCharacter), (sptr_t)NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)(const char*)wx2stc(encodedCharacter), (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'PrivateLexerCall' :
(0,
'void* %s(int operation, void* pointer);',
@@ -924,6 +944,22 @@ methodOverrideMap = {
(0, 0, 0,
('Retrieve the effect of pasting when there are multiple selections.',)),
'GetSubStyleBases' :
(0,
'wxString %s() const;',
'''wxString %s() const {
int msg = %s;
int len = SendMsg(msg, 0, (sptr_t)NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, 0, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'' : ('', 0, 0, 0),
}

View File

@@ -1,19 +1,19 @@
This directory contains copies of the scintilla/src and
scintilla/include 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.
This directory contains copies of the src, include, lexers, and lexlib
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.21
The current version of the Scintilla code is 3.3.9
These are the basic steps needed to update the version of Scintilla used by wxSTC.
1. Copy include, lexers, lexlib and src folders to src/stc/scintilla
2. Examine diffs between the new src/stc/scintilla/Scintilla.iface
2. Examine diffs between the new src/stc/scintilla/include/Scintilla.iface
file and the version in SVN. You should get familiar especially with
new method names or constants because some of them may need to be
tweaked to conform to similar naming patterns already used. (See step
#5 below.)
#6 below.)
3. Identify new source files and update build/bakefiles/scintilla.bkl
accordingly so the new files will get built. Use bakefile to
@@ -27,7 +27,10 @@ code from the Scintilla source tree as a guide if needed. You may
have to make a few tweaks to src/stc/scintilla/include/Platform.h to
keep the compile working cleanly, but try to keep them minimal.
5. Edit the gen_iface.py file. This is where the Scintilla.iface file
5. Adjust the version number in wxStyledTextCtrl::GetLibraryVersionInfo()
in src/stc/stc.cpp.in.
6. Edit the gen_iface.py file. This is where the Scintilla.iface file
is read and the code for stc.h and stc.cpp is generated. For all new
methods or constant names check if there are similarly named things
defined here that are having something special done to them, and then
@@ -41,18 +44,18 @@ and could conceivably be bound to a key event) then I make sure that
it's ID is in cmdValues or included in one of the existing ranges in
that list.
6. Run gen_iface.py.
7. Run gen_iface.py.
7. Any other new methods should be checked to ensure that the
8. Any other new methods should be checked to ensure that the
generated code is appropriate for what they are doing and if not then
in gen_iface.py you can supply custom function bodies for them
instead.
8. Add documentation code for any new methods to
9. Add documentation code for any new methods to
interface/wx/stc/stc.h, also check any documentation-only changes from
Scintilla.iface and see if the existing docs for those items should be
updated too.
9. Build and test.
10. Build and test.
10. Submit patch to wxTrac.
11. Submit patch to wxTrac.

View File

@@ -18,7 +18,7 @@ namespace Scintilla {
#define SCI_METHOD
#endif
enum { dvOriginal=0 };
enum { dvOriginal=0, dvLineEnd=1 };
class IDocument {
public:
@@ -45,7 +45,14 @@ public:
virtual int SCI_METHOD GetLineIndentation(int line) = 0;
};
enum { lvOriginal=0 };
class IDocumentWithLineEnd : public IDocument {
public:
virtual int SCI_METHOD LineEnd(int line) const = 0;
virtual int SCI_METHOD GetRelativePosition(int positionStart, int characterOffset) const = 0;
virtual int SCI_METHOD GetCharacterAndWidth(int position, int *pWidth) const = 0;
};
enum { lvOriginal=0, lvSubStyles=1 };
class ILexer {
public:
@@ -62,6 +69,20 @@ public:
virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0;
};
class ILexerWithSubStyles : public ILexer {
public:
virtual int SCI_METHOD LineEndTypesSupported() = 0;
virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0;
virtual int SCI_METHOD SubStylesStart(int styleBase) = 0;
virtual int SCI_METHOD SubStylesLength(int styleBase) = 0;
virtual int SCI_METHOD StyleFromSubStyle(int subStyle) = 0;
virtual int SCI_METHOD PrimaryStyleFromStyle(int style) = 0;
virtual void SCI_METHOD FreeSubStyles() = 0;
virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0;
virtual int SCI_METHOD DistanceToSecondaryStyles() = 0;
virtual const char * SCI_METHOD GetSubStyleBases() = 0;
};
class ILoader {
public:
virtual int SCI_METHOD Release() = 0;

View File

@@ -13,6 +13,7 @@
// PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32
// PLAT_WIN = Win32 API on Win32 OS
// PLAT_WX is wxWindows on any supported platform
// PLAT_TK = Tcl/TK on Linux or Win32
#define PLAT_GTK 0
#define PLAT_GTK_WIN32 0
@@ -22,6 +23,8 @@
#define PLAT_WX 0
#define PLAT_QT 0
#define PLAT_FOX 0
#define PLAT_CURSES 0
#define PLAT_TK 0
#if defined(FOX)
#undef PLAT_FOX
@@ -31,10 +34,18 @@
#undef PLAT_WX
#define PLAT_WX 1
#elif defined(CURSES)
#undef PLAT_CURSES
#define PLAT_CURSES 1
#elif defined(SCINTILLA_QT)
#undef PLAT_QT
#define PLAT_QT 1
#elif defined(TK)
#undef PLAT_TK
#define PLAT_TK 1
#elif defined(GTK)
#undef PLAT_GTK
#define PLAT_GTK 1
@@ -114,19 +125,19 @@ public:
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
bool operator==(PRectangle &rc) {
bool operator==(PRectangle &rc) const {
return (rc.left == left) && (rc.right == right) &&
(rc.top == top) && (rc.bottom == bottom);
}
bool Contains(Point pt) {
bool Contains(Point pt) const {
return (pt.x >= left) && (pt.x <= right) &&
(pt.y >= top) && (pt.y <= bottom);
}
bool Contains(PRectangle rc) {
bool Contains(PRectangle rc) const {
return (rc.left >= left) && (rc.right <= right) &&
(rc.top >= top) && (rc.bottom <= bottom);
}
bool Intersects(PRectangle other) {
bool Intersects(PRectangle other) const {
return (right > other.left) && (left < other.right) &&
(bottom > other.top) && (top < other.bottom);
}
@@ -136,9 +147,9 @@ public:
right += xDelta;
bottom += yDelta;
}
XYPOSITION Width() { return right - left; }
XYPOSITION Height() { return bottom - top; }
bool Empty() {
XYPOSITION Width() const { return right - left; }
XYPOSITION Height() const { return bottom - top; }
bool Empty() const {
return (Height() <= 0) || (Width() <= 0);
}
};
@@ -194,15 +205,15 @@ public:
return co;
}
unsigned int GetRed() {
unsigned int GetRed() const {
return co & 0xff;
}
unsigned int GetGreen() {
unsigned int GetGreen() const {
return (co >> 8) & 0xff;
}
unsigned int GetBlue() {
unsigned int GetBlue() const {
return (co >> 16) & 0xff;
}
};
@@ -334,22 +345,10 @@ typedef void (*CallBackAction)(void*);
class Window {
protected:
WindowID wid;
#if PLAT_MACOSX
void *windowRef;
void *control;
#endif
public:
Window() : wid(0), cursorLast(cursorInvalid) {
#if PLAT_MACOSX
windowRef = 0;
control = 0;
#endif
}
Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) {
#if PLAT_MACOSX
windowRef = 0;
control = 0;
#endif
}
virtual ~Window();
Window &operator=(WindowID wid_) {
@@ -372,10 +371,6 @@ public:
void SetCursor(Cursor curs);
void SetTitle(const char *s);
PRectangle GetMonitorRect(Point pt);
#if PLAT_MACOSX
void SetWindow(void *ref) { windowRef = ref; }
void SetControl(void *_control) { control = _control; }
#endif
private:
Cursor cursorLast;
};
@@ -517,9 +512,7 @@ public:
#endif
#if defined(__GNUC__) && defined(SCINTILLA_QT)
#pragma GCC diagnostic ignored "-Wmissing-braces"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wchar-subscripts"
#endif
#endif

View File

@@ -120,6 +120,11 @@
#define SCLEX_ECL 105
#define SCLEX_OSCRIPT 106
#define SCLEX_VISUALPROLOG 107
#define SCLEX_LITERATEHASKELL 108
#define SCLEX_STTXT 109
#define SCLEX_KVIRC 110
#define SCLEX_RUST 111
#define SCLEX_DMAP 112
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
@@ -161,6 +166,8 @@
#define SCE_C_TRIPLEVERBATIM 21
#define SCE_C_HASHQUOTEDSTRING 22
#define SCE_C_PREPROCESSORCOMMENT 23
#define SCE_C_PREPROCESSORCOMMENTDOC 24
#define SCE_C_USERLITERAL 25
#define SCE_D_DEFAULT 0
#define SCE_D_COMMENT 1
#define SCE_D_COMMENTLINE 2
@@ -415,6 +422,10 @@
#define SCE_B_ERROR 16
#define SCE_B_HEXNUMBER 17
#define SCE_B_BINNUMBER 18
#define SCE_B_COMMENTBLOCK 19
#define SCE_B_DOCLINE 20
#define SCE_B_DOCBLOCK 21
#define SCE_B_DOCKEYWORD 22
#define SCE_PROPS_DEFAULT 0
#define SCE_PROPS_COMMENT 1
#define SCE_PROPS_SECTION 2
@@ -477,6 +488,7 @@
#define SCE_ERR_TIDY 19
#define SCE_ERR_JAVA_STACK 20
#define SCE_ERR_VALUE 21
#define SCE_ERR_GCC_INCLUDED_FROM 22
#define SCE_BAT_DEFAULT 0
#define SCE_BAT_COMMENT 1
#define SCE_BAT_WORD 2
@@ -1019,6 +1031,12 @@
#define SCE_HA_COMMENTBLOCK 14
#define SCE_HA_COMMENTBLOCK2 15
#define SCE_HA_COMMENTBLOCK3 16
#define SCE_HA_PRAGMA 17
#define SCE_HA_PREPROCESSOR 18
#define SCE_HA_STRINGEOL 19
#define SCE_HA_RESERVED_OPERATOR 20
#define SCE_HA_LITERATE_COMMENT 21
#define SCE_HA_LITERATE_CODEDELIM 22
#define SCE_T3_DEFAULT 0
#define SCE_T3_X_DEFAULT 1
#define SCE_T3_PREPROCESSOR 2
@@ -1323,6 +1341,9 @@
#define SCE_POWERSHELL_FUNCTION 11
#define SCE_POWERSHELL_USER1 12
#define SCE_POWERSHELL_COMMENTSTREAM 13
#define SCE_POWERSHELL_HERE_STRING 14
#define SCE_POWERSHELL_HERE_CHARACTER 15
#define SCE_POWERSHELL_COMMENTDOCKEYWORD 16
#define SCE_MYSQL_DEFAULT 0
#define SCE_MYSQL_COMMENT 1
#define SCE_MYSQL_COMMENTLINE 2
@@ -1345,6 +1366,7 @@
#define SCE_MYSQL_USER2 19
#define SCE_MYSQL_USER3 20
#define SCE_MYSQL_HIDDENCOMMAND 21
#define SCE_MYSQL_PLACEHOLDER 22
#define SCE_PO_DEFAULT 0
#define SCE_PO_COMMENT 1
#define SCE_PO_MSGID 2
@@ -1354,6 +1376,13 @@
#define SCE_PO_MSGCTXT 6
#define SCE_PO_MSGCTXT_TEXT 7
#define SCE_PO_FUZZY 8
#define SCE_PO_PROGRAMMER_COMMENT 9
#define SCE_PO_REFERENCE 10
#define SCE_PO_FLAGS 11
#define SCE_PO_MSGID_TEXT_EOL 12
#define SCE_PO_MSGSTR_TEXT_EOL 13
#define SCE_PO_MSGCTXT_TEXT_EOL 14
#define SCE_PO_ERROR 15
#define SCE_PAS_DEFAULT 0
#define SCE_PAS_IDENTIFIER 1
#define SCE_PAS_COMMENT 2
@@ -1518,7 +1547,6 @@
#define SCE_COFFEESCRIPT_GLOBALCLASS 19
#define SCE_COFFEESCRIPT_STRINGRAW 20
#define SCE_COFFEESCRIPT_TRIPLEVERBATIM 21
#define SCE_COFFEESCRIPT_HASHQUOTEDSTRING 22
#define SCE_COFFEESCRIPT_COMMENTBLOCK 22
#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23
#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
@@ -1607,6 +1635,70 @@
#define SCE_VISUALPROLOG_STRING_VERBATIM 20
#define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21
#define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22
#define SCE_STTXT_DEFAULT 0
#define SCE_STTXT_COMMENT 1
#define SCE_STTXT_COMMENTLINE 2
#define SCE_STTXT_KEYWORD 3
#define SCE_STTXT_TYPE 4
#define SCE_STTXT_FUNCTION 5
#define SCE_STTXT_FB 6
#define SCE_STTXT_NUMBER 7
#define SCE_STTXT_HEXNUMBER 8
#define SCE_STTXT_PRAGMA 9
#define SCE_STTXT_OPERATOR 10
#define SCE_STTXT_CHARACTER 11
#define SCE_STTXT_STRING1 12
#define SCE_STTXT_STRING2 13
#define SCE_STTXT_STRINGEOL 14
#define SCE_STTXT_IDENTIFIER 15
#define SCE_STTXT_DATETIME 16
#define SCE_STTXT_VARS 17
#define SCE_STTXT_PRAGMAS 18
#define SCE_KVIRC_DEFAULT 0
#define SCE_KVIRC_COMMENT 1
#define SCE_KVIRC_COMMENTBLOCK 2
#define SCE_KVIRC_STRING 3
#define SCE_KVIRC_WORD 4
#define SCE_KVIRC_KEYWORD 5
#define SCE_KVIRC_FUNCTION_KEYWORD 6
#define SCE_KVIRC_FUNCTION 7
#define SCE_KVIRC_VARIABLE 8
#define SCE_KVIRC_NUMBER 9
#define SCE_KVIRC_OPERATOR 10
#define SCE_KVIRC_STRING_FUNCTION 11
#define SCE_KVIRC_STRING_VARIABLE 12
#define SCE_RUST_DEFAULT 0
#define SCE_RUST_COMMENTBLOCK 1
#define SCE_RUST_COMMENTLINE 2
#define SCE_RUST_COMMENTBLOCKDOC 3
#define SCE_RUST_COMMENTLINEDOC 4
#define SCE_RUST_NUMBER 5
#define SCE_RUST_WORD 6
#define SCE_RUST_WORD2 7
#define SCE_RUST_WORD3 8
#define SCE_RUST_WORD4 9
#define SCE_RUST_WORD5 10
#define SCE_RUST_WORD6 11
#define SCE_RUST_WORD7 12
#define SCE_RUST_STRING 13
#define SCE_RUST_STRINGR 14
#define SCE_RUST_CHARACTER 15
#define SCE_RUST_OPERATOR 16
#define SCE_RUST_IDENTIFIER 17
#define SCE_RUST_LIFETIME 18
#define SCE_RUST_MACRO 19
#define SCE_RUST_LEXERROR 20
#define SCE_DMAP_DEFAULT 0
#define SCE_DMAP_COMMENT 1
#define SCE_DMAP_NUMBER 2
#define SCE_DMAP_STRING1 3
#define SCE_DMAP_STRING2 4
#define SCE_DMAP_STRINGEOL 5
#define SCE_DMAP_OPERATOR 6
#define SCE_DMAP_IDENTIFIER 7
#define SCE_DMAP_WORD 8
#define SCE_DMAP_WORD2 9
#define SCE_DMAP_WORD3 10
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
#endif

View File

@@ -125,6 +125,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_MARK_AVAILABLE 28
#define SC_MARK_UNDERLINE 29
#define SC_MARK_RGBAIMAGE 30
#define SC_MARK_BOOKMARK 31
#define SC_MARK_CHARACTER 10000
#define SC_MARKNUM_FOLDEREND 25
#define SC_MARKNUM_FOLDEROPENMID 26
@@ -148,6 +149,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_MARKERDEFINEPIXMAP 2049
#define SCI_MARKERADDSET 2466
#define SCI_MARKERSETALPHA 2476
#define SC_MAX_MARGIN 4
#define SC_MARGIN_SYMBOL 0
#define SC_MARGIN_NUMBER 1
#define SC_MARGIN_BACK 2
@@ -262,6 +264,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define INDIC_DOTS 10
#define INDIC_SQUIGGLELOW 11
#define INDIC_DOTBOX 12
#define INDIC_SQUIGGLEPIXMAP 13
#define INDIC_COMPOSITIONTHICK 14
#define INDIC_MAX 31
#define INDIC_CONTAINER 8
#define INDIC0_MASK 0x20
@@ -355,8 +359,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_PRINT_COLOURONWHITEDEFAULTBG 4
#define SCI_SETPRINTCOLOURMODE 2148
#define SCI_GETPRINTCOLOURMODE 2149
#define SCFIND_WHOLEWORD 2
#define SCFIND_MATCHCASE 4
#define SCFIND_WHOLEWORD 0x2
#define SCFIND_MATCHCASE 0x4
#define SCFIND_WORDSTART 0x00100000
#define SCFIND_REGEXP 0x00200000
#define SCFIND_POSIX 0x00400000
@@ -380,6 +384,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_POSITIONFROMLINE 2167
#define SCI_LINESCROLL 2168
#define SCI_SCROLLCARET 2169
#define SCI_SCROLLRANGE 2569
#define SCI_REPLACESEL 2170
#define SCI_SETREADONLY 2171
#define SCI_NULL 2172
@@ -413,6 +418,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_CALLTIPCANCEL 2201
#define SCI_CALLTIPACTIVE 2202
#define SCI_CALLTIPPOSSTART 2203
#define SCI_CALLTIPSETPOSSTART 2214
#define SCI_CALLTIPSETHLT 2204
#define SCI_CALLTIPSETBACK 2205
#define SCI_CALLTIPSETFORE 2206
@@ -437,7 +443,19 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETFOLDEXPANDED 2229
#define SCI_GETFOLDEXPANDED 2230
#define SCI_TOGGLEFOLD 2231
#define SC_FOLDACTION_CONTRACT 0
#define SC_FOLDACTION_EXPAND 1
#define SC_FOLDACTION_TOGGLE 2
#define SCI_FOLDLINE 2237
#define SCI_FOLDCHILDREN 2238
#define SCI_EXPANDCHILDREN 2239
#define SCI_FOLDALL 2662
#define SCI_ENSUREVISIBLE 2232
#define SC_AUTOMATICFOLD_SHOW 0x0001
#define SC_AUTOMATICFOLD_CLICK 0x0002
#define SC_AUTOMATICFOLD_CHANGE 0x0004
#define SCI_SETAUTOMATICFOLD 2663
#define SCI_GETAUTOMATICFOLD 2664
#define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
#define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
#define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
@@ -657,6 +675,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_PARAUPEXTEND 2416
#define SCI_POSITIONBEFORE 2417
#define SCI_POSITIONAFTER 2418
#define SCI_POSITIONRELATIVE 2670
#define SCI_COPYRANGE 2419
#define SCI_COPYTEXT 2420
#define SC_SEL_STREAM 0
@@ -695,6 +714,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
#define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634
#define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635
#define SC_ORDER_PRESORTED 0
#define SC_ORDER_PERFORMSORT 1
#define SC_ORDER_CUSTOM 2
#define SCI_AUTOCSETORDER 2660
#define SCI_AUTOCGETORDER 2661
#define SCI_ALLOCATE 2446
#define SCI_TARGETASUTF8 2447
#define SCI_SETLENGTHFORENCODE 2448
@@ -774,10 +798,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_ANNOTATIONGETVISIBLE 2549
#define SCI_ANNOTATIONSETSTYLEOFFSET 2550
#define SCI_ANNOTATIONGETSTYLEOFFSET 2551
#define SCI_RELEASEALLEXTENDEDSTYLES 2552
#define SCI_ALLOCATEEXTENDEDSTYLES 2553
#define UNDO_MAY_COALESCE 1
#define SCI_ADDUNDOACTION 2560
#define SCI_CHARPOSITIONFROMPOINT 2561
#define SCI_CHARPOSITIONFROMPOINTCLOSE 2562
#define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668
#define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669
#define SCI_SETMULTIPLESELECTION 2563
#define SCI_GETMULTIPLESELECTION 2564
#define SCI_SETADDITIONALSELECTIONTYPING 2565
@@ -787,9 +815,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETADDITIONALCARETSVISIBLE 2608
#define SCI_GETADDITIONALCARETSVISIBLE 2609
#define SCI_GETSELECTIONS 2570
#define SCI_GETSELECTIONEMPTY 2650
#define SCI_CLEARSELECTIONS 2571
#define SCI_SETSELECTION 2572
#define SCI_ADDSELECTION 2573
#define SCI_DROPSELECTIONN 2671
#define SCI_SETMAINSELECTION 2574
#define SCI_GETMAINSELECTION 2575
#define SCI_SETSELECTIONNCARET 2576
@@ -836,6 +866,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETIDENTIFIER 2623
#define SCI_RGBAIMAGESETWIDTH 2624
#define SCI_RGBAIMAGESETHEIGHT 2625
#define SCI_RGBAIMAGESETSCALE 2651
#define SCI_MARKERDEFINERGBAIMAGE 2626
#define SCI_REGISTERRGBAIMAGE 2627
#define SCI_SCROLLTOSTART 2628
@@ -848,6 +879,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_FINDINDICATORSHOW 2640
#define SCI_FINDINDICATORFLASH 2641
#define SCI_FINDINDICATORHIDE 2642
#define SCI_VCHOMEDISPLAY 2652
#define SCI_VCHOMEDISPLAYEXTEND 2653
#define SCI_GETCARETLINEVISIBLEALWAYS 2654
#define SCI_SETCARETLINEVISIBLEALWAYS 2655
#define SCI_SETREPRESENTATION 2665
#define SCI_GETREPRESENTATION 2666
#define SCI_CLEARREPRESENTATION 2667
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
@@ -952,6 +990,25 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCN_AUTOCCANCELLED 2025
#define SCN_AUTOCCHARDELETED 2026
#define SCN_HOTSPOTRELEASECLICK 2027
#define SCN_FOCUSIN 2028
#define SCN_FOCUSOUT 2029
#ifndef SCI_DISABLE_PROVISIONAL
#define SC_LINE_END_TYPE_DEFAULT 0
#define SC_LINE_END_TYPE_UNICODE 1
#define SCI_SETLINEENDTYPESALLOWED 2656
#define SCI_GETLINEENDTYPESALLOWED 2657
#define SCI_GETLINEENDTYPESACTIVE 2658
#define SCI_GETLINEENDTYPESSUPPORTED 4018
#define SCI_ALLOCATESUBSTYLES 4020
#define SCI_GETSUBSTYLESSTART 4021
#define SCI_GETSUBSTYLESLENGTH 4022
#define SCI_GETSTYLEFROMSUBSTYLE 4027
#define SCI_GETPRIMARYSTYLEFROMSTYLE 4028
#define SCI_FREESUBSTYLES 4023
#define SCI_SETIDENTIFIERS 4024
#define SCI_DISTANCETOSECONDARYSTYLES 4025
#define SCI_GETSUBSTYLEBASES 4026
#endif
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
/* These structures are defined to be exactly the same shape as the Win32
@@ -974,7 +1031,7 @@ struct Sci_TextRange {
struct Sci_TextToFind {
struct Sci_CharacterRange chrg;
char *lpstrText;
const char *lpstrText;
struct Sci_CharacterRange chrgText;
};

View File

@@ -268,6 +268,7 @@ val SC_MARK_LEFTRECT=27
val SC_MARK_AVAILABLE=28
val SC_MARK_UNDERLINE=29
val SC_MARK_RGBAIMAGE=30
val SC_MARK_BOOKMARK=31
val SC_MARK_CHARACTER=10000
@@ -326,6 +327,8 @@ fun void MarkerAddSet=2466(int line, int set)
# Set the alpha used for a marker that is drawn in the text area, not the margin.
set void MarkerSetAlpha=2476(int markerNumber, int alpha)
val SC_MAX_MARGIN=4
enu MarginType=SC_MARGIN_
val SC_MARGIN_SYMBOL=0
val SC_MARGIN_NUMBER=1
@@ -578,6 +581,8 @@ val INDIC_DASH=9
val INDIC_DOTS=10
val INDIC_SQUIGGLELOW=11
val INDIC_DOTBOX=12
val INDIC_SQUIGGLEPIXMAP=13
val INDIC_COMPOSITIONTHICK=14
val INDIC_MAX=31
val INDIC_CONTAINER=8
val INDIC0_MASK=0x20
@@ -852,8 +857,8 @@ set void SetPrintColourMode=2148(int mode,)
get int GetPrintColourMode=2149(,)
enu FindOption=SCFIND_
val SCFIND_WHOLEWORD=2
val SCFIND_MATCHCASE=4
val SCFIND_WHOLEWORD=0x2
val SCFIND_MATCHCASE=0x4
val SCFIND_WORDSTART=0x00100000
val SCFIND_REGEXP=0x00200000
val SCFIND_POSIX=0x00400000
@@ -921,6 +926,11 @@ fun void LineScroll=2168(int columns, int lines)
# Ensure the caret is visible.
fun void ScrollCaret=2169(,)
# Scroll the argument positions and the range between them into view giving
# priority to the primary position then the secondary position.
# This may be used to make a search match visible.
fun void ScrollRange=2569(position secondary, position primary)
# Replace the selected text with the argument text.
fun void ReplaceSel=2170(, string text)
@@ -1033,6 +1043,9 @@ fun bool CallTipActive=2202(,)
# Retrieve the position where the caret was before displaying the call tip.
fun position CallTipPosStart=2203(,)
# Set the start position in order to change when backspacing removes the calltip.
set void CallTipSetPosStart=2214(int posStart,)
# Highlight a segment of the definition.
fun void CallTipSetHlt=2204(int start, int end)
@@ -1101,9 +1114,37 @@ get bool GetFoldExpanded=2230(int line,)
# Switch a header line between expanded and contracted.
fun void ToggleFold=2231(int line,)
enu FoldAction=SC_FOLDACTION
val SC_FOLDACTION_CONTRACT=0
val SC_FOLDACTION_EXPAND=1
val SC_FOLDACTION_TOGGLE=2
# Expand or contract a fold header.
fun void FoldLine=2237(int line, int action)
# Expand or contract a fold header and its children.
fun void FoldChildren=2238(int line, int action)
# Expand a fold header and all children. Use the level argument instead of the line's current level.
fun void ExpandChildren=2239(int line, int level)
# Expand or contract all fold headers.
fun void FoldAll=2662(int action,)
# Ensure a particular line is visible by expanding any header line hiding it.
fun void EnsureVisible=2232(int line,)
enu AutomaticFold=SC_AUTOMATICFOLD_
val SC_AUTOMATICFOLD_SHOW=0x0001
val SC_AUTOMATICFOLD_CLICK=0x0002
val SC_AUTOMATICFOLD_CHANGE=0x0004
# Set automatic folding behaviours.
set void SetAutomaticFold=2663(int automaticFold,)
# Get automatic folding behaviours.
get int GetAutomaticFold=2664(,)
enu FoldFlag=SC_FOLDFLAG_
val SC_FOLDFLAG_LINEBEFORE_EXPANDED=0x0002
val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004
@@ -1719,6 +1760,10 @@ fun position PositionBefore=2417(position pos,)
# page into account. Maximum value returned is the last position in the document.
fun position PositionAfter=2418(position pos,)
# Given a valid document position, return a position that differs in a number
# of characters. Returned value is always between 0 and last position in document.
fun position PositionRelative=2670(position pos, int relative)
# Copy a range of text to the clipboard. Positions are clipped into the document.
fun void CopyRange=2419(position start, position end)
@@ -1834,6 +1879,17 @@ set void AutoCSetCaseInsensitiveBehaviour=2634(int behaviour,)
# Get auto-completion case insensitive behaviour.
get int AutoCGetCaseInsensitiveBehaviour=2635(,)
enu Ordering=SC_ORDER_
val SC_ORDER_PRESORTED=0
val SC_ORDER_PERFORMSORT=1
val SC_ORDER_CUSTOM=2
# Set the way autocompletion lists are ordered.
set void AutoCSetOrder=2660(int order,)
# Get the way autocompletion lists are ordered.
get int AutoCGetOrder=2661(,)
# Enlarge the document to a particular size of text bytes.
fun void Allocate=2446(int bytes,)
@@ -2061,6 +2117,12 @@ set void AnnotationSetStyleOffset=2550(int style,)
# Get the start of the range of style numbers used for annotations
get int AnnotationGetStyleOffset=2551(,)
# Release all extended (>255) style numbers
fun void ReleaseAllExtendedStyles=2552(,)
# Allocate some extended (>255) style numbers and return the start of the range
fun int AllocateExtendedStyles=2553(int numberStyles,)
val UNDO_MAY_COALESCE=1
# Add a container action to the undo stack
@@ -2073,6 +2135,12 @@ fun position CharPositionFromPoint=2561(int x, int y)
# Return INVALID_POSITION if not close to text.
fun position CharPositionFromPointClose=2562(int x, int y)
# Set whether switching to rectangular mode while selecting with the mouse is allowed.
set void SetMouseSelectionRectangularSwitch=2668(bool mouseSelectionRectangularSwitch,)
# Whether switching to rectangular mode while selecting with the mouse is allowed.
get bool GetMouseSelectionRectangularSwitch=2669(,)
# Set whether multiple selections can be made
set void SetMultipleSelection=2563(bool multipleSelection,)
@@ -2100,6 +2168,9 @@ get bool GetAdditionalCaretsVisible=2609(,)
# How many selections are there?
get int GetSelections=2570(,)
# Is every selected range empty?
get bool GetSelectionEmpty=2650(,)
# Clear selections to a single empty stream selection
fun void ClearSelections=2571(,)
@@ -2109,6 +2180,9 @@ fun int SetSelection=2572(int caret, int anchor)
# Add a selection
fun int AddSelection=2573(int caret, int anchor)
# Drop one selection
fun void DropSelectionN=2671(int selection,)
# Set the main selection
set void SetMainSelection=2574(int selection,)
@@ -2218,6 +2292,9 @@ set void RGBAImageSetWidth=2624(int width,)
# Set the height for future RGBA image data.
set void RGBAImageSetHeight=2625(int height,)
# Set the scale factor in percent for future RGBA image data.
set void RGBAImageSetScale=2651(int scalePercent,)
# Define a marker from RGBA data.
# It has the width and height from RGBAImageSetWidth/Height
fun void MarkerDefineRGBAImage=2626(int markerNumber, string pixels)
@@ -2253,6 +2330,28 @@ fun void FindIndicatorFlash=2641(position start, position end)
# On OS X, hide the find indicator.
fun void FindIndicatorHide=2642(,)
# Move caret to before first visible character on display line.
# If already there move to first character on display line.
fun void VCHomeDisplay=2652(,)
# Like VCHomeDisplay but extending selection to new caret position.
fun void VCHomeDisplayExtend=2653(,)
# Is the caret line always visible?
get bool GetCaretLineVisibleAlways=2654(,)
# Sets the caret line to always visible.
set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,)
# Set the way a character is drawn.
set void SetRepresentation=2665(string encodedCharacter, string representation)
# Get the way a character is drawn.
get int GetRepresentation=2666(string encodedCharacter, stringresult representation)
# Remove a character representation.
fun void ClearRepresentation=2667(string encodedCharacter,)
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
@@ -2505,6 +2604,11 @@ val SCLEX_AVS=104
val SCLEX_ECL=105
val SCLEX_OSCRIPT=106
val SCLEX_VISUALPROLOG=107
val SCLEX_LITERATEHASKELL=108
val SCLEX_STTXT=109
val SCLEX_KVIRC=110
val SCLEX_RUST=111
val SCLEX_DMAP=112
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -2555,6 +2659,8 @@ val SCE_C_STRINGRAW=20
val SCE_C_TRIPLEVERBATIM=21
val SCE_C_HASHQUOTEDSTRING=22
val SCE_C_PREPROCESSORCOMMENT=23
val SCE_C_PREPROCESSORCOMMENTDOC=24
val SCE_C_USERLITERAL=25
# Lexical states for SCLEX_D
lex D=SCLEX_D SCE_D_
val SCE_D_DEFAULT=0
@@ -2607,8 +2713,6 @@ val SCE_TCL_BLOCK_COMMENT=21
# Lexical states for SCLEX_HTML, SCLEX_XML
lex HTML=SCLEX_HTML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
lex XML=SCLEX_XML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
lex ASP=SCLEX_ASP SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
lex PHP=SCLEX_PHP SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
val SCE_H_DEFAULT=0
val SCE_H_TAG=1
val SCE_H_TAGUNKNOWN=2
@@ -2838,6 +2942,10 @@ val SCE_B_LABEL=15
val SCE_B_ERROR=16
val SCE_B_HEXNUMBER=17
val SCE_B_BINNUMBER=18
val SCE_B_COMMENTBLOCK=19
val SCE_B_DOCLINE=20
val SCE_B_DOCBLOCK=21
val SCE_B_DOCKEYWORD=22
# Lexical states for SCLEX_PROPERTIES
lex Properties=SCLEX_PROPERTIES SCE_PROPS_
val SCE_PROPS_DEFAULT=0
@@ -2908,6 +3016,7 @@ val SCE_ERR_ABSF=18
val SCE_ERR_TIDY=19
val SCE_ERR_JAVA_STACK=20
val SCE_ERR_VALUE=21
val SCE_ERR_GCC_INCLUDED_FROM=22
# Lexical states for SCLEX_BATCH
lex Batch=SCLEX_BATCH SCE_BAT_
val SCE_BAT_DEFAULT=0
@@ -3391,6 +3500,7 @@ val SCE_KIX_FUNCTIONS=8
val SCE_KIX_OPERATOR=9
val SCE_KIX_IDENTIFIER=31
# Lexical states for SCLEX_GUI4CLI
lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_
val SCE_GC_DEFAULT=0
val SCE_GC_COMMENTLINE=1
val SCE_GC_COMMENTBLOCK=2
@@ -3535,6 +3645,12 @@ val SCE_HA_COMMENTLINE=13
val SCE_HA_COMMENTBLOCK=14
val SCE_HA_COMMENTBLOCK2=15
val SCE_HA_COMMENTBLOCK3=16
val SCE_HA_PRAGMA=17
val SCE_HA_PREPROCESSOR=18
val SCE_HA_STRINGEOL=19
val SCE_HA_RESERVED_OPERATOR=20
val SCE_HA_LITERATE_COMMENT=21
val SCE_HA_LITERATE_CODEDELIM=22
# Lexical states of SCLEX_TADS3
lex TADS3=SCLEX_TADS3 SCE_T3_
val SCE_T3_DEFAULT=0
@@ -3840,8 +3956,8 @@ val SCE_R_OPERATOR=8
val SCE_R_IDENTIFIER=9
val SCE_R_INFIX=10
val SCE_R_INFIXEOL=11
# Lexical state for SCLEX_MAGIKSF
lex MagikSF=SCLEX_MAGIKSF SCE_MAGIK_
# Lexical state for SCLEX_MAGIK
lex MagikSF=SCLEX_MAGIK SCE_MAGIK_
val SCE_MAGIK_DEFAULT=0
val SCE_MAGIK_COMMENT=1
val SCE_MAGIK_HYPER_COMMENT=16
@@ -3875,6 +3991,9 @@ val SCE_POWERSHELL_ALIAS=10
val SCE_POWERSHELL_FUNCTION=11
val SCE_POWERSHELL_USER1=12
val SCE_POWERSHELL_COMMENTSTREAM=13
val SCE_POWERSHELL_HERE_STRING=14
val SCE_POWERSHELL_HERE_CHARACTER=15
val SCE_POWERSHELL_COMMENTDOCKEYWORD=16
# Lexical state for SCLEX_MYSQL
lex MySQL=SCLEX_MYSQL SCE_MYSQL_
val SCE_MYSQL_DEFAULT=0
@@ -3899,6 +4018,7 @@ val SCE_MYSQL_USER1=18
val SCE_MYSQL_USER2=19
val SCE_MYSQL_USER3=20
val SCE_MYSQL_HIDDENCOMMAND=21
val SCE_MYSQL_PLACEHOLDER=22
# Lexical state for SCLEX_PO
lex Po=SCLEX_PO SCE_PO_
val SCE_PO_DEFAULT=0
@@ -3910,6 +4030,13 @@ val SCE_PO_MSGSTR_TEXT=5
val SCE_PO_MSGCTXT=6
val SCE_PO_MSGCTXT_TEXT=7
val SCE_PO_FUZZY=8
val SCE_PO_PROGRAMMER_COMMENT=9
val SCE_PO_REFERENCE=10
val SCE_PO_FLAGS=11
val SCE_PO_MSGID_TEXT_EOL=12
val SCE_PO_MSGSTR_TEXT_EOL=13
val SCE_PO_MSGCTXT_TEXT_EOL=14
val SCE_PO_ERROR=15
# Lexical states for SCLEX_PASCAL
lex Pascal=SCLEX_PASCAL SCE_PAS_
val SCE_PAS_DEFAULT=0
@@ -4092,7 +4219,6 @@ val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18
val SCE_COFFEESCRIPT_GLOBALCLASS=19
val SCE_COFFEESCRIPT_STRINGRAW=20
val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21
val SCE_COFFEESCRIPT_HASHQUOTEDSTRING=22
val SCE_COFFEESCRIPT_COMMENTBLOCK=22
val SCE_COFFEESCRIPT_VERBOSE_REGEX=23
val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24
@@ -4189,6 +4315,78 @@ val SCE_VISUALPROLOG_STRING_EOL_OPEN=19
val SCE_VISUALPROLOG_STRING_VERBATIM=20
val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21
val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22
# Lexical states for SCLEX_STTXT
lex StructuredText=SCLEX_STTXT SCE_STTXT_
val SCE_STTXT_DEFAULT=0
val SCE_STTXT_COMMENT=1
val SCE_STTXT_COMMENTLINE=2
val SCE_STTXT_KEYWORD=3
val SCE_STTXT_TYPE=4
val SCE_STTXT_FUNCTION=5
val SCE_STTXT_FB=6
val SCE_STTXT_NUMBER=7
val SCE_STTXT_HEXNUMBER=8
val SCE_STTXT_PRAGMA=9
val SCE_STTXT_OPERATOR=10
val SCE_STTXT_CHARACTER=11
val SCE_STTXT_STRING1=12
val SCE_STTXT_STRING2=13
val SCE_STTXT_STRINGEOL=14
val SCE_STTXT_IDENTIFIER=15
val SCE_STTXT_DATETIME=16
val SCE_STTXT_VARS=17
val SCE_STTXT_PRAGMAS=18
# Lexical states for SCLEX_KVIRC
lex KVIrc=SCLEX_KVIRC SCE_KVIRC_
val SCE_KVIRC_DEFAULT=0
val SCE_KVIRC_COMMENT=1
val SCE_KVIRC_COMMENTBLOCK=2
val SCE_KVIRC_STRING=3
val SCE_KVIRC_WORD=4
val SCE_KVIRC_KEYWORD=5
val SCE_KVIRC_FUNCTION_KEYWORD=6
val SCE_KVIRC_FUNCTION=7
val SCE_KVIRC_VARIABLE=8
val SCE_KVIRC_NUMBER=9
val SCE_KVIRC_OPERATOR=10
val SCE_KVIRC_STRING_FUNCTION=11
val SCE_KVIRC_STRING_VARIABLE=12
# Lexical states for SCLEX_RUST
lex Rust=SCLEX_RUST SCE_RUST_
val SCE_RUST_DEFAULT=0
val SCE_RUST_COMMENTBLOCK=1
val SCE_RUST_COMMENTLINE=2
val SCE_RUST_COMMENTBLOCKDOC=3
val SCE_RUST_COMMENTLINEDOC=4
val SCE_RUST_NUMBER=5
val SCE_RUST_WORD=6
val SCE_RUST_WORD2=7
val SCE_RUST_WORD3=8
val SCE_RUST_WORD4=9
val SCE_RUST_WORD5=10
val SCE_RUST_WORD6=11
val SCE_RUST_WORD7=12
val SCE_RUST_STRING=13
val SCE_RUST_STRINGR=14
val SCE_RUST_CHARACTER=15
val SCE_RUST_OPERATOR=16
val SCE_RUST_IDENTIFIER=17
val SCE_RUST_LIFETIME=18
val SCE_RUST_MACRO=19
val SCE_RUST_LEXERROR=20
# Lexical states for SCLEX_DMAP
lex DMAP=SCLEX_DMAP SCE_DMAP_
val SCE_DMAP_DEFAULT=0
val SCE_DMAP_COMMENT=1
val SCE_DMAP_NUMBER=2
val SCE_DMAP_STRING1=3
val SCE_DMAP_STRING2=4
val SCE_DMAP_STRINGEOL=5
val SCE_DMAP_OPERATOR=6
val SCE_DMAP_IDENTIFIER=7
val SCE_DMAP_WORD=8
val SCE_DMAP_WORD2=9
val SCE_DMAP_WORD3=10
# Events
@@ -4220,6 +4418,58 @@ evt void IndicatorRelease=2024(int modifiers, int position)
evt void AutoCCancelled=2025(void)
evt void AutoCCharDeleted=2026(void)
evt void HotSpotReleaseClick=2027(int modifiers, int position)
evt void FocusIn=2028(void)
evt void FocusOut=2029(void)
cat Provisional
# Line end types which may be used in addition to LF, CR, and CRLF
# SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator,
# U+2029 Paragraph Separator, and U+0085 Next Line
enu LineEndType=SC_LINE_END_TYPE_
val SC_LINE_END_TYPE_DEFAULT=0
val SC_LINE_END_TYPE_UNICODE=1
# Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding.
set void SetLineEndTypesAllowed=2656(int lineEndBitSet,)
# Get the line end types currently allowed.
get int GetLineEndTypesAllowed=2657(,)
# Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation.
get int GetLineEndTypesActive=2658(,)
# Bit set of LineEndType enumertion for which line ends beyond the standard
# LF, CR, and CRLF are supported by the lexer.
get int GetLineEndTypesSupported=4018(,)
# Allocate a set of sub styles for a particular base style, returning start of range
fun int AllocateSubStyles=4020(int styleBase, int numberStyles)
# The starting style number for the sub styles associated with a base style
get int GetSubStylesStart=4021(int styleBase,)
# The number of sub styles associated with a base style
get int GetSubStylesLength=4022(int styleBase,)
# For a sub style, return the base style, else return the argument.
get int GetStyleFromSubStyle=4027(int subStyle,)
# For a secondary style, return the primary style, else return the argument.
get int GetPrimaryStyleFromStyle=4028(int style,)
# Free allocated sub styles
fun void FreeSubStyles=4023(,)
# Set the identifiers that are shown in a particular style
set void SetIdentifiers=4024(int style, string identifiers)
# Where styles are duplicated by a feature such as active/inactive code
# return the distance between the two types.
get int DistanceToSecondaryStyles=4025(,)
# Get the set of base styles that can be extended with sub styles
get int GetSubStyleBases=4026(, stringresult styles)
cat Deprecated

View File

@@ -16,8 +16,8 @@ extern "C" {
#endif
#define SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject)
#define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
#define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ())
#define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
#define IS_SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ())
typedef struct _ScintillaObject ScintillaObject;
typedef struct _ScintillaClass ScintillaClass;

View File

@@ -117,13 +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;
// Get references to keywords lists
WordList &cpuInstruction = *keywordlists[0];
WordList &registers = *keywordlists[1];
WordList &directive = *keywordlists[2];
WordList &extInstruction = *keywordlists[3];
WordList &commentSpecial = *keywordlists[4];
WordList &alert = *keywordlists[4];
WordList &doxygenKeyword = *keywordlists[5];
@@ -133,85 +140,69 @@ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle,
/************************************************************
*
* Parse the text
* Parse the source
*
************************************************************/
for ( ; sc.More(); sc.Forward())
{
char Buffer[100];
int OpType;
// Reset style at beginning of line
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);
}
/************************************************************
*
* Handle current state if we are not in the "default style"
* 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)
{
// Check if current style continue.
// If this case, we loop because there is nothing else to do
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)) // Arg of macro
|| ((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_ARG) && isdigit(sc.ch)) // Macro argument
// Label. ' ' and '\t' are needed to handle macro declarations
|| ((sc.state == SCE_A68K_LABEL) && (sc.ch != ':') && (sc.ch != ' ') && (sc.ch != '\t'))
|| ((sc.state == SCE_A68K_IDENTIFIER) && (sc.ch < 0x80) && IsIdentifierChar(sc.ch)) // Identifier
|| ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && (sc.ch < 0x80) && IsDoxygenChar(sc.ch)) // Doxygen keyword
|| ((sc.state == SCE_A68K_COMMENT_WORD) && (sc.ch < 0x80) && isalpha(sc.ch))) // Comment current word
|| ((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 some states terminate at the current char:
// we must include this char in the current style context
else if (((sc.state == SCE_A68K_STRING1) && (sc.ch < 0x80) && (sc.ch == '\'')) // String single-quoted
|| ((sc.state == SCE_A68K_STRING2) && (sc.ch < 0x80) && (sc.ch == '\"')) // String double-quoted
|| ((sc.state == SCE_A68K_LABEL) && (sc.ch < 0x80) && (sc.ch == ':'))) // Label
{
sc.ForwardSetState(SCE_A68K_DEFAULT);
/************************************************************
*
* 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();
}
// Check for special words or Doxygen keywords in comments
else if (sc.state == SCE_A68K_COMMENT)
{
if (sc.ch == '\\') {
sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
}
else if ((sc.ch < 0x80) && isalpha(sc.ch)) {
sc.SetState(SCE_A68K_COMMENT_WORD);
}
continue;
// 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);
}
// Check for special words in comment
else if ((sc.state == SCE_A68K_COMMENT_WORD) && (sc.ch < 0x80) && !isalpha(sc.ch))
{
// 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 (commentSpecial.InList(Buffer)) {
sc.ChangeState(SCE_A68K_COMMENT_SPECIAL);
}
else {
sc.ChangeState(SCE_A68K_COMMENT);
}
sc.SetState(SCE_A68K_COMMENT);
continue;
}
// Check for Doxygen keywords
else if ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && (sc.ch < 0x80) && !IsDoxygenChar(sc.ch))
{
sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context
if (!doxygenKeyword.InList(Buffer)) {
sc.ChangeState(SCE_A68K_COMMENT);
}
@@ -219,17 +210,39 @@ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle,
continue;
}
// Check if we are in the case of a label which terminates without ':'
// It should be a macro declaration, not a label
else if ((sc.state == SCE_A68K_LABEL) && (sc.ch < 0x80) && ((sc.ch == ' ') || (sc.ch == '\t')))
{
sc.ChangeState(SCE_A68K_MACRO_DECLARATION);
// 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 {
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;
}
// 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);
@@ -256,14 +269,30 @@ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle,
*
************************************************************/
// Label and macro identifiers start at the beginning of a line
// We set both as a label, but if it wasn't one (no ':' at the end),
// it will be changed as a macro identifier.
if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) {
// 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);
}
else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Comment
sc.SetState(SCE_A68K_COMMENT);
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.
if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) {
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) && isdigit(sc.ch)) { // Decimal numbers haven't prefix
sc.SetState(SCE_A68K_NUMBER_DEC);
@@ -280,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
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...

View File

@@ -87,7 +87,7 @@ static inline bool IsAWordStart(const int ch)
}
static inline bool IsAOperator(char ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
ch == '&' || ch == '^' || ch == '=' || ch == '<' || ch == '>' ||
@@ -228,7 +228,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
char si; // string indicator "=1 '=2
char ni; // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3
char ci; // comment indicator 0=not linecomment(;)
char s_save[100];
char s_save[100] = "";
si=0;
ni=0;
ci=0;

View File

@@ -45,7 +45,7 @@ inline bool IsAWordStart(const int ch) {
}
inline bool isAveOperator(char ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
@@ -167,7 +167,7 @@ static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, W
char chNext = static_cast<char>(tolower(styler[startPos]));
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
char s[10];
char s[10] = "";
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = static_cast<char>(tolower(chNext));

View File

@@ -30,10 +30,6 @@
using namespace Scintilla;
#endif
static inline bool IsAWordChar(const int ch) {
return (ch < 0x80 && (isalnum(ch) || (ch == '_')));
}
static inline bool IsAKeywordChar(const int ch) {
return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == ' ')));
}
@@ -42,17 +38,6 @@ static inline bool IsASetChar(const int ch) {
return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == '.') || (ch == '-')));
}
static inline bool IsAnOperator(char ch) {
// '.' left out as it is used to make up numbers
if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
ch == '(' || ch == ')' || ch == '=' || ch == '^' ||
ch == '[' || ch == ']' || ch == '<' || ch == '&' ||
ch == '>' || ch == ',' || ch == '|' || ch == '~' ||
ch == '$' || ch == ':' || ch == '%')
return true;
return false;
}
static void ColouriseABAQUSDoc(unsigned int startPos, int length, int initStyle, WordList*[] /* *keywordlists[] */,
Accessor &styler) {
enum localState { KW_LINE_KW, KW_LINE_COMMA, KW_LINE_PAR, KW_LINE_EQ, KW_LINE_VAL, \

View File

@@ -65,8 +65,6 @@ static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribut
static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute);
static inline bool IsDelimiterCharacter(int ch);
static inline bool IsNumberStartCharacter(int ch);
static inline bool IsNumberCharacter(int ch);
static inline bool IsSeparatorOrDelimiterCharacter(int ch);
static bool IsValidIdentifier(const std::string& identifier);
static bool IsValidNumber(const std::string& number);
@@ -310,19 +308,6 @@ static inline bool IsDelimiterCharacter(int ch) {
}
}
static inline bool IsNumberCharacter(int ch) {
return IsNumberStartCharacter(ch) ||
ch == '_' ||
ch == '.' ||
ch == '#' ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F');
}
static inline bool IsNumberStartCharacter(int ch) {
return IsADigit(ch);
}
static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
return IsASpace(ch) || IsDelimiterCharacter(ch);
}
@@ -526,5 +511,5 @@ static inline bool IsWordCharacter(int ch) {
}
static inline bool IsWordStartCharacter(int ch) {
return (isascii(ch) && isalpha(ch)) || ch == '_';
return (IsASCII(ch) && isalpha(ch)) || ch == '_';
}

View File

@@ -344,7 +344,7 @@ void SCI_METHOD LexerAsm::Lex(unsigned int startPos, int length, int initStyle,
if (sc.state == SCE_ASM_DEFAULT) {
if (sc.ch == ';'){
sc.SetState(SCE_ASM_COMMENT);
} else if (isascii(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && isascii(sc.chNext) && isdigit(sc.chNext)))) {
} else if (IsASCII(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && IsASCII(sc.chNext) && isdigit(sc.chNext)))) {
sc.SetState(SCE_ASM_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_ASM_IDENTIFIER);

View File

@@ -185,4 +185,4 @@ static const char * const asn1WordLists[] = {
0, };
LexerModule lmAns1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists);
LexerModule lmAsn1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists);

View File

@@ -2,7 +2,7 @@
/** @file LexBash.cxx
** Lexer for Bash.
**/
// Copyright 2004-2010 by Neil Hodgson <neilh@scintilla.org>
// Copyright 2004-2012 by Neil Hodgson <neilh@scintilla.org>
// Adapted from LexPerl by Kein-Hong Man 2004
// The License.txt file describes the conditions under which this software may be distributed.
@@ -49,6 +49,17 @@ using namespace Scintilla;
#define BASH_CMD_ARITH 4
#define BASH_CMD_DELIM 5
// state constants for nested delimiter pairs, used by
// SCE_SH_STRING and SCE_SH_BACKTICKS processing
#define BASH_DELIM_LITERAL 0
#define BASH_DELIM_STRING 1
#define BASH_DELIM_CSTRING 2
#define BASH_DELIM_LSTRING 3
#define BASH_DELIM_COMMAND 4
#define BASH_DELIM_BACKTICK 5
#define BASH_DELIM_STACK_MAX 7
static inline int translateBashDigit(int ch) {
if (ch >= '0' && ch <= '9') {
return ch - '0';
@@ -97,6 +108,8 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
CharacterSet setWordStart(CharacterSet::setAlpha, "_");
// note that [+-] are often parts of identifiers in shell scripts
CharacterSet setWord(CharacterSet::setAlphaNum, "._+-");
CharacterSet setMetaCharacter(CharacterSet::setNone, "|&;()<> \t\r\n");
setMetaCharacter.Add(0);
CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/<?!.~@");
CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMACahGLNn");
CharacterSet setParam(CharacterSet::setAlphaNum, "$_");
@@ -154,6 +167,60 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
};
QuoteCls Quote;
class QuoteStackCls { // Class to manage quote pairs that nest
public:
int Count;
int Up, Down;
int Style;
int Depth; // levels pushed
int *CountStack;
int *UpStack;
int *StyleStack;
QuoteStackCls() {
Count = 0;
Up = '\0';
Down = '\0';
Style = 0;
Depth = 0;
CountStack = new int[BASH_DELIM_STACK_MAX];
UpStack = new int[BASH_DELIM_STACK_MAX];
StyleStack = new int[BASH_DELIM_STACK_MAX];
}
void Start(int u, int s) {
Count = 1;
Up = u;
Down = opposite(Up);
Style = s;
}
void Push(int u, int s) {
if (Depth >= BASH_DELIM_STACK_MAX)
return;
CountStack[Depth] = Count;
UpStack [Depth] = Up;
StyleStack[Depth] = Style;
Depth++;
Count = 1;
Up = u;
Down = opposite(Up);
Style = s;
}
void Pop(void) {
if (Depth <= 0)
return;
Depth--;
Count = CountStack[Depth];
Up = UpStack [Depth];
Style = StyleStack[Depth];
Down = opposite(Up);
}
~QuoteStackCls() {
delete []CountStack;
delete []UpStack;
delete []StyleStack;
}
};
QuoteStackCls QuoteStack;
int numBase = 0;
int digit;
unsigned int endPos = startPos + length;
@@ -163,6 +230,8 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
// Always backtracks to the start of a line that is not a continuation
// of the previous line (i.e. start of a bash command segment)
int ln = styler.GetLine(startPos);
if (ln > 0 && startPos == static_cast<unsigned int>(styler.LineStart(ln)))
ln--;
for (;;) {
startPos = styler.LineStart(ln);
if (ln == 0 || styler.GetLineState(ln) == BASH_CMD_START)
@@ -370,13 +439,23 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
HereDoc.State = 1;
}
} else if (HereDoc.State == 1) { // collect the delimiter
if (setHereDoc2.Contains(sc.ch) || sc.chPrev == '\\') {
// * if single quoted, there's no escape
// * if double quoted, there are \\ and \" escapes
if ((HereDoc.Quote == '\'' && sc.ch != HereDoc.Quote) ||
(HereDoc.Quoted && sc.ch != HereDoc.Quote && sc.ch != '\\') ||
(HereDoc.Quote != '\'' && sc.chPrev == '\\') ||
(setHereDoc2.Contains(sc.ch))) {
HereDoc.Append(sc.ch);
} else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) { // closing quote => end of delimiter
sc.ForwardSetState(SCE_SH_DEFAULT);
} else if (sc.ch == '\\') {
// skip escape prefix
if (HereDoc.Quoted && sc.chNext != HereDoc.Quote && sc.chNext != '\\') {
// in quoted prefixes only \ and the quote eat the escape
HereDoc.Append(sc.ch);
} else {
// skip escape prefix
}
} else if (!HereDoc.Quoted) {
sc.SetState(SCE_SH_DEFAULT);
}
if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { // force blowup
@@ -401,8 +480,11 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
}
char s[HERE_DELIM_MAX];
sc.GetCurrent(s, sizeof(s));
if (sc.LengthCurrent() == 0)
if (sc.LengthCurrent() == 0) { // '' or "" delimiters
if (prefixws == 0 && HereDoc.Quoted && HereDoc.DelimiterLength == 0)
sc.SetState(SCE_SH_DEFAULT);
break;
}
if (s[strlen(s) - 1] == '\r')
s[strlen(s) - 1] = '\0';
if (strcmp(HereDoc.Delimiter, s) == 0) {
@@ -424,9 +506,56 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
}
}
break;
case SCE_SH_STRING: // delimited styles
case SCE_SH_STRING: // delimited styles, can nest
case SCE_SH_BACKTICKS:
case SCE_SH_PARAM:
if (sc.ch == '\\' && QuoteStack.Up != '\\') {
if (QuoteStack.Style != BASH_DELIM_LITERAL)
sc.Forward();
} else if (sc.ch == QuoteStack.Down) {
QuoteStack.Count--;
if (QuoteStack.Count == 0) {
if (QuoteStack.Depth > 0) {
QuoteStack.Pop();
} else
sc.ForwardSetState(SCE_SH_DEFAULT);
}
} else if (sc.ch == QuoteStack.Up) {
QuoteStack.Count++;
} else {
if (QuoteStack.Style == BASH_DELIM_STRING ||
QuoteStack.Style == BASH_DELIM_LSTRING
) { // do nesting for "string", $"locale-string"
if (sc.ch == '`') {
QuoteStack.Push(sc.ch, BASH_DELIM_BACKTICK);
} else if (sc.ch == '$' && sc.chNext == '(') {
sc.Forward();
QuoteStack.Push(sc.ch, BASH_DELIM_COMMAND);
}
} else if (QuoteStack.Style == BASH_DELIM_COMMAND ||
QuoteStack.Style == BASH_DELIM_BACKTICK
) { // do nesting for $(command), `command`
if (sc.ch == '\'') {
QuoteStack.Push(sc.ch, BASH_DELIM_LITERAL);
} else if (sc.ch == '\"') {
QuoteStack.Push(sc.ch, BASH_DELIM_STRING);
} else if (sc.ch == '`') {
QuoteStack.Push(sc.ch, BASH_DELIM_BACKTICK);
} else if (sc.ch == '$') {
if (sc.chNext == '\'') {
sc.Forward();
QuoteStack.Push(sc.ch, BASH_DELIM_CSTRING);
} else if (sc.chNext == '\"') {
sc.Forward();
QuoteStack.Push(sc.ch, BASH_DELIM_LSTRING);
} else if (sc.chNext == '(') {
sc.Forward();
QuoteStack.Push(sc.ch, BASH_DELIM_COMMAND);
}
}
}
}
break;
case SCE_SH_PARAM: // ${parameter}
if (sc.ch == '\\' && Quote.Up != '\\') {
sc.Forward();
} else if (sc.ch == Quote.Down) {
@@ -461,8 +590,14 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
sc.ChangeState(SCE_SH_ERROR);
}
// HereDoc.Quote always == '\''
}
sc.SetState(SCE_SH_HERE_Q);
} else if (HereDoc.DelimiterLength == 0) {
// no delimiter, illegal (but '' and "" are legal)
sc.ChangeState(SCE_SH_ERROR);
sc.SetState(SCE_SH_DEFAULT);
} else {
sc.SetState(SCE_SH_HERE_Q);
}
}
// update cmdState about the current command segment
@@ -494,16 +629,21 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
} else if (setWordStart.Contains(sc.ch)) {
sc.SetState(SCE_SH_WORD);
} else if (sc.ch == '#') {
if (stylePrev != SCE_SH_WORD && stylePrev != SCE_SH_IDENTIFIER &&
(sc.currentPos == 0 || setMetaCharacter.Contains(sc.chPrev))) {
sc.SetState(SCE_SH_COMMENTLINE);
} else {
sc.SetState(SCE_SH_WORD);
}
} else if (sc.ch == '\"') {
sc.SetState(SCE_SH_STRING);
Quote.Start(sc.ch);
QuoteStack.Start(sc.ch, BASH_DELIM_STRING);
} else if (sc.ch == '\'') {
sc.SetState(SCE_SH_CHARACTER);
Quote.Start(sc.ch);
} else if (sc.ch == '`') {
sc.SetState(SCE_SH_BACKTICKS);
Quote.Start(sc.ch);
QuoteStack.Start(sc.ch, BASH_DELIM_BACKTICK);
} else if (sc.ch == '$') {
if (sc.Match("$((")) {
sc.SetState(SCE_SH_OPERATOR); // handle '((' later
@@ -513,17 +653,22 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
sc.Forward();
if (sc.ch == '{') {
sc.ChangeState(SCE_SH_PARAM);
Quote.Start(sc.ch);
} else if (sc.ch == '\'') {
sc.ChangeState(SCE_SH_STRING);
QuoteStack.Start(sc.ch, BASH_DELIM_CSTRING);
} else if (sc.ch == '"') {
sc.ChangeState(SCE_SH_STRING);
} else if (sc.ch == '(' || sc.ch == '`') {
QuoteStack.Start(sc.ch, BASH_DELIM_LSTRING);
} else if (sc.ch == '(') {
sc.ChangeState(SCE_SH_BACKTICKS);
QuoteStack.Start(sc.ch, BASH_DELIM_COMMAND);
} else if (sc.ch == '`') { // $` seen in a configure script, valid?
sc.ChangeState(SCE_SH_BACKTICKS);
QuoteStack.Start(sc.ch, BASH_DELIM_BACKTICK);
} else {
continue; // scalar has no delimiter pair
}
// fallthrough, open delim for $[{'"(`]
Quote.Start(sc.ch);
} else if (sc.Match('<', '<')) {
sc.SetState(SCE_SH_HERE_DELIM);
HereDoc.State = 0;
@@ -597,6 +742,10 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
}// sc.state
}
sc.Complete();
if (sc.state == SCE_SH_HERE_Q) {
styler.ChangeLexerState(sc.currentPos, styler.Length());
}
sc.Complete();
}
static bool IsCommentLine(int line, Accessor &styler) {
@@ -651,7 +800,7 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
if (ch == '<' && chNext == '<') {
levelCurrent++;
}
} else if (style == SCE_SH_HERE_Q && styler.StyleAt(i+1) == SCE_PL_DEFAULT) {
} else if (style == SCE_SH_HERE_Q && styler.StyleAt(i+1) == SCE_SH_DEFAULT) {
levelCurrent--;
}
if (atEOL) {

View File

@@ -49,6 +49,7 @@ using namespace Scintilla;
* 8 - decimal digit
* 16 - hex digit
* 32 - bin digit
* 64 - letter
*/
static int character_classification[128] =
{
@@ -56,10 +57,10 @@ static int character_classification[128] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2,
60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2,
2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4,
2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0
2, 84, 84, 84, 84, 84, 84, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 2, 2, 2, 2, 68,
2, 84, 84, 84, 84, 84, 84, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 2, 2, 2, 2, 0
};
static bool IsSpace(int c) {
@@ -86,6 +87,10 @@ static bool IsBinDigit(int c) {
return c < 128 && (character_classification[c] & 32);
}
static bool IsLetter(int c) {
return c < 128 && (character_classification[c] & 64);
}
static int LowerCase(int c)
{
if (c >= 'A' && c <= 'Z')
@@ -126,13 +131,23 @@ static int CheckPureFoldPoint(char const *token, int &level) {
static int CheckFreeFoldPoint(char const *token, int &level) {
if (!strcmp(token, "function") ||
!strcmp(token, "sub") ||
!strcmp(token, "type")) {
!strcmp(token, "enum") ||
!strcmp(token, "type") ||
!strcmp(token, "union") ||
!strcmp(token, "property") ||
!strcmp(token, "destructor") ||
!strcmp(token, "constructor")) {
level |= SC_FOLDLEVELHEADERFLAG;
return 1;
}
if (!strcmp(token, "end function") ||
!strcmp(token, "end sub") ||
!strcmp(token, "end type")) {
!strcmp(token, "end enum") ||
!strcmp(token, "end type") ||
!strcmp(token, "end union") ||
!strcmp(token, "end property") ||
!strcmp(token, "end destructor") ||
!strcmp(token, "end constructor")) {
return -1;
}
return 0;
@@ -302,6 +317,7 @@ void SCI_METHOD LexerBasic::Lex(unsigned int startPos, int length, int initStyle
bool wasfirst = true, isfirst = true; // true if first token in a line
styler.StartAt(startPos);
int styleBeforeKeyword = SCE_B_DEFAULT;
StyleContext sc(startPos, length, initStyle, styler);
@@ -367,13 +383,43 @@ void SCI_METHOD LexerBasic::Lex(unsigned int startPos, int length, int initStyle
if (sc.atLineEnd) {
sc.SetState(SCE_B_DEFAULT);
}
} else if (sc.state == SCE_B_DOCLINE) {
if (sc.atLineEnd) {
sc.SetState(SCE_B_DEFAULT);
} else if (sc.ch == '\\' || sc.ch == '@') {
if (IsLetter(sc.chNext) && sc.chPrev != '\\') {
styleBeforeKeyword = sc.state;
sc.SetState(SCE_B_DOCKEYWORD);
};
}
} else if (sc.state == SCE_B_DOCKEYWORD) {
if (IsSpace(sc.ch)) {
sc.SetState(styleBeforeKeyword);
} else if (sc.atLineEnd && styleBeforeKeyword == SCE_B_DOCLINE) {
sc.SetState(SCE_B_DEFAULT);
}
} else if (sc.state == SCE_B_COMMENTBLOCK) {
if (sc.Match("\'/")) {
sc.Forward();
sc.ForwardSetState(SCE_B_DEFAULT);
}
} else if (sc.state == SCE_B_DOCBLOCK) {
if (sc.Match("\'/")) {
sc.Forward();
sc.ForwardSetState(SCE_B_DEFAULT);
} else if (sc.ch == '\\' || sc.ch == '@') {
if (IsLetter(sc.chNext) && sc.chPrev != '\\') {
styleBeforeKeyword = sc.state;
sc.SetState(SCE_B_DOCKEYWORD);
};
}
}
if (sc.atLineStart)
isfirst = true;
if (sc.state == SCE_B_DEFAULT || sc.state == SCE_B_ERROR) {
if (isfirst && sc.Match('.')) {
if (isfirst && sc.Match('.') && comment_char != '\'') {
sc.SetState(SCE_B_LABEL);
} else if (isfirst && sc.Match('#')) {
wasfirst = isfirst;
@@ -383,15 +429,25 @@ void SCI_METHOD LexerBasic::Lex(unsigned int startPos, int length, int initStyle
// up in freebasic with SCE_B_PREPROCESSOR.
if (comment_char == '\'' && sc.Match(comment_char, '$'))
sc.SetState(SCE_B_PREPROCESSOR);
else
else if (sc.Match("\'*") || sc.Match("\'!")) {
sc.SetState(SCE_B_DOCLINE);
} else {
sc.SetState(SCE_B_COMMENT);
}
} else if (sc.Match("/\'")) {
if (sc.Match("/\'*") || sc.Match("/\'!")) { // Support of gtk-doc/Doxygen doc. style
sc.SetState(SCE_B_DOCBLOCK);
} else {
sc.SetState(SCE_B_COMMENTBLOCK);
}
sc.Forward(); // Eat the ' so it isn't used for the end of the comment
} else if (sc.Match('"')) {
sc.SetState(SCE_B_STRING);
} else if (IsDigit(sc.ch)) {
sc.SetState(SCE_B_NUMBER);
} else if (sc.Match('$')) {
} else if (sc.Match('$') || sc.Match("&h") || sc.Match("&H") || sc.Match("&o") || sc.Match("&O")) {
sc.SetState(SCE_B_HEXNUMBER);
} else if (sc.Match('%')) {
} else if (sc.Match('%') || sc.Match("&b") || sc.Match("&B")) {
sc.SetState(SCE_B_BINNUMBER);
} else if (sc.Match('#')) {
sc.SetState(SCE_B_CONSTANT);

View File

@@ -116,7 +116,7 @@ static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle
}
blockChange=0;
*/ }
if (!(isascii(ch) && isspace(ch)))
if (!(IsASCII(ch) && isspace(ch)))
visibleChars++;
if (styler.IsLeadByte(ch)) {

View File

@@ -44,13 +44,13 @@ inline bool isCOBOLoperator(char ch)
inline bool isCOBOLwordchar(char ch)
{
return isascii(ch) && (isalnum(ch) || ch == '-');
return IsASCII(ch) && (isalnum(ch) || ch == '-');
}
inline bool isCOBOLwordstart(char ch)
{
return isascii(ch) && isalnum(ch);
return IsASCII(ch) && isalnum(ch);
}
static int CountBits(int nBits)
@@ -90,6 +90,8 @@ static int classifyWordCOBOL(unsigned int start, unsigned int end, /*WordList &k
WordList& c_keywords = *keywordlists[2];
char s[100];
s[0] = '\0';
s[1] = '\0';
getRange(start, end, styler, s, sizeof(s));
char chAttr = SCE_C_IDENTIFIER;
@@ -205,7 +207,7 @@ static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle,
}
if (state == SCE_C_DEFAULT) {
if (isCOBOLwordstart(ch) || (ch == '$' && isascii(chNext) && isalpha(chNext))) {
if (isCOBOLwordstart(ch) || (ch == '$' && IsASCII(chNext) && isalpha(chNext))) {
ColourTo(styler, i-1, state);
state = SCE_C_IDENTIFIER;
} else if (column == 6 && ch == '*') {

View File

@@ -30,6 +30,7 @@
#include "LexerModule.h"
#include "OptionSet.h"
#include "SparseState.h"
#include "SubStyles.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
@@ -65,9 +66,8 @@ static bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
int pos = (int) sc.currentPos;
int currentLine = styler.GetLine(pos);
int lineStartPos = styler.LineStart(currentLine);
char ch;
while (--pos > lineStartPos) {
ch = styler.SafeGetCharAt(pos);
char ch = styler.SafeGetCharAt(pos);
if (ch != ' ' && ch != '\t') {
break;
}
@@ -87,11 +87,15 @@ static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace
std::string restOfLine;
int i =0;
char ch = styler.SafeGetCharAt(start, '\n');
while ((ch != '\r') && (ch != '\n')) {
int endLine = styler.LineEnd(styler.GetLine(start));
while (((start+i) < endLine) && (ch != '\r')) {
char chNext = styler.SafeGetCharAt(start + i + 1, '\n');
if (ch == '/' && (chNext == '/' || chNext == '*'))
break;
if (allowSpace || (ch != ' '))
restOfLine += ch;
i++;
ch = styler.SafeGetCharAt(start + i, '\n');
ch = chNext;
}
return restOfLine;
}
@@ -127,8 +131,9 @@ struct PPDefinition {
int line;
std::string key;
std::string value;
PPDefinition(int line_, const std::string &key_, const std::string &value_) :
line(line_), key(key_), value(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_) {
}
};
@@ -148,7 +153,7 @@ public:
bool IsInactive() const {
return state != 0;
}
bool CurrentIfTaken() {
bool CurrentIfTaken() const {
return (ifTaken & maskLevel()) != 0;
}
void StartSection(bool on) {
@@ -183,7 +188,7 @@ public:
class PPStates {
std::vector<LinePPState> vlls;
public:
LinePPState ForLine(int line) {
LinePPState ForLine(int line) const {
if ((line > 0) && (vlls.size() > static_cast<size_t>(line))) {
return vlls[line];
} else {
@@ -307,7 +312,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
}
};
class LexerCPP : public ILexer {
static const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
class LexerCPP : public ILexerWithSubStyles {
bool caseSensitive;
CharacterSet setWord;
CharacterSet setNegationOp;
@@ -326,14 +333,17 @@ class LexerCPP : public ILexer {
OptionSetCPP osCPP;
SparseState<std::string> rawStringTerminators;
enum { activeFlag = 0x40 };
enum { ssIdentifier, ssDocKeyword };
SubStyles subStyles;
public:
LexerCPP(bool caseSensitive_) :
explicit LexerCPP(bool caseSensitive_) :
caseSensitive(caseSensitive_),
setWord(CharacterSet::setAlphaNum, "._", 0x80, true),
setNegationOp(CharacterSet::setNone, "!"),
setArithmethicOp(CharacterSet::setNone, "+-/*%"),
setRelOp(CharacterSet::setNone, "=!<>"),
setLogicalOp(CharacterSet::setNone, "|&") {
setLogicalOp(CharacterSet::setNone, "|&"),
subStyles(styleSubable, 0x80, 0x40, activeFlag) {
}
virtual ~LexerCPP() {
}
@@ -341,7 +351,7 @@ public:
delete this;
}
int SCI_METHOD Version() const {
return lvOriginal;
return lvSubStyles;
}
const char * SCI_METHOD PropertyNames() {
return osCPP.PropertyNames();
@@ -364,6 +374,40 @@ public:
return 0;
}
int SCI_METHOD LineEndTypesSupported() {
return SC_LINE_END_TYPE_UNICODE;
}
int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) {
return subStyles.Allocate(styleBase, numberStyles);
}
int SCI_METHOD SubStylesStart(int styleBase) {
return subStyles.Start(styleBase);
}
int SCI_METHOD SubStylesLength(int styleBase) {
return subStyles.Length(styleBase);
}
int SCI_METHOD StyleFromSubStyle(int subStyle) {
int styleBase = subStyles.BaseStyle(MaskActive(subStyle));
int active = subStyle & activeFlag;
return styleBase | active;
}
int SCI_METHOD PrimaryStyleFromStyle(int style) {
return MaskActive(style);
}
void SCI_METHOD FreeSubStyles() {
subStyles.Free();
}
void SCI_METHOD SetIdentifiers(int style, const char *identifiers) {
subStyles.SetIdentifiers(style, identifiers);
}
int SCI_METHOD DistanceToSecondaryStyles() {
return activeFlag;
}
const char * SCI_METHOD GetSubStyleBases() {
return styleSubable;
}
static ILexer *LexerFactoryCPP() {
return new LexerCPP(true);
}
@@ -419,9 +463,9 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
if (n == 4) {
// Rebuild preprocessorDefinitions
preprocessorDefinitionsStart.clear();
for (int nDefinition = 0; nDefinition < ppDefinitions.len; nDefinition++) {
char *cpDefinition = ppDefinitions.words[nDefinition];
char *cpEquals = strchr(cpDefinition, '=');
for (int nDefinition = 0; nDefinition < ppDefinitions.Length(); nDefinition++) {
const char *cpDefinition = ppDefinitions.WordAt(nDefinition);
const char *cpEquals = strchr(cpDefinition, '=');
if (cpEquals) {
std::string name(cpDefinition, cpEquals - cpDefinition);
std::string val(cpEquals+1);
@@ -441,7 +485,7 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
// Functor used to truncate history
struct After {
int line;
After(int line_) : line(line_) {}
explicit After(int line_) : line(line_) {}
bool operator()(PPDefinition &p) const {
return p.line > line;
}
@@ -457,6 +501,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
CharacterSet setInvalidRawFirst(CharacterSet::setNone, " )\\\t\v\f\n");
if (options.identifiersAllowDollars) {
setWordStart.Add('$');
}
@@ -467,6 +513,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
int styleBeforeDCKeyword = SCE_C_DEFAULT;
bool continuationLine = false;
bool isIncludePreprocessor = false;
bool isStringInPreprocessor = false;
bool inRERange = false;
bool seenDocKeyBrace = false;
int lineCurrent = styler.GetLine(startPos);
if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
@@ -474,15 +523,10 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
(MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) {
// Set continuationLine if last character of previous line is '\'
if (lineCurrent > 0) {
int chBack = styler.SafeGetCharAt(startPos-1, 0);
int chBack2 = styler.SafeGetCharAt(startPos-2, 0);
int lineEndChar = '!';
if (chBack2 == '\r' && chBack == '\n') {
lineEndChar = styler.SafeGetCharAt(startPos-3, 0);
} else if (chBack == '\n' || chBack == '\r') {
lineEndChar = chBack2;
int endLinePrevious = styler.LineEnd(lineCurrent - 1);
if (endLinePrevious > 0) {
continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\';
}
continuationLine = lineEndChar == '\\';
}
}
@@ -496,7 +540,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
}
StyleContext sc(startPos, length, initStyle, styler, 0x7f);
StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(0xff));
LinePPState preproc = vlls.ForLine(lineCurrent);
bool definitionsChanged = false;
@@ -514,6 +558,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
std::map<std::string, std::string> preprocessorDefinitions = preprocessorDefinitionsStart;
for (std::vector<PPDefinition>::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) {
if (itDef->isUndef)
preprocessorDefinitions.erase(itDef->key);
else
preprocessorDefinitions[itDef->key] = itDef->value;
}
@@ -522,6 +569,11 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
int activitySet = preproc.IsInactive() ? activeFlag : 0;
const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_C_IDENTIFIER);
const WordClassifier &classifierDocKeyWords = subStyles.Classifier(SCE_C_COMMENTDOCKEYWORD);
int lineEndNext = styler.LineEnd(lineCurrent);
for (; sc.More();) {
if (sc.atLineStart) {
@@ -540,6 +592,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
visibleChars = 0;
lastWordWasUUID = false;
isIncludePreprocessor = false;
inRERange = false;
if (preproc.IsInactive()) {
activitySet = activeFlag;
sc.SetState(sc.state | activitySet);
@@ -548,6 +601,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
if (sc.atLineEnd) {
lineCurrent++;
lineEndNext = styler.LineEnd(lineCurrent);
vlls.Add(lineCurrent, preproc);
if (rawStringTerminator != "") {
rawSTNew.Set(lineCurrent-1, rawStringTerminator);
@@ -556,11 +610,13 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
// Handle line continuation generically.
if (sc.ch == '\\') {
if (sc.chNext == '\n' || sc.chNext == '\r') {
if (static_cast<int>((sc.currentPos+1)) >= lineEndNext) {
lineCurrent++;
lineEndNext = styler.LineEnd(lineCurrent);
vlls.Add(lineCurrent, preproc);
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
// Even in UTF-8, \r and \n are separate
sc.Forward();
}
continuationLine = true;
@@ -578,12 +634,21 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
break;
case SCE_C_NUMBER:
// We accept almost anything because of hex. and number suffixes
if (!(setWord.Contains(sc.ch) || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) {
if (sc.ch == '_') {
sc.ChangeState(SCE_C_USERLITERAL|activitySet);
} else if (!(setWord.Contains(sc.ch)
|| (sc.ch == '\'')
|| ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E' ||
sc.chPrev == 'p' || sc.chPrev == 'P')))) {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
break;
case SCE_C_USERLITERAL:
if (!(setWord.Contains(sc.ch)))
sc.SetState(SCE_C_DEFAULT|activitySet);
break;
case SCE_C_IDENTIFIER:
if (!setWord.Contains(sc.ch) || (sc.ch == '.')) {
if (sc.atLineStart || sc.atLineEnd || !setWord.Contains(sc.ch) || (sc.ch == '.')) {
char s[1000];
if (caseSensitive) {
sc.GetCurrent(s, sizeof(s));
@@ -597,11 +662,16 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
sc.ChangeState(SCE_C_WORD2|activitySet);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_C_GLOBALCLASS|activitySet);
} else {
int subStyle = classifierIdentifiers.ValueFor(s);
if (subStyle >= 0) {
sc.ChangeState(subStyle|activitySet);
}
}
const bool literalString = sc.ch == '\"';
if (literalString || sc.ch == '\'') {
size_t lenS = strlen(s);
const bool raw = literalString && sc.chPrev == 'R';
const bool raw = literalString && sc.chPrev == 'R' && !setInvalidRawFirst.Contains(sc.chNext);
if (raw)
s[lenS--] = '\0';
bool valid =
@@ -613,19 +683,30 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
sc.ChangeState((raw ? SCE_C_STRINGRAW : SCE_C_STRING)|activitySet);
else
sc.ChangeState(SCE_C_CHARACTER|activitySet);
}
}
} else {
sc.SetState(SCE_C_DEFAULT | activitySet);
}
} else {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
}
break;
case SCE_C_PREPROCESSOR:
if (options.stylingWithinPreprocessor) {
if (IsASpace(sc.ch)) {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
} else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) {
isStringInPreprocessor = false;
} else if (!isStringInPreprocessor) {
if ((isIncludePreprocessor && sc.Match('<')) || sc.Match('\"')) {
isStringInPreprocessor = true;
} else if (sc.Match('/', '*')) {
if (sc.Match("/**") || sc.Match("/*!")) {
sc.SetState(SCE_C_PREPROCESSORCOMMENTDOC|activitySet);
} else {
if (sc.Match('/', '*')) {
sc.SetState(SCE_C_PREPROCESSORCOMMENT|activitySet);
}
sc.Forward(); // Eat the *
} else if (sc.Match('/', '/')) {
sc.SetState(SCE_C_DEFAULT|activitySet);
@@ -633,6 +714,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
break;
case SCE_C_PREPROCESSORCOMMENT:
case SCE_C_PREPROCESSORCOMMENTDOC:
if (sc.Match('*', '/')) {
sc.Forward();
sc.ForwardSetState(SCE_C_PREPROCESSOR|activitySet);
@@ -678,17 +760,29 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR);
sc.Forward();
sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
} else if (!setDoxygen.Contains(sc.ch)) {
seenDocKeyBrace = false;
} else if (sc.ch == '[' || sc.ch == '{') {
seenDocKeyBrace = true;
} else if (!setDoxygen.Contains(sc.ch)
&& !(seenDocKeyBrace && (sc.ch == ',' || sc.ch == '.'))) {
char s[100];
if (caseSensitive) {
sc.GetCurrent(s, sizeof(s));
} else {
sc.GetCurrentLowered(s, sizeof(s));
}
if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) {
if (!(IsASpace(sc.ch) || (sc.ch == 0))) {
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet);
} else if (!keywords3.InList(s + 1)) {
int subStyleCDKW = classifierDocKeyWords.ValueFor(s+1);
if (subStyleCDKW >= 0) {
sc.ChangeState(subStyleCDKW|activitySet);
} else {
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet);
}
}
sc.SetState(styleBeforeDCKeyword|activitySet);
seenDocKeyBrace = false;
}
break;
case SCE_C_STRING:
@@ -704,8 +798,12 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
sc.Forward();
}
} else if (sc.ch == '\"') {
if (sc.chNext == '_') {
sc.ChangeState(SCE_C_USERLITERAL|activitySet);
} else {
sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
}
}
break;
case SCE_C_HASHQUOTEDSTRING:
if (sc.ch == '\\') {
@@ -732,22 +830,28 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
sc.Forward();
}
} else if (sc.ch == '\'') {
if (sc.chNext == '_') {
sc.ChangeState(SCE_C_USERLITERAL|activitySet);
} else {
sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
}
}
break;
case SCE_C_REGEX:
if (sc.atLineStart) {
sc.SetState(SCE_C_DEFAULT|activitySet);
} else if (sc.ch == '/') {
} else if (! inRERange && sc.ch == '/') {
sc.Forward();
while ((sc.ch < 0x80) && islower(sc.ch))
sc.Forward(); // gobble regex flags
sc.SetState(SCE_C_DEFAULT|activitySet);
} else if (sc.ch == '\\') {
// Gobble up the quoted character
if (sc.chNext == '\\' || sc.chNext == '/') {
} else if (sc.ch == '\\' && (static_cast<int>(sc.currentPos+1) < lineEndNext)) {
// Gobble up the escaped character
sc.Forward();
}
} else if (sc.ch == '[') {
inRERange = true;
} else if (sc.ch == ']') {
inRERange = false;
}
break;
case SCE_C_STRINGEOL:
@@ -773,7 +877,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
break;
case SCE_C_UUID:
if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') {
if (sc.atLineEnd || sc.ch == ')') {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
}
@@ -781,6 +885,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
if (sc.atLineEnd && !atLineEndBeforeSwitch) {
// State exit processing consumed characters up to end of line.
lineCurrent++;
lineEndNext = styler.LineEnd(lineCurrent);
vlls.Add(lineCurrent, preproc);
}
@@ -802,7 +907,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
} else {
sc.SetState(SCE_C_NUMBER|activitySet);
}
} else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) {
} else if (!sc.atLineEnd && (setWordStart.Contains(sc.ch) || (sc.ch == '@'))) {
if (lastWordWasUUID) {
sc.SetState(SCE_C_UUID|activitySet);
lastWordWasUUID = false;
@@ -828,6 +933,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
&& (!setCouldBePostOp.Contains(chPrevNonWhite)
|| !FollowsPostfixOperator(sc, styler))) {
sc.SetState(SCE_C_REGEX|activitySet); // JavaScript's RegEx
inRERange = false;
} else if (sc.ch == '\"') {
if (sc.chPrev == 'R') {
styler.Flush();
@@ -927,10 +1033,22 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
}
}
} else if (sc.Match("undef")) {
if (options.updatePreprocessor && !preproc.IsInactive()) {
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, true);
std::vector<std::string> tokens = Tokenize(restOfLine);
std::string key;
if (tokens.size() >= 1) {
key = tokens[0];
preprocessorDefinitions.erase(key);
ppDefineHistory.push_back(PPDefinition(lineCurrent, key, "", true));
definitionsChanged = true;
}
}
}
} else if (isoperator(static_cast<char>(sc.ch))) {
}
}
} else if (isoperator(sc.ch)) {
sc.SetState(SCE_C_OPERATOR|activitySet);
}
}
@@ -961,10 +1079,12 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
unsigned int endPos = startPos + length;
int visibleChars = 0;
bool inLineComment = false;
int lineCurrent = styler.GetLine(startPos);
int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0)
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
unsigned int lineStartNext = styler.LineStart(lineCurrent+1);
int levelMinCurrent = levelCurrent;
int levelNext = levelCurrent;
char chNext = styler[startPos];
@@ -977,11 +1097,13 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
int stylePrev = style;
style = styleNext;
styleNext = MaskActive(styler.StyleAt(i + 1));
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style)) {
if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_C_COMMENTLINEDOC)) {
bool atEOL = i == (lineStartNext-1);
if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC))
inLineComment = true;
if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
if (!IsStreamCommentStyle(stylePrev)) {
levelNext++;
} else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_C_COMMENTLINEDOC) && !atEOL) {
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelNext--;
}
@@ -1045,6 +1167,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
styler.SetLevel(lineCurrent, lev);
}
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent+1);
levelCurrent = levelNext;
levelMinCurrent = levelCurrent;
if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
@@ -1052,6 +1175,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
}
visibleChars = 0;
inLineComment = false;
}
}
}
@@ -1165,7 +1289,7 @@ bool LexerCPP::EvaluateExpression(const std::string &expr, const std::map<std::s
std::vector<std::string> tokens;
const char *cp = expr.c_str();
for (;;) {
if (setWord.Contains(*cp)) {
if (setWord.Contains(static_cast<unsigned char>(*cp))) {
word += *cp;
} else {
std::map<std::string, std::string>::const_iterator it = preprocessorDefinitions.find(word);
@@ -1180,13 +1304,13 @@ bool LexerCPP::EvaluateExpression(const std::string &expr, const std::map<std::s
}
if ((*cp != ' ') && (*cp != '\t')) {
std::string op(cp, 1);
if (setRelOp.Contains(*cp)) {
if (setRelOp.Contains(cp[1])) {
if (setRelOp.Contains(static_cast<unsigned char>(*cp))) {
if (setRelOp.Contains(static_cast<unsigned char>(cp[1]))) {
op += cp[1];
cp++;
}
} else if (setLogicalOp.Contains(*cp)) {
if (setLogicalOp.Contains(cp[1])) {
} else if (setLogicalOp.Contains(static_cast<unsigned char>(*cp))) {
if (setLogicalOp.Contains(static_cast<unsigned char>(cp[1]))) {
op += cp[1];
cp++;
}

View File

@@ -226,14 +226,13 @@ static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *
break;
case SCE_CMAKE_COMMENT:
if ( cNextChar == '\n' || cNextChar == '\r' ) {
// Special case:
if ( cCurrChar == '\\' ) {
if ( cCurrChar == '\n' || cCurrChar == '\r' ) {
if ( styler.SafeGetCharAt(i-1) == '\\' ) {
styler.ColourTo(i-2,state);
styler.ColourTo(i,SCE_CMAKE_DEFAULT);
styler.ColourTo(i-1,SCE_CMAKE_DEFAULT);
}
else {
styler.ColourTo(i,state);
styler.ColourTo(i-1,state);
state = SCE_CMAKE_DEFAULT;
}
}
@@ -335,10 +334,7 @@ static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *
break;
}
if ( state == SCE_CMAKE_COMMENT) {
styler.ColourTo(i,state);
}
else if ( state == SCE_CMAKE_STRINGDQ || state == SCE_CMAKE_STRINGLQ || state == SCE_CMAKE_STRINGRQ ) {
if ( state == SCE_CMAKE_STRINGDQ || state == SCE_CMAKE_STRINGLQ || state == SCE_CMAKE_STRINGRQ ) {
bool bIngoreNextDollarSign = false;
if ( bVarInString && cCurrChar == '$' ) {

View File

@@ -31,16 +31,16 @@ using namespace Scintilla;
#endif
static 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
|| state == SCE_C_COMMENTDOCKEYWORDERROR
return (state <= SCE_COFFEESCRIPT_COMMENTDOC
// including SCE_COFFEESCRIPT_DEFAULT, SCE_COFFEESCRIPT_COMMENT, SCE_COFFEESCRIPT_COMMENTLINE
|| state == SCE_COFFEESCRIPT_COMMENTLINEDOC
|| state == SCE_COFFEESCRIPT_COMMENTDOCKEYWORD
|| state == SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR
|| state == SCE_COFFEESCRIPT_COMMENTBLOCK
|| state == SCE_COFFEESCRIPT_VERBOSE_REGEX
|| state == SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT
|| state == SCE_C_WORD
|| state == SCE_C_REGEX);
|| state == SCE_COFFEESCRIPT_WORD
|| state == SCE_COFFEESCRIPT_REGEX);
}
// Preconditions: sc.currentPos points to a character after '+' or '-'.
@@ -115,11 +115,11 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
int chPrevNonWhite = ' ';
int visibleChars = 0;
bool lastWordWasUUID = false;
int styleBeforeDCKeyword = SCE_C_DEFAULT;
int styleBeforeDCKeyword = SCE_COFFEESCRIPT_DEFAULT;
bool continuationLine = false;
bool isIncludePreprocessor = false;
if (initStyle == SCE_C_PREPROCESSOR) {
if (initStyle == SCE_COFFEESCRIPT_PREPROCESSOR) {
// Set continuationLine if last character of previous line is '\'
int lineCurrent = styler.GetLine(startPos);
if (lineCurrent > 0) {
@@ -137,16 +137,19 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
// look back to set chPrevNonWhite properly for better regex colouring
int endPos = startPos + length;
if (startPos > 0) {
if (startPos > 0 && IsSpaceEquiv(initStyle)) {
unsigned int back = startPos;
styler.Flush();
while (back > 0 && IsSpaceEquiv(styler.StyleAt(--back)))
;
if (styler.StyleAt(back) == SCE_C_OPERATOR) {
if (styler.StyleAt(back) == SCE_COFFEESCRIPT_OPERATOR) {
chPrevNonWhite = styler.SafeGetCharAt(back);
}
if (startPos != back) {
initStyle = styler.StyleAt(back);
if (IsSpaceEquiv(initStyle)) {
initStyle = SCE_COFFEESCRIPT_DEFAULT;
}
}
startPos = back;
}
@@ -177,95 +180,95 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
// Determine if the current state should terminate.
switch (sc.state) {
case SCE_C_OPERATOR:
sc.SetState(SCE_C_DEFAULT);
case SCE_COFFEESCRIPT_OPERATOR:
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
break;
case SCE_C_NUMBER:
case SCE_COFFEESCRIPT_NUMBER:
// We accept almost anything because of hex. and number suffixes
if (!setWord.Contains(sc.ch)) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_IDENTIFIER:
case SCE_COFFEESCRIPT_IDENTIFIER:
if (!setWord.Contains(sc.ch) || (sc.ch == '.') || (sc.ch == '$')) {
char s[1000];
sc.GetCurrent(s, sizeof(s));
if (keywords.InList(s)) {
lastWordWasUUID = strcmp(s, "uuid") == 0;
sc.ChangeState(SCE_C_WORD);
sc.ChangeState(SCE_COFFEESCRIPT_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_C_WORD2);
sc.ChangeState(SCE_COFFEESCRIPT_WORD2);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_C_GLOBALCLASS);
sc.ChangeState(SCE_COFFEESCRIPT_GLOBALCLASS);
}
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_PREPROCESSOR:
case SCE_COFFEESCRIPT_PREPROCESSOR:
if (sc.atLineStart && !continuationLine) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (stylingWithinPreprocessor) {
if (IsASpace(sc.ch)) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
} else {
if (sc.Match('/', '*') || sc.Match('/', '/')) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
}
break;
case SCE_C_COMMENT:
case SCE_COFFEESCRIPT_COMMENT:
if (sc.Match('*', '/')) {
sc.Forward();
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_COMMENTDOC:
case SCE_COFFEESCRIPT_COMMENTDOC:
if (sc.Match('*', '/')) {
sc.Forward();
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
// Verify that we have the conditions to mark a comment-doc-keyword
if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
styleBeforeDCKeyword = SCE_C_COMMENTDOC;
sc.SetState(SCE_C_COMMENTDOCKEYWORD);
styleBeforeDCKeyword = SCE_COFFEESCRIPT_COMMENTDOC;
sc.SetState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORD);
}
}
break;
case SCE_C_COMMENTLINE:
case SCE_COFFEESCRIPT_COMMENTLINE:
if (sc.atLineStart) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_COMMENTLINEDOC:
case SCE_COFFEESCRIPT_COMMENTLINEDOC:
if (sc.atLineStart) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
// Verify that we have the conditions to mark a comment-doc-keyword
if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) {
styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC;
sc.SetState(SCE_C_COMMENTDOCKEYWORD);
styleBeforeDCKeyword = SCE_COFFEESCRIPT_COMMENTLINEDOC;
sc.SetState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORD);
}
}
break;
case SCE_C_COMMENTDOCKEYWORD:
if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) {
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR);
case SCE_COFFEESCRIPT_COMMENTDOCKEYWORD:
if ((styleBeforeDCKeyword == SCE_COFFEESCRIPT_COMMENTDOC) && sc.Match('*', '/')) {
sc.ChangeState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR);
sc.Forward();
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (!setDoxygen.Contains(sc.ch)) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) {
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR);
sc.ChangeState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR);
}
sc.SetState(styleBeforeDCKeyword);
}
break;
case SCE_C_STRING:
case SCE_COFFEESCRIPT_STRING:
if (isIncludePreprocessor) {
if (sc.ch == '>') {
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
isIncludePreprocessor = false;
}
} else if (sc.ch == '\\') {
@@ -273,26 +276,26 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
sc.Forward();
}
} else if (sc.ch == '\"') {
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_CHARACTER:
case SCE_COFFEESCRIPT_CHARACTER:
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
sc.Forward();
}
} else if (sc.ch == '\'') {
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_REGEX:
case SCE_COFFEESCRIPT_REGEX:
if (sc.atLineStart) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (sc.ch == '/') {
sc.Forward();
while ((sc.ch < 0x80) && islower(sc.ch))
sc.Forward(); // gobble regex flags
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (sc.ch == '\\') {
// Gobble up the quoted character
if (sc.chNext == '\\' || sc.chNext == '/') {
@@ -300,31 +303,30 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
}
}
break;
case SCE_C_STRINGEOL:
case SCE_COFFEESCRIPT_STRINGEOL:
if (sc.atLineStart) {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_C_VERBATIM:
case SCE_COFFEESCRIPT_VERBATIM:
if (sc.ch == '\"') {
if (sc.chNext == '\"') {
sc.Forward();
} else {
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
}
}
break;
case SCE_C_UUID:
case SCE_COFFEESCRIPT_UUID:
if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') {
sc.SetState(SCE_C_DEFAULT);
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
break;
case SCE_COFFEESCRIPT_COMMENTBLOCK:
if (sc.Match("###")) {
sc.ChangeState(SCE_C_COMMENT);
sc.Forward();
sc.Forward();
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (sc.ch == '\\') {
sc.Forward();
}
@@ -333,10 +335,8 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
if (sc.Match("///")) {
sc.Forward();
sc.Forward();
sc.ChangeState(SCE_C_REGEX);
sc.ForwardSetState(SCE_C_DEFAULT);
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
} else if (sc.Match('#')) {
sc.ChangeState(SCE_C_REGEX);
sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT);
} else if (sc.ch == '\\') {
sc.Forward();
@@ -344,61 +344,65 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
break;
case SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT:
if (sc.atLineStart) {
sc.ChangeState(SCE_C_COMMENT);
sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX);
}
break;
}
// Determine if a new state should be entered.
if (sc.state == SCE_C_DEFAULT) {
if (sc.state == SCE_COFFEESCRIPT_DEFAULT) {
if (sc.Match('@', '\"')) {
sc.SetState(SCE_C_VERBATIM);
sc.SetState(SCE_COFFEESCRIPT_VERBATIM);
sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
if (lastWordWasUUID) {
sc.SetState(SCE_C_UUID);
sc.SetState(SCE_COFFEESCRIPT_UUID);
lastWordWasUUID = false;
} else {
sc.SetState(SCE_C_NUMBER);
sc.SetState(SCE_COFFEESCRIPT_NUMBER);
}
} else if (setWordStart.Contains(sc.ch) || (sc.ch == '@') || (sc.ch == '$')) {
if (lastWordWasUUID) {
sc.SetState(SCE_C_UUID);
sc.SetState(SCE_COFFEESCRIPT_UUID);
lastWordWasUUID = false;
} else {
sc.SetState(SCE_C_IDENTIFIER);
sc.SetState(SCE_COFFEESCRIPT_IDENTIFIER);
}
} else if (sc.Match('/', '*')) {
if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style
sc.SetState(SCE_C_COMMENTDOC);
sc.SetState(SCE_COFFEESCRIPT_COMMENTDOC);
} else {
sc.SetState(SCE_C_COMMENT);
sc.SetState(SCE_COFFEESCRIPT_COMMENT);
}
sc.Forward(); // Eat the * so it isn't used for the end of the comment
} else if (sc.Match("///")) {
sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX);
sc.Forward();
sc.Forward();
} else if (sc.ch == '/'
&& (setOKBeforeRE.Contains(chPrevNonWhite)
|| followsReturnKeyword(sc, styler))
&& (!setCouldBePostOp.Contains(chPrevNonWhite)
|| !FollowsPostfixOperator(sc, styler))) {
sc.SetState(SCE_C_REGEX); // JavaScript's RegEx
sc.SetState(SCE_COFFEESCRIPT_REGEX); // JavaScript's RegEx
} else if (sc.ch == '\"') {
sc.SetState(SCE_C_STRING);
sc.SetState(SCE_COFFEESCRIPT_STRING);
isIncludePreprocessor = false; // ensure that '>' won't end the string
} else if (isIncludePreprocessor && sc.ch == '<') {
sc.SetState(SCE_C_STRING);
sc.SetState(SCE_COFFEESCRIPT_STRING);
} else if (sc.ch == '\'') {
sc.SetState(SCE_C_CHARACTER);
sc.SetState(SCE_COFFEESCRIPT_CHARACTER);
} else if (sc.ch == '#') {
if (sc.Match("###")) {
sc.SetState(SCE_COFFEESCRIPT_COMMENTBLOCK);
sc.Forward();
sc.Forward();
} else {
sc.SetState(SCE_C_COMMENTLINE);
sc.SetState(SCE_COFFEESCRIPT_COMMENTLINE);
}
} else if (isoperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_C_OPERATOR);
sc.SetState(SCE_COFFEESCRIPT_OPERATOR);
}
}
@@ -408,18 +412,6 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
}
continuationLine = false;
}
// Change temporary coffeescript states into standard C ones.
switch (sc.state) {
case SCE_COFFEESCRIPT_COMMENTBLOCK:
sc.ChangeState(SCE_C_COMMENT);
break;
case SCE_COFFEESCRIPT_VERBOSE_REGEX:
sc.ChangeState(SCE_C_REGEX);
break;
case SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT:
sc.ChangeState(SCE_C_COMMENTLINE);
break;
}
sc.Complete();
}

View File

@@ -37,7 +37,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
char chNext = styler[startPos];
int lengthDoc = startPos + length;
// create a buffer large enough to take the largest chunk...
char *buffer = new char[length];
char *buffer = new char[length+1];
int bufferCount = 0;
// this assumes that we have 2 keyword list in conf.properties
@@ -74,17 +74,17 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
} else if( ch == '"') {
state = SCE_CONF_STRING;
styler.ColourTo(i,SCE_CONF_STRING);
} else if( isascii(ch) && ispunct(ch) ) {
} else if( IsASCII(ch) && ispunct(ch) ) {
// signals an operator...
// no state jump necessary for this
// simple case...
styler.ColourTo(i,SCE_CONF_OPERATOR);
} else if( isascii(ch) && isalpha(ch) ) {
} else if( IsASCII(ch) && isalpha(ch) ) {
// signals the start of an identifier
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
state = SCE_CONF_IDENTIFIER;
} else if( isascii(ch) && isdigit(ch) ) {
} else if( IsASCII(ch) && isdigit(ch) ) {
// signals the start of a number
bufferCount = 0;
buffer[bufferCount++] = ch;
@@ -111,7 +111,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
// if we find a non-alphanumeric char,
// we simply go to default state
// else we're still dealing with an extension...
if( (isascii(ch) && isalnum(ch)) || (ch == '_') ||
if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') ||
(ch == '-') || (ch == '$') ||
(ch == '/') || (ch == '.') || (ch == '*') )
{
@@ -133,7 +133,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
case SCE_CONF_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) {
if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_CONF_DEFAULT;
@@ -158,7 +158,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
case SCE_CONF_NUMBER:
// stay in CONF_NUMBER state until we find a non-numeric
if( (isascii(ch) && isdigit(ch)) || ch == '.') {
if( (IsASCII(ch) && isdigit(ch)) || ch == '.') {
buffer[bufferCount++] = ch;
} else {
state = SCE_CONF_DEFAULT;

View File

@@ -36,7 +36,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
char chNext = styler[startPos];
int lengthDoc = startPos + length;
// create a buffer large enough to take the largest chunk...
char *buffer = new char[length];
char *buffer = new char[length+1];
int bufferCount = 0;
// used when highliting environment variables inside quoted string:
bool insideString = false;
@@ -98,12 +98,12 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
// signals an asterisk
// no state jump necessary for this simple case...
styler.ColourTo(i,SCE_NNCRONTAB_ASTERISK);
} else if( (isascii(ch) && isalpha(ch)) || ch == '<' ) {
} else if( (IsASCII(ch) && isalpha(ch)) || ch == '<' ) {
// signals the start of an identifier
bufferCount = 0;
buffer[bufferCount++] = ch;
state = SCE_NNCRONTAB_IDENTIFIER;
} else if( isascii(ch) && isdigit(ch) ) {
} else if( IsASCII(ch) && isdigit(ch) ) {
// signals the start of a number
bufferCount = 0;
buffer[bufferCount++] = ch;
@@ -171,7 +171,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
case SCE_NNCRONTAB_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') ||
if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') ||
(ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ||
(ch == '@') ) {
buffer[bufferCount++] = ch;
@@ -200,7 +200,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
case SCE_NNCRONTAB_NUMBER:
// stay in CONF_NUMBER state until we find a non-numeric
if( isascii(ch) && isdigit(ch) /* || ch == '.' */ ) {
if( IsASCII(ch) && isdigit(ch) /* || ch == '.' */ ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_NNCRONTAB_DEFAULT;

View File

@@ -39,7 +39,7 @@ static inline bool IsAWordStart(const int ch) {
}
static inline bool IsCsoundOperator(char ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||

View File

@@ -41,15 +41,15 @@ using namespace Scintilla;
// Underscore, letter, digit and universal alphas from C99 Appendix D.
static bool IsWordStart(int ch) {
return (isascii(ch) && (isalpha(ch) || ch == '_')) || !isascii(ch);
return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch);
}
static bool IsWord(int ch) {
return (isascii(ch) && (isalnum(ch) || ch == '_')) || !isascii(ch);
return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch);
}
static bool IsDoxygen(int ch) {
if (isascii(ch) && islower(ch))
if (IsASCII(ch) && islower(ch))
return true;
if (ch == '$' || ch == '@' || ch == '\\' ||
ch == '&' || ch == '#' || ch == '<' || ch == '>' ||
@@ -267,7 +267,7 @@ void SCI_METHOD LexerD::Lex(unsigned int startPos, int length, int initStyle, ID
break;
case SCE_D_NUMBER:
// We accept almost anything because of hex. and number suffixes
if (isascii(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) {
if (IsASCII(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) {
continue;
} else if (sc.ch == '.' && sc.chNext != '.' && !numFloat) {
// Don't parse 0..2 as number.

View File

@@ -0,0 +1,228 @@
// Scintilla source code edit control
/** @file LexDMAP.cxx
** Lexer for MSC Nastran DMAP.
** Written by Mark Robinson, based on the Fortran lexer by Chuan-jian Shen, Last changed Aug. 2013
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
/***************************************/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
/***************************************/
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
/***************************************/
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
/***********************************************/
static inline bool IsAWordChar(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%');
}
/**********************************************/
static inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch));
}
/***************************************/
static void ColouriseDMAPDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
/***************************************/
int posLineStart = 0, numNonBlank = 0;
int endPos = startPos + length;
/***************************************/
// backtrack to the nearest keyword
while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_DMAP_WORD)) {
startPos--;
}
startPos = styler.LineStart(styler.GetLine(startPos));
initStyle = styler.StyleAt(startPos - 1);
StyleContext sc(startPos, endPos-startPos, initStyle, styler);
/***************************************/
for (; sc.More(); sc.Forward()) {
// remember the start position of the line
if (sc.atLineStart) {
posLineStart = sc.currentPos;
numNonBlank = 0;
sc.SetState(SCE_DMAP_DEFAULT);
}
if (!IsASpaceOrTab(sc.ch)) numNonBlank ++;
/***********************************************/
// Handle data appearing after column 72; it is ignored
int toLineStart = sc.currentPos - posLineStart;
if (toLineStart >= 72 || sc.ch == '$') {
sc.SetState(SCE_DMAP_COMMENT);
while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end
continue;
}
/***************************************/
// Determine if the current state should terminate.
if (sc.state == SCE_DMAP_OPERATOR) {
sc.SetState(SCE_DMAP_DEFAULT);
} else if (sc.state == SCE_DMAP_NUMBER) {
if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) {
sc.SetState(SCE_DMAP_DEFAULT);
}
} else if (sc.state == SCE_DMAP_IDENTIFIER) {
if (!IsAWordChar(sc.ch) || (sc.ch == '%')) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (keywords.InList(s)) {
sc.ChangeState(SCE_DMAP_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_DMAP_WORD2);
} else if (keywords3.InList(s)) {
sc.ChangeState(SCE_DMAP_WORD3);
}
sc.SetState(SCE_DMAP_DEFAULT);
}
} else if (sc.state == SCE_DMAP_COMMENT) {
if (sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_DMAP_DEFAULT);
}
} else if (sc.state == SCE_DMAP_STRING1) {
if (sc.ch == '\'') {
if (sc.chNext == '\'') {
sc.Forward();
} else {
sc.ForwardSetState(SCE_DMAP_DEFAULT);
}
} else if (sc.atLineEnd) {
sc.ChangeState(SCE_DMAP_STRINGEOL);
sc.ForwardSetState(SCE_DMAP_DEFAULT);
}
} else if (sc.state == SCE_DMAP_STRING2) {
if (sc.atLineEnd) {
sc.ChangeState(SCE_DMAP_STRINGEOL);
sc.ForwardSetState(SCE_DMAP_DEFAULT);
} else if (sc.ch == '\"') {
if (sc.chNext == '\"') {
sc.Forward();
} else {
sc.ForwardSetState(SCE_DMAP_DEFAULT);
}
}
}
/***************************************/
// Determine if a new state should be entered.
if (sc.state == SCE_DMAP_DEFAULT) {
if (sc.ch == '$') {
sc.SetState(SCE_DMAP_COMMENT);
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)) || (sc.ch == '-' && IsADigit(sc.chNext))) {
sc.SetState(SCE_F_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_DMAP_IDENTIFIER);
} else if (sc.ch == '\"') {
sc.SetState(SCE_DMAP_STRING2);
} else if (sc.ch == '\'') {
sc.SetState(SCE_DMAP_STRING1);
} else if (isoperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_DMAP_OPERATOR);
}
}
}
sc.Complete();
}
/***************************************/
// To determine the folding level depending on keywords
static int classifyFoldPointDMAP(const char* s, const char* prevWord) {
int lev = 0;
if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "enddo") == 0 || strcmp(s, "endif") == 0) {
lev = -1;
} else if ((strcmp(prevWord, "do") == 0 && strcmp(s, "while") == 0) || strcmp(s, "then") == 0) {
lev = 1;
}
return lev;
}
// Folding the code
static void FoldDMAPDoc(unsigned int startPos, int length, int initStyle,
WordList *[], Accessor &styler) {
//
// bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
// Do not know how to fold the comment at the moment.
//
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
/***************************************/
int lastStart = 0;
char prevWord[32] = "";
/***************************************/
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
//
if ((stylePrev == SCE_DMAP_DEFAULT || stylePrev == SCE_DMAP_OPERATOR || stylePrev == SCE_DMAP_COMMENT) && (style == SCE_DMAP_WORD)) {
// Store last word and label start point.
lastStart = i;
}
/***************************************/
if (style == SCE_DMAP_WORD) {
if(iswordchar(ch) && !iswordchar(chNext)) {
char s[32];
unsigned int k;
for(k=0; (k<31 ) && (k<i-lastStart+1 ); k++) {
s[k] = static_cast<char>(tolower(styler[lastStart+k]));
}
s[k] = '\0';
levelCurrent += classifyFoldPointDMAP(s, prevWord);
strcpy(prevWord, s);
}
}
if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev);
}
lineCurrent++;
levelPrev = levelCurrent;
visibleChars = 0;
strcpy(prevWord, "");
}
/***************************************/
if (!isspacechar(ch)) visibleChars++;
}
/***************************************/
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
/***************************************/
static const char * const DMAPWordLists[] = {
"Primary keywords and identifiers",
"Intrinsic functions",
"Extended and user defined functions",
0,
};
/***************************************/
LexerModule lmDMAP(SCLEX_DMAP, ColouriseDMAPDoc, "DMAP", FoldDMAPDoc, DMAPWordLists);

View File

@@ -47,10 +47,19 @@ using namespace Scintilla;
#endif
static bool IsSpaceEquiv(int state) {
return (state <= SCE_ECL_COMMENTDOC) ||
// including SCE_ECL_DEFAULT, SCE_ECL_COMMENT, SCE_ECL_COMMENTLINE
(state == SCE_ECL_COMMENTLINEDOC) || (state == SCE_ECL_COMMENTDOCKEYWORD) ||
(state == SCE_ECL_COMMENTDOCKEYWORDERROR);
switch (state) {
case SCE_ECL_DEFAULT:
case SCE_ECL_COMMENT:
case SCE_ECL_COMMENTLINE:
case SCE_ECL_COMMENTLINEDOC:
case SCE_ECL_COMMENTDOCKEYWORD:
case SCE_ECL_COMMENTDOCKEYWORDERROR:
case SCE_ECL_COMMENTDOC:
return true;
default:
return false;
}
}
static void ColouriseEclDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],

View File

@@ -27,15 +27,6 @@
using namespace Scintilla;
#endif
static inline bool IsAWordChar(int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
ch == '_' || ch == '?' || ch == '"' || ch == '@' ||
ch == '!' || ch == '[' || ch == ']' || ch == '/' ||
ch == '+' || ch == '-' || ch == '*' || ch == '<' ||
ch == '>' || ch == '=' || ch == ';' || ch == '(' ||
ch == ')' );
}
static inline bool IsAWordStart(int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
}
@@ -123,29 +114,29 @@ static void ColouriseForthDoc(unsigned int startPos, int length, int initStyle,
(sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
(sc.atLineEnd || IsASpaceChar(sc.chNext))) {
sc.SetState(SCE_FORTH_COMMENT_ML);
} else if ( (sc.ch == '$' && (isascii(sc.chNext) && isxdigit(sc.chNext))) ) {
} else if ( (sc.ch == '$' && (IsASCII(sc.chNext) && isxdigit(sc.chNext))) ) {
// number starting with $ is a hex number
sc.SetState(SCE_FORTH_NUMBER);
while(sc.More() && isascii(sc.chNext) && isxdigit(sc.chNext))
while(sc.More() && IsASCII(sc.chNext) && isxdigit(sc.chNext))
sc.Forward();
} else if ( (sc.ch == '%' && (isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
} else if ( (sc.ch == '%' && (IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
// number starting with % is binary
sc.SetState(SCE_FORTH_NUMBER);
while(sc.More() && isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
while(sc.More() && IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
sc.Forward();
} else if ( isascii(sc.ch) &&
(isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && isascii(sc.chNext) && isxdigit(sc.chNext)) )
} else if ( IsASCII(sc.ch) &&
(isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && IsASCII(sc.chNext) && isxdigit(sc.chNext)) )
){
sc.SetState(SCE_FORTH_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_FORTH_IDENTIFIER);
} else if (sc.ch == '{') {
sc.SetState(SCE_FORTH_LOCALE);
} else if (sc.ch == ':' && isascii(sc.chNext) && isspace(sc.chNext)) {
} else if (sc.ch == ':' && IsASCII(sc.chNext) && isspace(sc.chNext)) {
// highlight word definitions e.g. : GCD ( n n -- n ) ..... ;
// ^ ^^^
sc.SetState(SCE_FORTH_DEFWORD);
while(sc.More() && isascii(sc.chNext) && isspace(sc.chNext))
while(sc.More() && IsASCII(sc.chNext) && isspace(sc.chNext))
sc.Forward();
} else if (sc.ch == ';' &&
(sc.atLineStart || IsASpaceChar(sc.chPrev)) &&

View File

@@ -38,15 +38,15 @@ static inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch));
}
/***************************************/
inline bool IsABlank(unsigned int ch) {
static inline bool IsABlank(unsigned int ch) {
return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ;
}
/***************************************/
inline bool IsALineEnd(char ch) {
static inline bool IsALineEnd(char ch) {
return ((ch == '\n') || (ch == '\r')) ;
}
/***************************************/
unsigned int GetContinuedPos(unsigned int pos, Accessor &styler) {
static unsigned int GetContinuedPos(unsigned int pos, Accessor &styler) {
while (!IsALineEnd(styler.SafeGetCharAt(pos++))) continue;
if (styler.SafeGetCharAt(pos) == '\n') pos++;
while (IsABlank(styler.SafeGetCharAt(pos++))) continue;
@@ -254,16 +254,18 @@ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle
// To determine the folding level depending on keywords
static int classifyFoldPointFortran(const char* s, const char* prevWord, const char chNextNonBlank) {
int lev = 0;
if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0)
return -1;
if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0
if ((strcmp(prevWord, "module") == 0 && strcmp(s, "subroutine") == 0)
|| (strcmp(prevWord, "module") == 0 && strcmp(s, "function") == 0)) {
lev = 0;
} else if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0
|| strcmp(s, "blockdata") == 0 || strcmp(s, "select") == 0
|| strcmp(s, "do") == 0 || strcmp(s, "enum") ==0
|| strcmp(s, "function") == 0 || strcmp(s, "interface") == 0
|| strcmp(s, "module") == 0 || strcmp(s, "program") == 0
|| strcmp(s, "subroutine") == 0 || strcmp(s, "then") == 0
|| (strcmp(s, "type") == 0 && chNextNonBlank != '(')
|| strcmp(s, "critical") == 0){
|| strcmp(s, "critical") == 0 || strcmp(s, "submodule") == 0){
if (strcmp(prevWord, "end") == 0)
lev = 0;
else
@@ -277,15 +279,20 @@ static int classifyFoldPointFortran(const char* s, const char* prevWord, const c
|| strcmp(s, "endmodule") == 0 || strcmp(s, "endprogram") == 0
|| strcmp(s, "endsubroutine") == 0 || strcmp(s, "endtype") == 0
|| strcmp(s, "endwhere") == 0 || strcmp(s, "endcritical") == 0
|| (strcmp(s, "procedure") == 0 && strcmp(prevWord, "module") == 0) ) { // Take care of the "module procedure" statement
|| (strcmp(prevWord, "module") == 0 && strcmp(s, "procedure") == 0) // Take care of the "module procedure" statement
|| strcmp(s, "endsubmodule") == 0) {
lev = -1;
} else if (strcmp(prevWord, "end") == 0 && strcmp(s, "if") == 0){ // end if
lev = 0;
} else if (strcmp(prevWord, "type") == 0 && strcmp(s, "is") == 0){ // type is
lev = -1;
} else if ((strcmp(prevWord, "end") == 0 && strcmp(s, "procedure") == 0)
|| strcmp(s, "endprocedure") == 0) {
lev = 1; // level back to 0, because no folding support for "module procedure" in submodule
}
return lev;
}
/***************************************/
// Folding the code
static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
Accessor &styler, bool isFixFormat) {
@@ -297,12 +304,22 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
unsigned int endPos = startPos + length;
int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
int levelCurrent;
bool isPrevLine;
if (lineCurrent > 0) {
lineCurrent--;
startPos = styler.LineStart(lineCurrent);
levelCurrent = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
isPrevLine = true;
} else {
levelCurrent = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
isPrevLine = false;
}
char chNext = styler[startPos];
char chNextNonBlank;
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
int levelDeltaNext = 0;
/***************************************/
int lastStart = 0;
char prevWord[32] = "";
@@ -315,17 +332,28 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
chNextNonBlank = chNext;
bool nextEOL = false;
if (IsALineEnd(chNextNonBlank)) {
nextEOL = true;
}
unsigned int j=i+1;
while(IsABlank(chNextNonBlank) && j<endPos) {
j ++ ;
chNextNonBlank = styler.SafeGetCharAt(j);
if (IsALineEnd(chNextNonBlank)) {
nextEOL = true;
}
}
if (!nextEOL && j == endPos) {
nextEOL = true;
}
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
//
if (((isFixFormat && stylePrev == SCE_F_CONTINUATION) || stylePrev == SCE_F_DEFAULT || stylePrev == SCE_F_OPERATOR) && (style == SCE_F_WORD || style == SCE_F_LABEL)) {
if (((isFixFormat && stylePrev == SCE_F_CONTINUATION) || stylePrev == SCE_F_DEFAULT
|| stylePrev == SCE_F_OPERATOR) && (style == SCE_F_WORD || style == SCE_F_LABEL)) {
// Store last word and label start point.
lastStart = i;
}
@@ -339,7 +367,7 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
}
s[k] = '\0';
// Handle the forall and where statement and structure.
if (strcmp(s, "forall") == 0 || strcmp(s, "where") == 0) {
if (strcmp(s, "forall") == 0 || (strcmp(s, "where") == 0 && strcmp(prevWord, "else") != 0)) {
if (strcmp(prevWord, "end") != 0) {
j = i + 1;
char chBrace = '(', chSeek = ')', ch1 = styler.SafeGetCharAt(j);
@@ -362,22 +390,25 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
if (depth == 0) break;
}
}
int tmpLineCurrent = lineCurrent;
while (j<endPos) {
j++;
chAtPos = styler.SafeGetCharAt(j);
styAtPos = styler.StyleAt(j);
if (styAtPos == SCE_F_COMMENT || IsABlank(chAtPos)) continue;
if (!IsALineEnd(chAtPos) && (styAtPos == SCE_F_COMMENT || IsABlank(chAtPos))) continue;
if (isFixFormat) {
if (!IsALineEnd(chAtPos)) {
break;
} else {
if (lineCurrent < styler.GetLine(styler.Length()-1)) {
j = styler.LineStart(lineCurrent+1);
if (styler.StyleAt(j+5) == SCE_F_CONTINUATION) {
if (tmpLineCurrent < styler.GetLine(styler.Length()-1)) {
tmpLineCurrent++;
j = styler.LineStart(tmpLineCurrent);
if (styler.StyleAt(j+5) == SCE_F_CONTINUATION
&& !IsABlank(styler.SafeGetCharAt(j+5)) && styler.SafeGetCharAt(j+5) != '0') {
j += 5;
continue;
} else {
levelCurrent++;
levelDeltaNext++;
break;
}
}
@@ -387,7 +418,7 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
j = GetContinuedPos(j+1, styler);
continue;
} else if (IsALineEnd(chAtPos)) {
levelCurrent ++;
levelDeltaNext++;
break;
} else {
break;
@@ -396,7 +427,32 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
}
}
} else {
levelCurrent += classifyFoldPointFortran(s, prevWord, chNextNonBlank);
levelDeltaNext += classifyFoldPointFortran(s, prevWord, chNextNonBlank);
if (((strcmp(s, "else") == 0) && (nextEOL || chNextNonBlank == '!')) ||
(strcmp(prevWord, "else") == 0 && strcmp(s, "where") == 0) || strcmp(s, "elsewhere") == 0) {
if (!isPrevLine) {
levelCurrent--;
}
levelDeltaNext++;
} else if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) {
if (!isPrevLine) {
levelCurrent--;
}
} else if ((strcmp(prevWord, "select") == 0 && strcmp(s, "case") == 0) || strcmp(s, "selectcase") == 0 ||
(strcmp(prevWord, "select") == 0 && strcmp(s, "type") == 0) || strcmp(s, "selecttype") == 0) {
levelDeltaNext += 2;
} else if ((strcmp(s, "case") == 0 && chNextNonBlank == '(') || (strcmp(prevWord, "case") == 0 && strcmp(s, "default") == 0) ||
(strcmp(prevWord, "type") == 0 && strcmp(s, "is") == 0) ||
(strcmp(prevWord, "class") == 0 && strcmp(s, "is") == 0) ||
(strcmp(prevWord, "class") == 0 && strcmp(s, "default") == 0) ) {
if (!isPrevLine) {
levelCurrent--;
}
levelDeltaNext++;
} else if ((strcmp(prevWord, "end") == 0 && strcmp(s, "select") == 0) || strcmp(s, "endselect") == 0) {
levelDeltaNext -= 2;
}
// Store the do Labels into array
if (strcmp(s, "do") == 0 && IsADigit(chNextNonBlank)) {
unsigned int k = 0;
@@ -431,26 +487,25 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
}
}
if (atEOL) {
int lev = levelPrev;
int lev = levelCurrent;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
if ((levelDeltaNext > 0) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent)) {
if (lev != styler.LevelAt(lineCurrent))
styler.SetLevel(lineCurrent, lev);
}
lineCurrent++;
levelPrev = levelCurrent;
levelCurrent += levelDeltaNext;
levelDeltaNext = 0;
visibleChars = 0;
strcpy(prevWord, "");
isPrevLine = false;
}
/***************************************/
if (!isspacechar(ch)) visibleChars++;
}
/***************************************/
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
/***************************************/
static const char * const FortranWordLists[] = {

View File

@@ -29,7 +29,7 @@ using namespace Scintilla;
#endif
static inline bool IsGAPOperator(char ch) {
if (isascii(ch) && isalnum(ch)) return false;
if (IsASCII(ch) && isalnum(ch)) return false;
if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
ch == '^' || ch == ',' || ch == '!' || ch == '.' ||
ch == '=' || ch == '<' || ch == '>' || ch == '(' ||

View File

@@ -6,8 +6,8 @@ This is the Lexer for Gui4Cli, included in SciLexer.dll
To add to SciLexer.dll:
1. Add the values below to INCLUDE\Scintilla.iface
2. Run the include/HFacer.py script
3. Run the src/lexGen.py script
2. Run the scripts/HFacer.py script
3. Run the scripts/LexGen.py script
val SCE_GC_DEFAULT=0
val SCE_GC_COMMENTLINE=1
@@ -49,10 +49,6 @@ static inline bool IsAWordChar(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch =='\\');
}
static inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
}
inline bool isGCOperator(int ch)
{ if (isalnum(ch))
return false;

View File

@@ -16,6 +16,7 @@
#include "Scintilla.h"
#include "SciLexer.h"
#include "StringCopy.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
@@ -43,7 +44,7 @@ static inline bool IsAWordStart(const int ch) {
}
inline bool IsOperator(int ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
@@ -297,7 +298,7 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
if (allowScripts && 0 == strcmp(s, "script")) {
// check to see if this is a self-closing tag by sniffing ahead
bool isSelfClose = false;
for (unsigned int cPos = end; cPos <= end + 100; cPos++) {
for (unsigned int cPos = end; cPos <= end + 200; cPos++) {
char ch = styler.SafeGetCharAt(cPos, '\0');
if (ch == '\0' || ch == '>')
break;
@@ -339,9 +340,9 @@ static void classifyWordHTJS(unsigned int start, unsigned int end,
static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) {
char chAttr = SCE_HB_IDENTIFIER;
bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.');
if (wordIsNumber)
if (wordIsNumber) {
chAttr = SCE_HB_NUMBER;
else {
} else {
char s[100];
GetTextSegment(styler, start, end, s, sizeof(s));
if (keywords.InList(s)) {
@@ -385,9 +386,9 @@ static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &key
static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
char chAttr = SCE_HPHP_DEFAULT;
bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.' && start+1 <= end && IsADigit(styler[start+1]));
if (wordIsNumber)
if (wordIsNumber) {
chAttr = SCE_HPHP_NUMBER;
else {
} else {
char s[100];
GetTextSegment(styler, start, end, s, sizeof(s));
if (keywords.InList(s))
@@ -445,18 +446,13 @@ static int StateForScript(script_type scriptLanguage) {
return Result;
}
static inline bool ishtmlwordchar(int ch) {
return !isascii(ch) ||
(isalnum(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':' || ch == '!' || ch == '#');
}
static inline bool issgmlwordchar(int ch) {
return !isascii(ch) ||
return !IsASCII(ch) ||
(isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '[');
}
static inline bool IsPhpWordStart(int ch) {
return (isascii(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f);
return (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f);
}
static inline bool IsPhpWordChar(int ch) {
@@ -484,10 +480,6 @@ static bool isLineEnd(int ch) {
return ch == '\r' || ch == '\n';
}
static bool isOKBeforeRE(int ch) {
return (ch == '(') || (ch == '=') || (ch == ',');
}
static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) {
if (strlen(blockType) == 0) {
return ((ch == '%') && (chNext == '>'));
@@ -691,6 +683,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true);
const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true);
const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true);
// TODO: also handle + and - (except if they're part of ++ or --) and return keywords
const CharacterSet setOKBeforeJSRE(CharacterSet::setNone, "([{=,:;!%^&*|?~");
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
@@ -905,7 +899,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
!IsScriptCommentState(state)) {
beforeLanguage = scriptLanguage;
scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP);
if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
if ((scriptLanguage != eScriptPHP) && (isStringState(state) || (state==SCE_H_COMMENT))) continue;
styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state;
i++;
@@ -936,9 +930,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
(ch == '$' && chNext == '{') ||
(ch == '<' && chNext == '/' && chNext2 == '%'))) {
if (ch == '%' || ch == '/')
strcpy(makoBlockType, "%");
StringCopy(makoBlockType, "%");
else if (ch == '$')
strcpy(makoBlockType, "{");
StringCopy(makoBlockType, "{");
else if (chNext == '/')
GetNextWord(styler, i+3, makoBlockType, sizeof(makoBlockType));
else
@@ -1007,9 +1001,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
// handle the start Django template code
else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' || chNext == '{'))) {
if (chNext == '%')
strcpy(djangoBlockType, "%");
StringCopy(djangoBlockType, "%");
else
strcpy(djangoBlockType, "{");
StringCopy(djangoBlockType, "{");
styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state;
if (inScriptType == eNonHtmlScript)
@@ -1240,7 +1234,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i - 2, StateToPrint);
}
state = SCE_H_SGML_COMMENT;
} else if (isascii(ch) && isalpha(ch) && (chPrev == '%')) {
} else if (IsASCII(ch) && isalpha(ch) && (chPrev == '%')) {
styler.ColourTo(i - 2, StateToPrint);
state = SCE_H_SGML_ENTITY;
} else if (ch == '#') {
@@ -1319,6 +1313,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i - 2, StateToPrint);
state = SCE_H_SGML_COMMENT;
}
break;
case SCE_H_SGML_DOUBLESTRING:
if (ch == '\"') {
styler.ColourTo(i, StateToPrint);
@@ -1358,7 +1353,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
break;
case SCE_H_SGML_SPECIAL:
if (!(isascii(ch) && isupper(ch))) {
if (!(IsASCII(ch) && isupper(ch))) {
styler.ColourTo(i - 1, StateToPrint);
if (isalnum(ch)) {
state = SCE_H_SGML_ERROR;
@@ -1371,7 +1366,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (ch == ';') {
styler.ColourTo(i, StateToPrint);
state = SCE_H_SGML_DEFAULT;
} else if (!(isascii(ch) && isalnum(ch)) && ch != '-' && ch != '.') {
} else if (!(IsASCII(ch) && isalnum(ch)) && ch != '-' && ch != '.') {
styler.ColourTo(i, SCE_H_SGML_ERROR);
state = SCE_H_SGML_DEFAULT;
}
@@ -1381,9 +1376,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i, StateToPrint);
state = SCE_H_DEFAULT;
}
if (ch != '#' && !(isascii(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway...
if (ch != '#' && !(IsASCII(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway...
&& ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML
if (!isascii(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style
if (!IsASCII(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style
styler.ColourTo(i-1, SCE_H_TAGUNKNOWN);
else
styler.ColourTo(i, SCE_H_TAGUNKNOWN);
@@ -1592,7 +1587,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
} else if (ch == '/' && chNext == '/') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_COMMENTLINE;
} else if (ch == '/' && isOKBeforeRE(chPrevNonWhite)) {
} else if (ch == '/' && setOKBeforeJSRE.Contains(chPrevNonWhite)) {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_REGEX;
} else if (ch == '\"') {
@@ -1709,7 +1704,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
case SCE_HJ_REGEX:
if (ch == '\r' || ch == '\n' || ch == '/') {
if (ch == '/') {
while (isascii(chNext) && islower(chNext)) { // gobble regex flags
while (IsASCII(chNext) && islower(chNext)) { // gobble regex flags
i++;
ch = chNext;
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
@@ -1923,7 +1918,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
state = SCE_HPHP_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_HPHP_HSTRING;
strcpy(phpStringDelimiter, "\"");
StringCopy(phpStringDelimiter, "\"");
} else if (styler.Match(i, "<<<")) {
bool isSimpleString = false;
i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString);
@@ -1933,7 +1928,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
} else if (ch == '\'') {
state = SCE_HPHP_SIMPLESTRING;
strcpy(phpStringDelimiter, "\'");
StringCopy(phpStringDelimiter, "\'");
} else if (ch == '$' && IsPhpWordStart(chNext)) {
state = SCE_HPHP_VARIABLE;
} else if (IsOperator(ch)) {
@@ -2053,7 +2048,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
state = SCE_HPHP_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_HPHP_HSTRING;
strcpy(phpStringDelimiter, "\"");
StringCopy(phpStringDelimiter, "\"");
} else if (styler.Match(i, "<<<")) {
bool isSimpleString = false;
i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString);
@@ -2063,7 +2058,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
} else if (ch == '\'') {
state = SCE_HPHP_SIMPLESTRING;
strcpy(phpStringDelimiter, "\'");
StringCopy(phpStringDelimiter, "\'");
} else if (ch == '$' && IsPhpWordStart(chNext)) {
state = SCE_HPHP_VARIABLE;
} else if (IsOperator(ch)) {

File diff suppressed because it is too large Load Diff

View File

@@ -104,7 +104,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
} else if (ch == '\'') {
// Start of a single-quote string
state = SCE_INNO_STRING_SINGLE;
} else if (isascii(ch) && (isalpha(ch) || (ch == '_'))) {
} else if (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) {
// Start of an identifier
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
@@ -123,7 +123,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
break;
case SCE_INNO_IDENTIFIER:
if (isascii(ch) && (isalnum(ch) || (ch == '_'))) {
if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_INNO_DEFAULT;
@@ -160,7 +160,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
} else {
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
} else if (isascii(ch) && (isalnum(ch) || (ch == '_'))) {
} else if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_INNO_DEFAULT;
@@ -170,7 +170,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
case SCE_INNO_PREPROC:
if (isWS || isEOL) {
if (isascii(chPrev) && isalpha(chPrev)) {
if (IsASCII(chPrev) && isalpha(chPrev)) {
state = SCE_INNO_DEFAULT;
buffer[bufferCount] = '\0';
@@ -185,7 +185,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
chNext = styler[i--];
ch = chPrev;
}
} else if (isascii(ch) && isalpha(ch)) {
} else if (IsASCII(ch) && isalpha(ch)) {
if (chPrev == '#' || chPrev == ' ' || chPrev == '\t')
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));

View File

@@ -0,0 +1,473 @@
// Scintilla source code edit control
/** @file LexKVIrc.cxx
** Lexer for KVIrc script.
**/
// Copyright 2013 by OmegaPhil <OmegaPhil+scintilla@gmail.com>, based in
// part from LexPython Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
// and LexCmake Copyright 2007 by Cristian Adam <cristian [dot] adam [at] gmx [dot] net>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
/* KVIrc Script syntactic rules: http://www.kvirc.net/doc/doc_syntactic_rules.html */
/* Utility functions */
static inline bool IsAWordChar(int ch) {
/* Keyword list includes modules, i.e. words including '.', and
* alias namespaces include ':' */
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'
|| ch == ':');
}
static inline bool IsAWordStart(int ch) {
/* Functions (start with '$') are treated separately to keywords */
return (ch < 0x80) && (isalnum(ch) || ch == '_' );
}
/* Interface function called by Scintilla to request some text to be
syntax highlighted */
static void ColouriseKVIrcDoc(unsigned int startPos, int length,
int initStyle, WordList *keywordlists[],
Accessor &styler)
{
/* Fetching style context */
StyleContext sc(startPos, length, initStyle, styler);
/* Accessing keywords and function-marking keywords */
WordList &keywords = *keywordlists[0];
WordList &functionKeywords = *keywordlists[1];
/* Looping for all characters - only automatically moving forward
* when asked for (transitions leaving strings and keywords do this
* already) */
bool next = true;
for( ; sc.More(); next ? sc.Forward() : (void)0 )
{
/* Resetting next */
next = true;
/* Dealing with different states */
switch (sc.state)
{
case SCE_KVIRC_DEFAULT:
/* Detecting single-line comments
* Unfortunately KVIrc script allows raw '#<channel
* name>' to be used, and appending # to an array returns
* its length...
* Going for a compromise where single line comments not
* starting on a newline are allowed in all cases except
* when they are preceeded with an opening bracket or comma
* (this will probably be the most common style a valid
* string-less channel name will be used with), with the
* array length case included
*/
if (
(sc.ch == '#' && sc.atLineStart) ||
(sc.ch == '#' && (
sc.chPrev != '(' && sc.chPrev != ',' &&
sc.chPrev != ']')
)
)
{
sc.SetState(SCE_KVIRC_COMMENT);
break;
}
/* Detecting multi-line comments */
if (sc.Match('/', '*'))
{
sc.SetState(SCE_KVIRC_COMMENTBLOCK);
break;
}
/* Detecting strings */
if (sc.ch == '"')
{
sc.SetState(SCE_KVIRC_STRING);
break;
}
/* Detecting functions */
if (sc.ch == '$')
{
sc.SetState(SCE_KVIRC_FUNCTION);
break;
}
/* Detecting variables */
if (sc.ch == '%')
{
sc.SetState(SCE_KVIRC_VARIABLE);
break;
}
/* Detecting numbers - isdigit is unsafe as it does not
* validate, use CharacterSet.h functions */
if (IsADigit(sc.ch))
{
sc.SetState(SCE_KVIRC_NUMBER);
break;
}
/* Detecting words */
if (IsAWordStart(sc.ch) && IsAWordChar(sc.chNext))
{
sc.SetState(SCE_KVIRC_WORD);
sc.Forward();
break;
}
/* Detecting operators */
if (isoperator(sc.ch))
{
sc.SetState(SCE_KVIRC_OPERATOR);
break;
}
break;
case SCE_KVIRC_COMMENT:
/* Breaking out of single line comment when a newline
* is introduced */
if (sc.ch == '\r' || sc.ch == '\n')
{
sc.SetState(SCE_KVIRC_DEFAULT);
break;
}
break;
case SCE_KVIRC_COMMENTBLOCK:
/* Detecting end of multi-line comment */
if (sc.Match('*', '/'))
{
// Moving the current position forward two characters
// so that '*/' is included in the comment
sc.Forward(2);
sc.SetState(SCE_KVIRC_DEFAULT);
/* Comment has been exited and the current position
* moved forward, yet the new current character
* has yet to be defined - loop without moving
* forward again */
next = false;
break;
}
break;
case SCE_KVIRC_STRING:
/* Detecting end of string - closing speechmarks */
if (sc.ch == '"')
{
/* Allowing escaped speechmarks to pass */
if (sc.chPrev == '\\')
break;
/* Moving the current position forward to capture the
* terminating speechmarks, and ending string */
sc.ForwardSetState(SCE_KVIRC_DEFAULT);
/* String has been exited and the current position
* moved forward, yet the new current character
* has yet to be defined - loop without moving
* forward again */
next = false;
break;
}
/* Functions and variables are now highlighted in strings
* Detecting functions */
if (sc.ch == '$')
{
/* Allowing escaped functions to pass */
if (sc.chPrev == '\\')
break;
sc.SetState(SCE_KVIRC_STRING_FUNCTION);
break;
}
/* Detecting variables */
if (sc.ch == '%')
{
/* Allowing escaped variables to pass */
if (sc.chPrev == '\\')
break;
sc.SetState(SCE_KVIRC_STRING_VARIABLE);
break;
}
/* Breaking out of a string when a newline is introduced */
if (sc.ch == '\r' || sc.ch == '\n')
{
/* Allowing escaped newlines */
if (sc.chPrev == '\\')
break;
sc.SetState(SCE_KVIRC_DEFAULT);
break;
}
break;
case SCE_KVIRC_FUNCTION:
case SCE_KVIRC_VARIABLE:
/* Detecting the end of a function/variable (word) */
if (!IsAWordChar(sc.ch))
{
sc.SetState(SCE_KVIRC_DEFAULT);
/* Word has been exited yet the current character
* has yet to be defined - loop without moving
* forward again */
next = false;
break;
}
break;
case SCE_KVIRC_STRING_FUNCTION:
case SCE_KVIRC_STRING_VARIABLE:
/* A function or variable in a string
* Detecting the end of a function/variable (word) */
if (!IsAWordChar(sc.ch))
{
sc.SetState(SCE_KVIRC_STRING);
/* Word has been exited yet the current character
* has yet to be defined - loop without moving
* forward again */
next = false;
break;
}
break;
case SCE_KVIRC_NUMBER:
/* Detecting the end of a number */
if (!IsADigit(sc.ch))
{
sc.SetState(SCE_KVIRC_DEFAULT);
/* Number has been exited yet the current character
* has yet to be defined - loop without moving
* forward */
next = false;
break;
}
break;
case SCE_KVIRC_OPERATOR:
/* Because '%' is an operator but is also the marker for
* a variable, I need to always treat operators as single
* character strings and therefore redo their detection
* after every character */
sc.SetState(SCE_KVIRC_DEFAULT);
/* Operator has been exited yet the current character
* has yet to be defined - loop without moving
* forward */
next = false;
break;
case SCE_KVIRC_WORD:
/* Detecting the end of a word */
if (!IsAWordChar(sc.ch))
{
/* Checking if the word was actually a keyword -
* fetching the current word, NULL-terminated like
* the keyword list */
char s[100];
int wordLen = sc.currentPos - styler.GetStartSegment();
if (wordLen > 99)
wordLen = 99; /* Include '\0' in buffer */
int i;
for( i = 0; i < wordLen; ++i )
{
s[i] = styler.SafeGetCharAt( styler.GetStartSegment() + i );
}
s[wordLen] = '\0';
/* Actually detecting keywords and fixing the state */
if (keywords.InList(s))
{
/* The SetState call actually commits the
* previous keyword state */
sc.ChangeState(SCE_KVIRC_KEYWORD);
}
else if (functionKeywords.InList(s))
{
// Detecting function keywords and fixing the state
sc.ChangeState(SCE_KVIRC_FUNCTION_KEYWORD);
}
/* Transitioning to default and committing the previous
* word state */
sc.SetState(SCE_KVIRC_DEFAULT);
/* Word has been exited yet the current character
* has yet to be defined - loop without moving
* forward again */
next = false;
break;
}
break;
}
}
/* Indicating processing is complete */
sc.Complete();
}
static void FoldKVIrcDoc(unsigned int startPos, int length, int /*initStyle - unused*/,
WordList *[], Accessor &styler)
{
/* Based on CMake's folder */
/* Exiting if folding isnt enabled */
if ( styler.GetPropertyInt("fold") == 0 )
return;
/* Obtaining current line number*/
int currentLine = styler.GetLine(startPos);
/* Obtaining starting character - indentation is done on a line basis,
* not character */
unsigned int safeStartPos = styler.LineStart( currentLine );
/* Initialising current level - this is defined as indentation level
* in the low 12 bits, with flag bits in the upper four bits.
* It looks like two indentation states are maintained in the returned
* 32bit value - 'nextLevel' in the most-significant bits, 'currentLevel'
* in the least-significant bits. Since the next level is the most
* up to date, this must refer to the current state of indentation.
* So the code bitshifts the old current level out of existence to
* get at the actual current state of indentation
* Based on the LexerCPP.cxx line 958 comment */
int currentLevel = SC_FOLDLEVELBASE;
if (currentLine > 0)
currentLevel = styler.LevelAt(currentLine - 1) >> 16;
int nextLevel = currentLevel;
// Looping for characters in range
for (unsigned int i = safeStartPos; i < startPos + length; ++i)
{
/* Folding occurs after syntax highlighting, meaning Scintilla
* already knows where the comments are
* Fetching the current state */
int state = styler.StyleAt(i) & 31;
switch( styler.SafeGetCharAt(i) )
{
case '{':
/* Indenting only when the braces are not contained in
* a comment */
if (state != SCE_KVIRC_COMMENT &&
state != SCE_KVIRC_COMMENTBLOCK)
++nextLevel;
break;
case '}':
/* Outdenting only when the braces are not contained in
* a comment */
if (state != SCE_KVIRC_COMMENT &&
state != SCE_KVIRC_COMMENTBLOCK)
--nextLevel;
break;
case '\n':
case '\r':
/* Preparing indentation information to return - combining
* current and next level data */
int lev = currentLevel | nextLevel << 16;
/* If the next level increases the indent level, mark the
* current line as a fold point - current level data is
* in the least significant bits */
if (nextLevel > currentLevel )
lev |= SC_FOLDLEVELHEADERFLAG;
/* Updating indentation level if needed */
if (lev != styler.LevelAt(currentLine))
styler.SetLevel(currentLine, lev);
/* Updating variables */
++currentLine;
currentLevel = nextLevel;
/* Dealing with problematic Windows newlines -
* incrementing to avoid the extra newline breaking the
* fold point */
if (styler.SafeGetCharAt(i) == '\r' &&
styler.SafeGetCharAt(i + 1) == '\n')
++i;
break;
}
}
/* At this point the data has ended, so presumably the end of the line?
* Preparing indentation information to return - combining current
* and next level data */
int lev = currentLevel | nextLevel << 16;
/* If the next level increases the indent level, mark the current
* line as a fold point - current level data is in the least
* significant bits */
if (nextLevel > currentLevel )
lev |= SC_FOLDLEVELHEADERFLAG;
/* Updating indentation level if needed */
if (lev != styler.LevelAt(currentLine))
styler.SetLevel(currentLine, lev);
}
/* Registering wordlists */
static const char *const kvircWordListDesc[] = {
"primary",
"function_keywords",
0
};
/* Registering functions and wordlists */
LexerModule lmKVIrc(SCLEX_KVIRC, ColouriseKVIrcDoc, "kvirc", FoldKVIrcDoc,
kvircWordListDesc);

View File

@@ -0,0 +1,539 @@
// Scintilla source code edit control
/** @file LexLaTeX.cxx
** Lexer for LaTeX2e.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
// Modified by G. HU in 2013. Added folding, syntax highting inside math environments, and changed some minor behaviors.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <vector>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "PropSetSimple.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
#include "LexerBase.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
using namespace std;
struct latexFoldSave {
latexFoldSave() : structLev(0) {
for (int i = 0; i < 8; ++i) openBegins[i] = 0;
}
latexFoldSave(const latexFoldSave &save) : structLev(save.structLev) {
for (int i = 0; i < 8; ++i) openBegins[i] = save.openBegins[i];
}
int openBegins[8];
int structLev;
};
class LexerLaTeX : public LexerBase {
private:
vector<int> modes;
void setMode(int line, int mode) {
if (line >= static_cast<int>(modes.size())) modes.resize(line + 1, 0);
modes[line] = mode;
}
int getMode(int line) {
if (line >= 0 && line < static_cast<int>(modes.size())) return modes[line];
return 0;
}
void truncModes(int numLines) {
if (static_cast<int>(modes.size()) > numLines * 2 + 256)
modes.resize(numLines + 128);
}
vector<latexFoldSave> saves;
void setSave(int line, const latexFoldSave &save) {
if (line >= static_cast<int>(saves.size())) saves.resize(line + 1);
saves[line] = save;
}
void getSave(int line, latexFoldSave &save) {
if (line >= 0 && line < static_cast<int>(saves.size())) save = saves[line];
else {
save.structLev = 0;
for (int i = 0; i < 8; ++i) save.openBegins[i] = 0;
}
}
void truncSaves(int numLines) {
if (static_cast<int>(saves.size()) > numLines * 2 + 256)
saves.resize(numLines + 128);
}
public:
static ILexer *LexerFactoryLaTeX() {
return new LexerLaTeX();
}
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
};
static bool latexIsSpecial(int ch) {
return (ch == '#') || (ch == '$') || (ch == '%') || (ch == '&') || (ch == '_') ||
(ch == '{') || (ch == '}') || (ch == ' ');
}
static bool latexIsBlank(int ch) {
return (ch == ' ') || (ch == '\t');
}
static bool latexIsBlankAndNL(int ch) {
return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n');
}
static bool latexIsLetter(int ch) {
return IsASCII(ch) && isalpha(ch);
}
static bool latexIsTagValid(int &i, int l, Accessor &styler) {
while (i < l) {
if (styler.SafeGetCharAt(i) == '{') {
while (i < l) {
i++;
if (styler.SafeGetCharAt(i) == '}') {
return true;
} else if (!latexIsLetter(styler.SafeGetCharAt(i)) &&
styler.SafeGetCharAt(i)!='*') {
return false;
}
}
} else if (!latexIsBlank(styler.SafeGetCharAt(i))) {
return false;
}
i++;
}
return false;
}
static bool latexNextNotBlankIs(int i, Accessor &styler, char needle) {
char ch;
while (i < styler.Length()) {
ch = styler.SafeGetCharAt(i);
if (!latexIsBlankAndNL(ch) && ch != '*') {
if (ch == needle)
return true;
else
return false;
}
i++;
}
return false;
}
static bool latexLastWordIs(int start, Accessor &styler, const char *needle) {
unsigned int i = 0;
unsigned int l = static_cast<unsigned int>(strlen(needle));
int ini = start-l+1;
char s[32];
while (i < l && i < 31) {
s[i] = styler.SafeGetCharAt(ini + i);
i++;
}
s[i] = '\0';
return (strcmp(s, needle) == 0);
}
static bool latexLastWordIsMathEnv(int pos, Accessor &styler) {
int i, j;
char s[32];
const char *mathEnvs[] = { "align", "alignat", "flalign", "gather",
"multiline", "displaymath", "eqnarray", "equation" };
if (styler.SafeGetCharAt(pos) != '}') return false;
for (i = pos - 1; i >= 0; --i) {
if (styler.SafeGetCharAt(i) == '{') break;
if (pos - i >= 20) return false;
}
if (i < 0 || i == pos - 1) return false;
++i;
for (j = 0; i + j < pos; ++j)
s[j] = styler.SafeGetCharAt(i + j);
s[j] = '\0';
if (j == 0) return false;
if (s[j - 1] == '*') s[--j] = '\0';
for (i = 0; i < static_cast<int>(sizeof(mathEnvs) / sizeof(const char *)); ++i)
if (strcmp(s, mathEnvs[i]) == 0) return true;
return false;
}
static inline void latexStateReset(int &mode, int &state) {
switch (mode) {
case 1: state = SCE_L_MATH; break;
case 2: state = SCE_L_MATH2; break;
default: state = SCE_L_DEFAULT; break;
}
}
// There are cases not handled correctly, like $abcd\textrm{what is $x+y$}z+w$.
// But I think it's already good enough.
void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
// startPos is assumed to be the first character of a line
Accessor styler(pAccess, &props);
styler.StartAt(startPos);
int mode = getMode(styler.GetLine(startPos) - 1);
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);
int lengthDoc = startPos + length;
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if (styler.IsLeadByte(ch)) {
i++;
chNext = styler.SafeGetCharAt(i + 1);
continue;
}
if (ch == '\r' || ch == '\n')
setMode(styler.GetLine(i), mode);
switch (state) {
case SCE_L_DEFAULT :
switch (ch) {
case '\\' :
styler.ColourTo(i - 1, state);
if (latexIsLetter(chNext)) {
state = SCE_L_COMMAND;
} else if (latexIsSpecial(chNext)) {
styler.ColourTo(i + 1, SCE_L_SPECIAL);
i++;
chNext = styler.SafeGetCharAt(i + 1);
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, SCE_L_ERROR);
} else if (IsASCII(chNext)) {
styler.ColourTo(i + 1, SCE_L_SHORTCMD);
if (chNext == '(') {
mode = 1;
state = SCE_L_MATH;
} else if (chNext == '[') {
mode = 2;
state = SCE_L_MATH2;
}
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
break;
case '$' :
styler.ColourTo(i - 1, state);
if (chNext == '$') {
styler.ColourTo(i + 1, SCE_L_SHORTCMD);
mode = 2;
state = SCE_L_MATH2;
i++;
chNext = styler.SafeGetCharAt(i + 1);
} else {
styler.ColourTo(i, SCE_L_SHORTCMD);
mode = 1;
state = SCE_L_MATH;
}
break;
case '%' :
styler.ColourTo(i - 1, state);
state = SCE_L_COMMENT;
break;
}
break;
// These 3 will never be reached.
case SCE_L_ERROR:
case SCE_L_SPECIAL:
case SCE_L_SHORTCMD:
break;
case SCE_L_COMMAND :
if (!latexIsLetter(chNext)) {
styler.ColourTo(i, state);
if (latexNextNotBlankIs(i + 1, styler, '[' )) {
state = SCE_L_CMDOPT;
} else if (latexLastWordIs(i, styler, "\\begin")) {
state = SCE_L_TAG;
} else if (latexLastWordIs(i, styler, "\\end")) {
state = SCE_L_TAG2;
} else if (latexLastWordIs(i, styler, "\\verb") && chNext != '*' && chNext != ' ') {
chVerbatimDelim = chNext;
state = SCE_L_VERBATIM;
} else {
latexStateReset(mode, state);
}
}
break;
case SCE_L_CMDOPT :
if (ch == ']') {
styler.ColourTo(i, state);
latexStateReset(mode, state);
}
break;
case SCE_L_TAG :
if (latexIsTagValid(i, lengthDoc, styler)) {
styler.ColourTo(i, state);
latexStateReset(mode, state);
if (latexLastWordIs(i, styler, "{verbatim}")) {
state = SCE_L_VERBATIM;
} else if (latexLastWordIs(i, styler, "{comment}")) {
state = SCE_L_COMMENT2;
} else if (latexLastWordIs(i, styler, "{math}") && mode == 0) {
mode = 1;
state = SCE_L_MATH;
} else if (latexLastWordIsMathEnv(i, styler) && mode == 0) {
mode = 2;
state = SCE_L_MATH2;
}
} else {
styler.ColourTo(i, SCE_L_ERROR);
latexStateReset(mode, state);
ch = styler.SafeGetCharAt(i);
if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode);
}
chNext = styler.SafeGetCharAt(i+1);
break;
case SCE_L_TAG2 :
if (latexIsTagValid(i, lengthDoc, styler)) {
styler.ColourTo(i, state);
latexStateReset(mode, state);
} else {
styler.ColourTo(i, SCE_L_ERROR);
latexStateReset(mode, state);
ch = styler.SafeGetCharAt(i);
if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode);
}
chNext = styler.SafeGetCharAt(i+1);
break;
case SCE_L_MATH :
switch (ch) {
case '\\' :
styler.ColourTo(i - 1, state);
if (latexIsLetter(chNext)) {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{math}"))
mode = 0;
}
}
state = SCE_L_COMMAND;
} else if (latexIsSpecial(chNext)) {
styler.ColourTo(i + 1, SCE_L_SPECIAL);
i++;
chNext = styler.SafeGetCharAt(i + 1);
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, SCE_L_ERROR);
} else if (IsASCII(chNext)) {
if (chNext == ')') {
mode = 0;
state = SCE_L_DEFAULT;
}
styler.ColourTo(i + 1, SCE_L_SHORTCMD);
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
break;
case '$' :
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_L_SHORTCMD);
mode = 0;
state = SCE_L_DEFAULT;
break;
case '%' :
styler.ColourTo(i - 1, state);
state = SCE_L_COMMENT;
break;
}
break;
case SCE_L_MATH2 :
switch (ch) {
case '\\' :
styler.ColourTo(i - 1, state);
if (latexIsLetter(chNext)) {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIsMathEnv(match, styler))
mode = 0;
}
}
state = SCE_L_COMMAND;
} else if (latexIsSpecial(chNext)) {
styler.ColourTo(i + 1, SCE_L_SPECIAL);
i++;
chNext = styler.SafeGetCharAt(i + 1);
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, SCE_L_ERROR);
} else if (IsASCII(chNext)) {
if (chNext == ']') {
mode = 0;
state = SCE_L_DEFAULT;
}
styler.ColourTo(i + 1, SCE_L_SHORTCMD);
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
break;
case '$' :
styler.ColourTo(i - 1, state);
if (chNext == '$') {
styler.ColourTo(i + 1, SCE_L_SHORTCMD);
i++;
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}
styler.ColourTo(i, SCE_L_SHORTCMD);
}
break;
case '%' :
styler.ColourTo(i - 1, state);
state = SCE_L_COMMENT;
break;
}
break;
case SCE_L_COMMENT :
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i - 1, state);
latexStateReset(mode, state);
}
break;
case SCE_L_COMMENT2 :
if (ch == '\\') {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{comment}")) {
styler.ColourTo(i - 1, state);
state = SCE_L_COMMAND;
}
}
}
}
break;
case SCE_L_VERBATIM :
if (ch == '\\') {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{verbatim}")) {
styler.ColourTo(i - 1, state);
state = SCE_L_COMMAND;
}
}
}
} else if (chNext == chVerbatimDelim) {
styler.ColourTo(i + 1, state);
latexStateReset(mode, state);
chVerbatimDelim = '\0';
i++;
chNext = styler.SafeGetCharAt(i + 1);
} else if (chVerbatimDelim != '\0' && (ch == '\n' || ch == '\r')) {
styler.ColourTo(i, SCE_L_ERROR);
latexStateReset(mode, state);
chVerbatimDelim = '\0';
}
break;
}
}
if (lengthDoc == styler.Length()) truncModes(styler.GetLine(lengthDoc - 1));
styler.ColourTo(lengthDoc - 1, state);
styler.Flush();
}
static int latexFoldSaveToInt(const latexFoldSave &save) {
int sum = 0;
for (int i = 0; i <= save.structLev; ++i)
sum += save.openBegins[i];
return ((sum + save.structLev + SC_FOLDLEVELBASE) & SC_FOLDLEVELNUMBERMASK);
}
// Change folding state while processing a line
// Return the level before the first relevant command
void SCI_METHOD LexerLaTeX::Fold(unsigned int startPos, int length, int, IDocument *pAccess) {
const char *structWords[7] = {"part", "chapter", "section", "subsection",
"subsubsection", "paragraph", "subparagraph"};
Accessor styler(pAccess, &props);
unsigned int endPos = startPos + length;
int curLine = styler.GetLine(startPos);
latexFoldSave save;
getSave(curLine - 1, save);
do {
char ch, buf[16];
int i, j, lev = -1;
bool needFold = false;
for (i = static_cast<int>(startPos); i < static_cast<int>(endPos); ++i) {
ch = styler.SafeGetCharAt(i);
if (ch == '\r' || ch == '\n') break;
if (ch != '\\' || styler.StyleAt(i) != SCE_L_COMMAND) continue;
for (j = 0; j < 15 && i + 1 < static_cast<int>(endPos); ++j, ++i) {
buf[j] = styler.SafeGetCharAt(i + 1);
if (!latexIsLetter(buf[j])) break;
}
buf[j] = '\0';
if (strcmp(buf, "begin") == 0) {
if (lev < 0) lev = latexFoldSaveToInt(save);
++save.openBegins[save.structLev];
needFold = true;
}
else if (strcmp(buf, "end") == 0) {
while (save.structLev > 0 && save.openBegins[save.structLev] == 0)
--save.structLev;
if (lev < 0) lev = latexFoldSaveToInt(save);
if (save.openBegins[save.structLev] > 0) --save.openBegins[save.structLev];
}
else {
for (j = 0; j < 7; ++j)
if (strcmp(buf, structWords[j]) == 0) break;
if (j >= 7) continue;
save.structLev = j; // level before the command
for (j = save.structLev + 1; j < 8; ++j) {
save.openBegins[save.structLev] += save.openBegins[j];
save.openBegins[j] = 0;
}
if (lev < 0) lev = latexFoldSaveToInt(save);
++save.structLev; // level after the command
needFold = true;
}
}
if (lev < 0) lev = latexFoldSaveToInt(save);
if (needFold) lev |= SC_FOLDLEVELHEADERFLAG;
styler.SetLevel(curLine, lev);
setSave(curLine, save);
++curLine;
startPos = styler.LineStart(curLine);
if (static_cast<int>(startPos) == styler.Length()) {
lev = latexFoldSaveToInt(save);
styler.SetLevel(curLine, lev);
setSave(curLine, save);
truncSaves(curLine);
}
} while (startPos < endPos);
styler.Flush();
}
static const char *const emptyWordListDesc[] = {
0
};
LexerModule lmLatex(SCLEX_LATEX, LexerLaTeX::LexerFactoryLaTeX, "latex", emptyWordListDesc);

View File

@@ -33,7 +33,7 @@ using namespace Scintilla;
#define SCE_LISP_MACRO_DISPATCH 31
static inline bool isLispoperator(char ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '{' || ch == '}')
return true;
@@ -41,7 +41,7 @@ static inline bool isLispoperator(char ch) {
}
static inline bool isLispwordstart(char ch) {
return isascii(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) &&
return IsASCII(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) &&
ch != '\n' && ch != '\r' && ch != '\"';
}
@@ -142,7 +142,7 @@ static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, W
}
}
} else if (state == SCE_LISP_MACRO_DISPATCH) {
if (!(isascii(ch) && isdigit(ch))) {
if (!(IsASCII(ch) && isdigit(ch))) {
if (ch != 'r' && ch != 'R' && (i - styler.GetStartSegment()) > 1) {
state = SCE_LISP_DEFAULT;
} else {

View File

@@ -151,7 +151,7 @@ static void FoldLoutDoc(unsigned int startPos, int length, int, WordList *[],
char chNext = styler[startPos];
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
char s[10];
char s[10] = "";
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;

View File

@@ -132,55 +132,38 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_OPERATOR) {
if (sc.ch == ':' && sc.chPrev == ':') { // :: <label> :: forward scan
sc.Forward();
int ln = 0, maxln = startPos + length - sc.currentPos;
int c;
while (ln < maxln) { // determine line extent
c = sc.GetRelative(ln);
if (c == '\r' || c == '\n')
break;
int ln = 0;
while (IsASpaceOrTab(sc.GetRelative(ln))) // skip over spaces/tabs
ln++;
}
maxln = ln; ln = 0;
while (ln < maxln) { // skip over spaces/tabs
if (!IsASpaceOrTab(sc.GetRelative(ln)))
break;
ln++;
}
int ws1 = ln;
if (setWordStart.Contains(sc.GetRelative(ln))) {
int i = 0;
int c, i = 0;
char s[100];
while (ln < maxln) { // get potential label
c = sc.GetRelative(ln);
if (!setWord.Contains(c))
break;
while (setWord.Contains(c = sc.GetRelative(ln))) { // get potential label
if (i < 90)
s[i++] = c;
ln++;
}
s[i] = '\0'; int lbl = ln;
if (!keywords.InList(s)) {
while (ln < maxln) { // skip over spaces/tabs
if (!IsASpaceOrTab(sc.GetRelative(ln)))
break;
while (IsASpaceOrTab(sc.GetRelative(ln))) // skip over spaces/tabs
ln++;
}
int ws2 = ln - lbl;
if (sc.GetRelative(ln) == ':' && sc.GetRelative(ln + 1) == ':') {
// final :: found, complete valid label construct
sc.ChangeState(SCE_LUA_LABEL);
if (ws1) {
sc.SetState(SCE_LUA_DEFAULT);
sc.Forward(ws1);
sc.ForwardBytes(ws1);
}
sc.SetState(SCE_LUA_LABEL);
sc.Forward(lbl - ws1);
sc.ForwardBytes(lbl - ws1);
if (ws2) {
sc.SetState(SCE_LUA_DEFAULT);
sc.Forward(ws2);
sc.ForwardBytes(ws2);
}
sc.SetState(SCE_LUA_LABEL);
sc.Forward(2);
sc.ForwardBytes(2);
}
}
}
@@ -374,7 +357,6 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
char chNext = styler[startPos];
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
char s[10];
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
@@ -384,6 +366,7 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (style == SCE_LUA_WORD) {
if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e' || ch == 'r' || ch == 'u') {
char s[10] = "";
for (unsigned int j = 0; j < 8; j++) {
if (!iswordchar(styler[i + j])) {
break;

View File

@@ -35,7 +35,7 @@ static inline bool IsAWordChar(const int ch) {
}
inline bool isMMIXALOperator(char ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
if (ch == '+' || ch == '-' || ch == '|' || ch == '^' ||
ch == '*' || ch == '/' ||

View File

@@ -37,7 +37,7 @@ static int GetLotLineState(std::string &line) {
// Now finds the first non-blank character
unsigned i; // Declares counter here to make it persistent after the for loop
for (i = 0; i < line.length(); ++i) {
if (!(isascii(line[i]) && isspace(line[i])))
if (!(IsASCII(line[i]) && isspace(line[i])))
break;
}

View File

@@ -35,19 +35,6 @@ using namespace Scintilla;
#define KW_MSSQL_STORED_PROCEDURES 5
#define KW_MSSQL_OPERATORS 6
static bool isMSSQLOperator(char ch) {
if (isascii(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
ch == '-' || ch == '+' || ch == '=' || ch == '|' ||
ch == '<' || ch == '>' || ch == '/' ||
ch == '!' || ch == '~' || ch == '(' || ch == ')' ||
ch == ',')
return true;
return false;
}
static char classifyWordSQL(unsigned int start,
unsigned int end,
WordList *keywordlists[],
@@ -220,7 +207,7 @@ static void ColouriseMSSQLDoc(unsigned int startPos, int length,
styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
prevState = state;
state = SCE_MSSQL_COLUMN_NAME_2;
} else if (isMSSQLOperator(ch)) {
} else if (isoperator(ch)) {
styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
styler.ColourTo(i, SCE_MSSQL_OPERATOR);
//~ style = SCE_MSSQL_DEFAULT;
@@ -300,7 +287,7 @@ static void FoldMSSQLDoc(unsigned int startPos, int length, int, WordList *[], A
int levelCurrent = levelPrev;
char chNext = styler[startPos];
bool inComment = (styler.StyleAt(startPos-1) == SCE_MSSQL_COMMENT);
char s[10];
char s[10] = "";
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);

View File

@@ -6,6 +6,12 @@
** Changes by Christoph Dalitz 2003/12/04:
** - added support for Octave
** - Strings can now be included both in single or double quotes
**
** Changes by John Donoghue 2012/04/02
** - added block comment (and nested block comments)
** - added ... displayed as a comment
** - removed unused IsAWord functions
** - added some comments
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@@ -48,29 +54,51 @@ static bool IsOctaveComment(Accessor &styler, int pos, int len) {
return len > 0 && IsOctaveCommentChar(styler[pos]) ;
}
static inline bool IsAWordChar(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_');
}
static inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_');
}
static void ColouriseMatlabOctaveDoc(
unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler,
bool (*IsCommentChar)(int)) {
bool (*IsCommentChar)(int),
bool ismatlab) {
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos);
// boolean for when the ' is allowed to be transpose vs the start/end
// of a string
bool transpose = false;
// approximate position of first non space character in a line
int nonSpaceColumn = -1;
// approximate column position of the current character in a line
int column = 0;
// use the line state of each line to store the block comment depth
int curLine = styler.GetLine(startPos);
int commentDepth = curLine > 0 ? styler.GetLineState(curLine-1) : 0;
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) {
for (; sc.More(); sc.Forward(), column++) {
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;
}
// save the column position of first non space character in a line
if((nonSpaceColumn == -1) && (! IsASpace(sc.ch)))
{
nonSpaceColumn = column;
}
// check for end of states
if (sc.state == SCE_MATLAB_OPERATOR) {
if (sc.chPrev == '.') {
if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') {
@@ -79,6 +107,10 @@ static void ColouriseMatlabOctaveDoc(
} else if (sc.ch == '\'') {
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
transpose = true;
} else if(sc.ch == '.' && sc.chNext == '.') {
// we werent an operator, but a '...'
sc.ChangeState(SCE_MATLAB_COMMENT);
transpose = false;
} else {
sc.SetState(SCE_MATLAB_DEFAULT);
}
@@ -121,18 +153,58 @@ static void ColouriseMatlabOctaveDoc(
} else if (sc.ch == '\"') {
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
}
} else if (sc.state == SCE_MATLAB_COMMENT || sc.state == SCE_MATLAB_COMMAND) {
} else if (sc.state == SCE_MATLAB_COMMAND) {
if (sc.atLineEnd) {
sc.SetState(SCE_MATLAB_DEFAULT);
transpose = false;
}
} 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 --;
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
sc.Forward();
if (commentDepth == 0) {
sc.ForwardSetState(SCE_D_DEFAULT);
transpose = false;
}
}
else if( IsCommentChar(sc.ch) && sc.chNext == '{' && nonSpaceColumn == column)
{
commentDepth ++;
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
sc.Forward();
transpose = false;
} else if(commentDepth == 0) {
// single line comment
if (sc.atLineEnd || sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_MATLAB_DEFAULT);
transpose = false;
}
}
}
// check start of a new state
if (sc.state == SCE_MATLAB_DEFAULT) {
if (IsCommentChar(sc.ch)) {
// ncrement depth if we are a block comment
if(sc.chNext == '{' && nonSpaceColumn == column)
commentDepth ++;
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
sc.SetState(SCE_MATLAB_COMMENT);
} else if (sc.ch == '!' && sc.chNext != '=' ) {
if(ismatlab) {
sc.SetState(SCE_MATLAB_COMMAND);
} else {
sc.SetState(SCE_MATLAB_OPERATOR);
}
} else if (sc.ch == '\'') {
if (transpose) {
sc.SetState(SCE_MATLAB_OPERATOR);
@@ -162,12 +234,12 @@ static void ColouriseMatlabOctaveDoc(
static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar);
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar, true);
}
static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar);
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar, false);
}
static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,

View File

@@ -34,7 +34,7 @@ using namespace Scintilla;
#ifdef DEBUG_LEX_MODULA
#define DEBUG_STATE( p, c )\
fprintf( stderr, "Unknown state: currentPos = %d, char = '%c'\n", p, c );
fprintf( stderr, "Unknown state: currentPos = %ud, char = '%c'\n", p, c );
#else
#define DEBUG_STATE( p, c )
#endif
@@ -63,16 +63,16 @@ static inline unsigned IsOperator( StyleContext & sc, WordList & op ) {
s[0] = sc.ch;
s[1] = sc.chNext;
s[2] = 0;
for( i = 0; i < op.len; i++ ) {
if( ( strlen( op.words[i] ) == 2 ) &&
( s[0] == op.words[i][0] && s[1] == op.words[i][1] ) ) {
for( i = 0; i < op.Length(); i++ ) {
if( ( strlen( op.WordAt(i) ) == 2 ) &&
( s[0] == op.WordAt(i)[0] && s[1] == op.WordAt(i)[1] ) ) {
return 2;
}
}
s[1] = 0;
for( i = 0; i < op.len; i++ ) {
if( ( strlen( op.words[i] ) == 1 ) &&
( s[0] == op.words[i][0] ) ) {
for( i = 0; i < op.Length(); i++ ) {
if( ( strlen( op.WordAt(i) ) == 1 ) &&
( s[0] == op.WordAt(i)[0] ) ) {
return 1;
}
}

View File

@@ -3,7 +3,7 @@
* @file LexMySQL.cxx
* Lexer for MySQL
*
* Improved by Mike Lischke <mike.lischke@sun.com>
* Improved by Mike Lischke <mike.lischke@oracle.com>
* Adopted from LexSQL.cxx by Anders Karlsson <anders@mysql.com>
* Original work by Neil Hodgson <neilh@scintilla.org>
* Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
@@ -40,13 +40,6 @@ static inline bool IsAWordStart(int ch) {
return (ch < 0x80) && (isalpha(ch) || ch == '_');
}
static inline bool IsADoxygenChar(int ch) {
return (islower(ch) || ch == '$' || ch == '@' ||
ch == '\\' || ch == '&' || ch == '<' ||
ch == '>' || ch == '#' || ch == '{' ||
ch == '}' || ch == '[' || ch == ']');
}
static inline bool IsANumberChar(int ch) {
// Not exactly following number definition (several dots are seen as OK, etc.)
// but probably enough in most cases.
@@ -60,74 +53,99 @@ static inline bool IsANumberChar(int ch) {
/**
* Check if the current content context represent a keyword and set the context state if so.
*/
static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[])
static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[], int activeState)
{
int length = sc.LengthCurrent() + 1; // +1 for the next char
char* s = new char[length];
sc.GetCurrentLowered(s, length);
if (keywordlists[0]->InList(s))
sc.ChangeState(SCE_MYSQL_MAJORKEYWORD);
sc.ChangeState(SCE_MYSQL_MAJORKEYWORD | activeState);
else
if (keywordlists[1]->InList(s))
sc.ChangeState(SCE_MYSQL_KEYWORD);
sc.ChangeState(SCE_MYSQL_KEYWORD | activeState);
else
if (keywordlists[2]->InList(s))
sc.ChangeState(SCE_MYSQL_DATABASEOBJECT);
sc.ChangeState(SCE_MYSQL_DATABASEOBJECT | activeState);
else
if (keywordlists[3]->InList(s))
sc.ChangeState(SCE_MYSQL_FUNCTION);
sc.ChangeState(SCE_MYSQL_FUNCTION | activeState);
else
if (keywordlists[5]->InList(s))
sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD);
sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD | activeState);
else
if (keywordlists[6]->InList(s))
sc.ChangeState(SCE_MYSQL_USER1);
sc.ChangeState(SCE_MYSQL_USER1 | activeState);
else
if (keywordlists[7]->InList(s))
sc.ChangeState(SCE_MYSQL_USER2);
sc.ChangeState(SCE_MYSQL_USER2 | activeState);
else
if (keywordlists[8]->InList(s))
sc.ChangeState(SCE_MYSQL_USER3);
sc.ChangeState(SCE_MYSQL_USER3 | activeState);
delete [] s;
}
//--------------------------------------------------------------------------------------------------
#define HIDDENCOMMAND_STATE 0x40 // Offset for states within a hidden command.
#define MASKACTIVE(style) (style & ~HIDDENCOMMAND_STATE)
static void SetDefaultState(StyleContext& sc, int activeState)
{
if (activeState == 0)
sc.SetState(SCE_MYSQL_DEFAULT);
else
sc.SetState(SCE_MYSQL_HIDDENCOMMAND);
}
static void ForwardDefaultState(StyleContext& sc, int activeState)
{
if (activeState == 0)
sc.ForwardSetState(SCE_MYSQL_DEFAULT);
else
sc.ForwardSetState(SCE_MYSQL_HIDDENCOMMAND);
}
static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler)
{
StyleContext sc(startPos, length, initStyle, styler);
StyleContext sc(startPos, length, initStyle, styler, 127);
int activeState = (initStyle == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : initStyle & HIDDENCOMMAND_STATE;
for (; sc.More(); sc.Forward())
{
// Determine if the current state should terminate.
switch (sc.state)
switch (MASKACTIVE(sc.state))
{
case SCE_MYSQL_OPERATOR:
sc.SetState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
break;
case SCE_MYSQL_NUMBER:
// We stop the number definition on non-numerical non-dot non-eE non-sign char.
if (!IsANumberChar(sc.ch))
sc.SetState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
break;
case SCE_MYSQL_IDENTIFIER:
// Switch from identifier to keyword state and open a new state for the new char.
if (!IsAWordChar(sc.ch))
{
CheckForKeyword(sc, keywordlists);
CheckForKeyword(sc, keywordlists, activeState);
// Additional check for function keywords needed.
// A function name must be followed by an opening parenthesis.
if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(')
if (MASKACTIVE(sc.state) == SCE_MYSQL_FUNCTION && sc.ch != '(')
{
if (activeState > 0)
sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND);
else
sc.ChangeState(SCE_MYSQL_DEFAULT);
}
sc.SetState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
}
break;
case SCE_MYSQL_VARIABLE:
if (!IsAWordChar(sc.ch))
sc.SetState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
break;
case SCE_MYSQL_SYSTEMVARIABLE:
if (!IsAWordChar(sc.ch))
@@ -138,10 +156,10 @@ static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle,
// Check for known system variables here.
if (keywordlists[4]->InList(&s[2]))
sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE);
sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE | activeState);
delete [] s;
sc.SetState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
}
break;
case SCE_MYSQL_QUOTEDIDENTIFIER:
@@ -150,20 +168,19 @@ static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle,
if (sc.chNext == '`')
sc.Forward(); // Ignore it
else
sc.ForwardSetState(SCE_MYSQL_DEFAULT);
ForwardDefaultState(sc, activeState);
}
break;
case SCE_MYSQL_COMMENT:
case SCE_MYSQL_HIDDENCOMMAND:
if (sc.Match('*', '/'))
{
sc.Forward();
sc.ForwardSetState(SCE_MYSQL_DEFAULT);
ForwardDefaultState(sc, activeState);
}
break;
case SCE_MYSQL_COMMENTLINE:
if (sc.atLineStart)
sc.SetState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
break;
case SCE_MYSQL_SQSTRING:
if (sc.ch == '\\')
@@ -175,7 +192,7 @@ static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle,
if (sc.chNext == '\'')
sc.Forward();
else
sc.ForwardSetState(SCE_MYSQL_DEFAULT);
ForwardDefaultState(sc, activeState);
}
break;
case SCE_MYSQL_DQSTRING:
@@ -188,76 +205,94 @@ static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle,
if (sc.chNext == '\"')
sc.Forward();
else
sc.ForwardSetState(SCE_MYSQL_DEFAULT);
ForwardDefaultState(sc, activeState);
}
break;
case SCE_MYSQL_PLACEHOLDER:
if (sc.Match('}', '>'))
{
sc.Forward();
ForwardDefaultState(sc, activeState);
}
break;
}
if (sc.state == SCE_MYSQL_HIDDENCOMMAND && sc.Match('*', '/'))
{
activeState = 0;
sc.Forward();
ForwardDefaultState(sc, activeState);
}
// Determine if a new state should be entered.
if (sc.state == SCE_MYSQL_DEFAULT)
if (sc.state == SCE_MYSQL_DEFAULT || sc.state == SCE_MYSQL_HIDDENCOMMAND)
{
switch (sc.ch)
{
case '@':
if (sc.chNext == '@')
{
sc.SetState(SCE_MYSQL_SYSTEMVARIABLE);
sc.SetState(SCE_MYSQL_SYSTEMVARIABLE | activeState);
sc.Forward(2); // Skip past @@.
}
else
if (IsAWordStart(sc.ch))
{
sc.SetState(SCE_MYSQL_VARIABLE);
sc.SetState(SCE_MYSQL_VARIABLE | activeState);
sc.Forward(); // Skip past @.
}
else
sc.SetState(SCE_MYSQL_OPERATOR);
sc.SetState(SCE_MYSQL_OPERATOR | activeState);
break;
case '`':
sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER);
sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER | activeState);
break;
case '#':
sc.SetState(SCE_MYSQL_COMMENTLINE);
sc.SetState(SCE_MYSQL_COMMENTLINE | activeState);
break;
case '\'':
sc.SetState(SCE_MYSQL_SQSTRING);
sc.SetState(SCE_MYSQL_SQSTRING | activeState);
break;
case '\"':
sc.SetState(SCE_MYSQL_DQSTRING);
sc.SetState(SCE_MYSQL_DQSTRING | activeState);
break;
default:
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)))
sc.SetState(SCE_MYSQL_NUMBER);
sc.SetState(SCE_MYSQL_NUMBER | activeState);
else
if (IsAWordStart(sc.ch))
sc.SetState(SCE_MYSQL_IDENTIFIER);
sc.SetState(SCE_MYSQL_IDENTIFIER | activeState);
else
if (sc.Match('/', '*'))
{
sc.SetState(SCE_MYSQL_COMMENT);
sc.SetState(SCE_MYSQL_COMMENT | activeState);
// Skip comment introducer and check for hidden command.
sc.Forward(2);
if (sc.ch == '!')
{
activeState = HIDDENCOMMAND_STATE;
sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND);
sc.Forward();
}
}
else if (sc.Match('<', '{'))
{
sc.SetState(SCE_MYSQL_PLACEHOLDER | activeState);
}
else
if (sc.Match("--"))
{
// Special MySQL single line comment.
sc.SetState(SCE_MYSQL_COMMENTLINE);
sc.SetState(SCE_MYSQL_COMMENTLINE | activeState);
sc.Forward(2);
// Check the third character too. It must be a space or EOL.
if (sc.ch != ' ' && sc.ch != '\n' && sc.ch != '\r')
sc.ChangeState(SCE_MYSQL_OPERATOR);
sc.ChangeState(SCE_MYSQL_OPERATOR | activeState);
}
else
if (isoperator(static_cast<char>(sc.ch)))
sc.SetState(SCE_MYSQL_OPERATOR);
sc.SetState(SCE_MYSQL_OPERATOR | activeState);
}
}
}
@@ -266,12 +301,12 @@ static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle,
// also at the end of a line.
if (sc.state == SCE_MYSQL_IDENTIFIER)
{
CheckForKeyword(sc, keywordlists);
CheckForKeyword(sc, keywordlists, activeState);
// Additional check for function keywords needed.
// A function name must be followed by an opening parenthesis.
if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(')
sc.ChangeState(SCE_MYSQL_DEFAULT);
SetDefaultState(sc, activeState);
}
sc.Complete();
@@ -284,7 +319,7 @@ static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle,
*/
static bool IsStreamCommentStyle(int style)
{
return style == SCE_MYSQL_COMMENT;
return MASKACTIVE(style) == SCE_MYSQL_COMMENT;
}
//--------------------------------------------------------------------------------------------------
@@ -323,6 +358,7 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordL
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
int activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE;
bool endPending = false;
bool whenPending = false;
@@ -332,30 +368,23 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordL
for (unsigned int i = startPos; length > 0; i++, length--)
{
int stylePrev = style;
int lastActiveState = activeState;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE;
char currentChar = nextChar;
nextChar = styler.SafeGetCharAt(i + 1);
bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n');
switch (style)
switch (MASKACTIVE(style))
{
case SCE_MYSQL_COMMENT:
if (foldComment)
{
// Multiline comment style /* .. */.
if (IsStreamCommentStyle(style))
{
// Increase level if we just start a foldable comment.
if (!IsStreamCommentStyle(stylePrev))
// Multiline comment style /* .. */ just started or is still in progress.
if (IsStreamCommentStyle(style) && !IsStreamCommentStyle(stylePrev))
levelNext++;
else
// If we are in the middle of a foldable comment check if it ends now.
// Don't end at the line end, though.
if (!IsStreamCommentStyle(styleNext) && !atEOL)
levelNext--;
}
}
break;
case SCE_MYSQL_COMMENTLINE:
@@ -377,6 +406,7 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordL
}
break;
case SCE_MYSQL_HIDDENCOMMAND:
/*
if (endPending)
{
// A conditional command is not a white space so it should end the current block
@@ -386,15 +416,9 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordL
if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE;
}
if (style != stylePrev)
}*/
if (activeState != lastActiveState)
levelNext++;
else
if (style != styleNext)
{
levelNext--;
if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE;
}
break;
case SCE_MYSQL_OPERATOR:
if (endPending)
@@ -480,7 +504,7 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordL
break;
default:
if (!isspace(currentChar) && endPending)
if (!isspacechar(currentChar) && endPending)
{
// END followed by a non-whitespace character (not covered by other cases like identifiers)
// also should end a folding block. Typical case: END followed by self defined delimiter.
@@ -491,6 +515,22 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordL
break;
}
// Go up one level if we just ended a multi line comment.
if (IsStreamCommentStyle(stylePrev) && !IsStreamCommentStyle(style))
{
levelNext--;
if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE;
}
if (activeState == 0 && lastActiveState != 0)
{
// Decrease fold level when we left a hidden command.
levelNext--;
if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE;
}
if (atEOL)
{
// Apply the new folding level to this line.
@@ -530,4 +570,4 @@ static const char * const mysqlWordListDesc[] = {
0
};
LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc);
LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc, 7);

View File

@@ -180,6 +180,8 @@ static int classifyWordNsis(unsigned int start, unsigned int end, WordList *keyw
bUserVars = true;
char s[100];
s[0] = '\0';
s[1] = '\0';
WordList &Functions = *keywordLists[0];
WordList &Variables = *keywordLists[1];

View File

@@ -295,7 +295,7 @@ inline bool HandleInteger( unsigned int & cur, unsigned int one_too_much, Access
}
ch = styler.SafeGetCharAt( cur );
if( !( isascii( ch ) && isdigit( ch ) ) )
if( !( IsASCII( ch ) && isdigit( ch ) ) )
{
styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
styler.StartSegment( cur );
@@ -314,7 +314,7 @@ inline bool HandleWord( unsigned int & cur, unsigned int one_too_much, Accessor
{
ch = styler.SafeGetCharAt( cur );
if( ( ch != '_' ) && ( ch != '-' ) &&
!( isascii( ch ) && ( islower( ch ) || isupper( ch ) || isdigit( ch ) ) ) ) break;
!( IsASCII( ch ) && ( islower( ch ) || isupper( ch ) || isdigit( ch ) ) ) ) break;
cur++;
if( cur >= one_too_much )
@@ -490,13 +490,13 @@ static void ColouriseOpalDoc( unsigned int startPos, int length, int initStyle,
default:
{
// Integer
if( isascii( ch ) && isdigit( ch ) )
if( IsASCII( ch ) && isdigit( ch ) )
{
if( !HandleInteger( cur, one_too_much, styler ) ) return;
}
// Keyword
else if( isascii( ch ) && ( islower( ch ) || isupper( ch ) ) )
else if( IsASCII( ch ) && ( islower( ch ) || isupper( ch ) ) )
{
if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;

View File

@@ -1,7 +1,6 @@
// Scintilla source code edit control
/** @file LexOthers.cxx
** Lexers for batch files, diff results, properties files, make files and error lists.
** Also lexer for LaTeX documents.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@@ -41,7 +40,7 @@ static bool Is1To9(char ch) {
}
static bool IsAlphabetic(int ch) {
return isascii(ch) && isalpha(ch);
return IsASCII(ch) && isalpha(ch);
}
static inline bool AtEOL(Accessor &styler, unsigned int i) {
@@ -560,7 +559,7 @@ static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
}
static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[DIFF_BUFFER_START_SIZE];
char lineBuffer[DIFF_BUFFER_START_SIZE] = "";
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
@@ -614,78 +613,6 @@ static void FoldDiffDoc(unsigned int startPos, int length, int, WordList *[], Ac
} while (static_cast<int>(startPos) + length > curLineStart);
}
static void ColourisePoLine(
char *lineBuffer,
unsigned int lengthLine,
unsigned int startLine,
unsigned int endPos,
Accessor &styler) {
unsigned int i = 0;
static unsigned int state = SCE_PO_DEFAULT;
unsigned int state_start = SCE_PO_DEFAULT;
while ((i < lengthLine) && isspacechar(lineBuffer[i])) // Skip initial spaces
i++;
if (i < lengthLine) {
if (lineBuffer[i] == '#') {
// check if the comment contains any flags ("#, ") and
// then whether the flags contain "fuzzy"
if (strstart(lineBuffer, "#, ") && strstr(lineBuffer, "fuzzy"))
styler.ColourTo(endPos, SCE_PO_FUZZY);
else
styler.ColourTo(endPos, SCE_PO_COMMENT);
} else {
if (lineBuffer[0] == '"') {
// line continuation, use previous style
styler.ColourTo(endPos, state);
return;
// this implicitly also matches "msgid_plural"
} else if (strstart(lineBuffer, "msgid")) {
state_start = SCE_PO_MSGID;
state = SCE_PO_MSGID_TEXT;
} else if (strstart(lineBuffer, "msgstr")) {
state_start = SCE_PO_MSGSTR;
state = SCE_PO_MSGSTR_TEXT;
} else if (strstart(lineBuffer, "msgctxt")) {
state_start = SCE_PO_MSGCTXT;
state = SCE_PO_MSGCTXT_TEXT;
}
if (state_start != SCE_PO_DEFAULT) {
// find the next space
while ((i < lengthLine) && ! isspacechar(lineBuffer[i]))
i++;
styler.ColourTo(startLine + i - 1, state_start);
styler.ColourTo(startLine + i, SCE_PO_DEFAULT);
styler.ColourTo(endPos, state);
}
}
} else {
styler.ColourTo(endPos, SCE_PO_DEFAULT);
}
}
static void ColourisePoDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[1024];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
unsigned int startLine = startPos;
for (unsigned int i = startPos; i < startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
// End of line (or of line buffer) met, colourise it
lineBuffer[linePos] = '\0';
ColourisePoLine(lineBuffer, linePos, startLine, i, styler);
linePos = 0;
startLine = i + 1;
}
}
if (linePos > 0) { // Last line does not have ending characters
ColourisePoLine(lineBuffer, linePos, startLine, startPos + length - 1, styler);
}
}
static inline bool isassignchar(unsigned char ch) {
return (ch == '=') || (ch == ':');
}
@@ -857,6 +784,7 @@ static void ColouriseMakeLine(
while ((i < lengthLine) && isspacechar(lineBuffer[i])) {
i++;
}
if (i < lengthLine) {
if (lineBuffer[i] == '#') { // Comment
styler.ColourTo(endPos, SCE_MAKE_COMMENT);
return;
@@ -865,9 +793,10 @@ static void ColouriseMakeLine(
styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
return;
}
}
int varCount = 0;
while (i < lengthLine) {
if (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(') {
if (((i + 1) < lengthLine) && (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(')) {
styler.ColourTo(startLine + i - 1, state);
state = SCE_MAKE_IDENTIFIER;
varCount++;
@@ -993,8 +922,9 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
(strstr(lineBuffer, " at ") < (lineBuffer + lengthLine)) &&
strstr(lineBuffer, " line ") &&
(strstr(lineBuffer, " line ") < (lineBuffer + lengthLine)) &&
(strstr(lineBuffer, " at ") < (strstr(lineBuffer, " line ")))) {
// perl error message
(strstr(lineBuffer, " at ") + 4 < (strstr(lineBuffer, " line ")))) {
// perl error message:
// <message> at <file> line <line>
return SCE_ERR_PERL;
} else if ((memcmp(lineBuffer, " at ", 6) == 0) &&
strstr(lineBuffer, ":line ")) {
@@ -1013,6 +943,10 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
strstr(lineBuffer, ".java:")) {
// Java stack back trace
return SCE_ERR_JAVA_STACK;
} else if (strstart(lineBuffer, "In file included from ") ||
strstart(lineBuffer, " from ")) {
// GCC showing include path to following error
return SCE_ERR_GCC_INCLUDED_FROM;
} else {
// Look for one of the following formats:
// GCC: <filename>:<line>:<message>
@@ -1020,15 +954,16 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
// Common: <filename>(<line>): warning|error|note|remark|catastrophic|fatal
// Common: <filename>(<line>) warning|error|note|remark|catastrophic|fatal
// Microsoft: <filename>(<line>,<column>)<message>
// CTags: \t<message>
// CTags: <identifier>\t<filename>\t<message>
// Lua 5 traceback: \t<filename>:<line>:<message>
// Lua 5.1: <exe>: <filename>:<line>:<message>
bool initialTab = (lineBuffer[0] == '\t');
bool initialColonPart = false;
bool canBeCtags = !initialTab; // For ctags must have an identifier with no spaces then a tab
enum { stInitial,
stGccStart, stGccDigit, stGccColumn, stGcc,
stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet,
stCtagsStart, stCtagsStartString, stCtagsStringDollar, stCtags,
stCtagsStart, stCtagsFile, stCtagsStartString, stCtagsStringDollar, stCtags,
stUnrecognized
} state = stInitial;
for (unsigned int i = 0; i < lengthLine; i++) {
@@ -1050,9 +985,11 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
// May be Microsoft
// Check against '0' often removes phone numbers
state = stMsStart;
} else if ((ch == '\t') && (!initialTab)) {
} else if ((ch == '\t') && canBeCtags) {
// May be CTags
state = stCtagsStart;
} else if (ch == ' ') {
canBeCtags = false;
}
} else if (state == stGccStart) { // <filename>:
state = Is1To9(ch) ? stGccDigit : stUnrecognized;
@@ -1100,8 +1037,9 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
!CompareCaseInsensitive(word, "fatal") || !CompareCaseInsensitive(word, "catastrophic") ||
!CompareCaseInsensitive(word, "note") || !CompareCaseInsensitive(word, "remark")) {
state = stMsVc;
} else
} else {
state = stUnrecognized;
}
} else {
state = stUnrecognized;
}
@@ -1113,11 +1051,15 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
state = stUnrecognized;
}
} else if (state == stCtagsStart) {
if (ch == '\t') {
state = stCtagsFile;
}
} else if (state == stCtagsFile) {
if ((lineBuffer[i - 1] == '\t') &&
((ch == '/' && lineBuffer[i + 1] == '^') || Is0To9(ch))) {
((ch == '/' && chNext == '^') || Is0To9(ch))) {
state = stCtags;
break;
} else if ((ch == '/') && (lineBuffer[i + 1] == '^')) {
} else if ((ch == '/') && (chNext == '^')) {
state = stCtagsStartString;
}
} else if ((state == stCtagsStartString) && ((lineBuffer[i] == '$') && (lineBuffer[i + 1] == '/'))) {
@@ -1179,301 +1121,6 @@ static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordLi
}
}
static bool latexIsSpecial(int ch) {
return (ch == '#') || (ch == '$') || (ch == '%') || (ch == '&') || (ch == '_') ||
(ch == '{') || (ch == '}') || (ch == ' ');
}
static bool latexIsBlank(int ch) {
return (ch == ' ') || (ch == '\t');
}
static bool latexIsBlankAndNL(int ch) {
return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n');
}
static bool latexIsLetter(int ch) {
return isascii(ch) && isalpha(ch);
}
static bool latexIsTagValid(int &i, int l, Accessor &styler) {
while (i < l) {
if (styler.SafeGetCharAt(i) == '{') {
while (i < l) {
i++;
if (styler.SafeGetCharAt(i) == '}') {
return true;
} else if (!latexIsLetter(styler.SafeGetCharAt(i)) &&
styler.SafeGetCharAt(i)!='*') {
return false;
}
}
} else if (!latexIsBlank(styler.SafeGetCharAt(i))) {
return false;
}
i++;
}
return false;
}
static bool latexNextNotBlankIs(int i, int l, Accessor &styler, char needle) {
char ch;
while (i < l) {
ch = styler.SafeGetCharAt(i);
if (!latexIsBlankAndNL(ch) && ch != '*') {
if (ch == needle)
return true;
else
return false;
}
i++;
}
return false;
}
static bool latexLastWordIs(int start, Accessor &styler, const char *needle) {
unsigned int i = 0;
unsigned int l = static_cast<unsigned int>(strlen(needle));
int ini = start-l+1;
char s[32];
while (i < l && i < 32) {
s[i] = styler.SafeGetCharAt(ini + i);
i++;
}
s[i] = '\0';
return (strcmp(s, needle) == 0);
}
static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle,
WordList *[], Accessor &styler) {
styler.StartAt(startPos);
int state = initStyle;
char chNext = styler.SafeGetCharAt(startPos);
styler.StartSegment(startPos);
int lengthDoc = startPos + length;
char chVerbatimDelim = '\0';
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if (styler.IsLeadByte(ch)) {
i++;
chNext = styler.SafeGetCharAt(i + 1);
continue;
}
switch (state) {
case SCE_L_DEFAULT :
switch (ch) {
case '\\' :
styler.ColourTo(i - 1, state);
if (latexIsSpecial(chNext)) {
state = SCE_L_SPECIAL;
} else {
if (latexIsLetter(chNext)) {
state = SCE_L_COMMAND;
} else {
if (chNext == '(' || chNext == '[') {
styler.ColourTo(i-1, state);
styler.ColourTo(i+1, SCE_L_SHORTCMD);
state = SCE_L_MATH;
if (chNext == '[')
state = SCE_L_MATH2;
i++;
chNext = styler.SafeGetCharAt(i+1);
} else {
state = SCE_L_SHORTCMD;
}
}
}
break;
case '$' :
styler.ColourTo(i - 1, state);
state = SCE_L_MATH;
if (chNext == '$') {
state = SCE_L_MATH2;
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
break;
case '%' :
styler.ColourTo(i - 1, state);
state = SCE_L_COMMENT;
break;
}
break;
case SCE_L_ERROR:
styler.ColourTo(i-1, state);
state = SCE_L_DEFAULT;
break;
case SCE_L_SPECIAL:
case SCE_L_SHORTCMD:
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
break;
case SCE_L_COMMAND :
if (!latexIsLetter(chNext)) {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
if (latexNextNotBlankIs(i+1, lengthDoc, styler, '[' )) {
state = SCE_L_CMDOPT;
} else if (latexLastWordIs(i, styler, "\\begin")) {
state = SCE_L_TAG;
} else if (latexLastWordIs(i, styler, "\\end")) {
state = SCE_L_TAG2;
} else if (latexLastWordIs(i, styler, "\\verb") &&
chNext != '*' && chNext != ' ') {
chVerbatimDelim = chNext;
state = SCE_L_VERBATIM;
}
}
break;
case SCE_L_CMDOPT :
if (ch == ']') {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
}
break;
case SCE_L_TAG :
if (latexIsTagValid(i, lengthDoc, styler)) {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
if (latexLastWordIs(i, styler, "{verbatim}")) {
state = SCE_L_VERBATIM;
} else if (latexLastWordIs(i, styler, "{comment}")) {
state = SCE_L_COMMENT2;
} else if (latexLastWordIs(i, styler, "{math}")) {
state = SCE_L_MATH;
} else if (latexLastWordIs(i, styler, "{displaymath}")) {
state = SCE_L_MATH2;
} else if (latexLastWordIs(i, styler, "{equation}")) {
state = SCE_L_MATH2;
}
} else {
state = SCE_L_ERROR;
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
}
chNext = styler.SafeGetCharAt(i+1);
break;
case SCE_L_TAG2 :
if (latexIsTagValid(i, lengthDoc, styler)) {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
} else {
state = SCE_L_ERROR;
}
chNext = styler.SafeGetCharAt(i+1);
break;
case SCE_L_MATH :
if (ch == '$') {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
} else if (ch == '\\' && chNext == ')') {
styler.ColourTo(i-1, state);
styler.ColourTo(i+1, SCE_L_SHORTCMD);
i++;
chNext = styler.SafeGetCharAt(i+1);
state = SCE_L_DEFAULT;
} else if (ch == '\\') {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{math}")) {
styler.ColourTo(i-1, state);
state = SCE_L_COMMAND;
}
}
}
}
break;
case SCE_L_MATH2 :
if (ch == '$') {
if (chNext == '$') {
i++;
chNext = styler.SafeGetCharAt(i + 1);
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
} else {
styler.ColourTo(i, SCE_L_ERROR);
state = SCE_L_DEFAULT;
}
} else if (ch == '\\' && chNext == ']') {
styler.ColourTo(i-1, state);
styler.ColourTo(i+1, SCE_L_SHORTCMD);
i++;
chNext = styler.SafeGetCharAt(i+1);
state = SCE_L_DEFAULT;
} else if (ch == '\\') {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{displaymath}")) {
styler.ColourTo(i-1, state);
state = SCE_L_COMMAND;
} else if (latexLastWordIs(match, styler, "{equation}")) {
styler.ColourTo(i-1, state);
state = SCE_L_COMMAND;
}
}
}
}
break;
case SCE_L_COMMENT :
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i - 1, state);
state = SCE_L_DEFAULT;
}
break;
case SCE_L_COMMENT2 :
if (ch == '\\') {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{comment}")) {
styler.ColourTo(i-1, state);
state = SCE_L_COMMAND;
}
}
}
}
break;
case SCE_L_VERBATIM :
if (ch == '\\') {
int match = i + 3;
if (latexLastWordIs(match, styler, "\\end")) {
match++;
if (latexIsTagValid(match, lengthDoc, styler)) {
if (latexLastWordIs(match, styler, "{verbatim}")) {
styler.ColourTo(i-1, state);
state = SCE_L_COMMAND;
}
}
}
} else if (chNext == chVerbatimDelim) {
styler.ColourTo(i+1, state);
state = SCE_L_DEFAULT;
chVerbatimDelim = '\0';
} else if (chVerbatimDelim != '\0' && (ch == '\n' || ch == '\r')) {
styler.ColourTo(i, SCE_L_ERROR);
state = SCE_L_DEFAULT;
chVerbatimDelim = '\0';
}
break;
}
}
styler.ColourTo(lengthDoc-1, state);
}
static const char *const batchWordListDesc[] = {
"Internal Commands",
"External Commands",
@@ -1496,9 +1143,7 @@ static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[
LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", FoldDiffDoc, emptyWordListDesc);
LexerModule lmPo(SCLEX_PO, ColourisePoDoc, "po", 0, emptyWordListDesc);
LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", FoldPropsDoc, emptyWordListDesc);
LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc);
LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");

View File

@@ -0,0 +1,213 @@
// Scintilla source code edit control
/** @file LexPO.cxx
** Lexer for GetText Translation (PO) files.
**/
// Copyright 2012 by Colomban Wendling <ban@herbesfolles.org>
// The License.txt file describes the conditions under which this software may be distributed.
// see https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files for the syntax reference
// some details are taken from the GNU msgfmt behavior (like that indent is allows in front of lines)
// TODO:
// * add keywords for flags (fuzzy, c-format, ...)
// * highlight formats inside c-format strings (%s, %d, etc.)
// * style for previous untranslated string? ("#|" comment)
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
static void ColourisePODoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) {
StyleContext sc(startPos, length, initStyle, styler);
bool escaped = false;
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) {
case SCE_PO_COMMENT:
case SCE_PO_PROGRAMMER_COMMENT:
case SCE_PO_REFERENCE:
case SCE_PO_FLAGS:
case SCE_PO_FUZZY:
if (sc.atLineEnd)
sc.SetState(SCE_PO_DEFAULT);
else if (sc.state == SCE_PO_FLAGS && sc.Match("fuzzy"))
// here we behave like the previous parser, but this should probably be highlighted
// 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:
if (sc.atLineEnd) { // invalid inside a string
if (sc.state == SCE_PO_MSGCTXT_TEXT)
sc.ChangeState(SCE_PO_MSGCTXT_TEXT_EOL);
else if (sc.state == SCE_PO_MSGID_TEXT)
sc.ChangeState(SCE_PO_MSGID_TEXT_EOL);
else if (sc.state == SCE_PO_MSGSTR_TEXT)
sc.ChangeState(SCE_PO_MSGSTR_TEXT_EOL);
sc.SetState(SCE_PO_DEFAULT);
escaped = false;
} else {
if (escaped)
escaped = false;
else if (sc.ch == '\\')
escaped = true;
else if (sc.ch == '"')
sc.ForwardSetState(SCE_PO_DEFAULT);
}
break;
}
// whether we should enter a new state
if (sc.state == SCE_PO_DEFAULT) {
// forward to the first non-white character on the line
bool atLineStart = sc.atLineStart;
if (atLineStart) {
// reset line state if it is set to comment state so empty lines don't get
// comment line state, and the folding code folds comments separately,
// 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);
else if (sc.chNext == ':')
sc.SetState(SCE_PO_REFERENCE);
else if (sc.chNext == ',')
sc.SetState(SCE_PO_FLAGS);
else
sc.SetState(SCE_PO_COMMENT);
} else if (atLineStart && sc.Match("msgid")) { // includes msgid_plural
sc.SetState(SCE_PO_MSGID);
} else if (atLineStart && sc.Match("msgstr")) { // includes [] suffixes
sc.SetState(SCE_PO_MSGSTR);
} else if (atLineStart && sc.Match("msgctxt")) {
sc.SetState(SCE_PO_MSGCTXT);
} else if (sc.ch == '"') {
if (curLineState == SCE_PO_MSGCTXT || curLineState == SCE_PO_MSGCTXT_TEXT)
sc.SetState(SCE_PO_MSGCTXT_TEXT);
else if (curLineState == SCE_PO_MSGID || curLineState == SCE_PO_MSGID_TEXT)
sc.SetState(SCE_PO_MSGID_TEXT);
else if (curLineState == SCE_PO_MSGSTR || curLineState == SCE_PO_MSGSTR_TEXT)
sc.SetState(SCE_PO_MSGSTR_TEXT);
else
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);
styler.SetLineState(curLine, curLineState);
}
}
sc.Complete();
}
static int FindNextNonEmptyLineState(unsigned int startPos, Accessor &styler) {
unsigned int length = styler.Length();
for (unsigned int i = startPos; i < length; i++) {
if (! isspacechar(styler[i])) {
return styler.GetLineState(styler.GetLine(i));
}
}
return 0;
}
static void FoldPODoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
if (! styler.GetPropertyInt("fold"))
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);
int nextLineState;
int level = styler.LevelAt(curLine) & SC_FOLDLEVELNUMBERMASK;
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 &&
FindNextNonEmptyLineState(i, styler) == lineState)
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;
visible = 0;
}
}
}
static const char *const poWordListDesc[] = {
0
};
LexerModule lmPO(SCLEX_PO, ColourisePODoc, "po", FoldPODoc, poWordListDesc);

View File

@@ -12,7 +12,7 @@
A few words about features of the new completely rewritten LexPascal...
Generally speaking LexPascal tries to support all available Delphi features (up
to Delphi 2009 at this time), including .NET specific features.
to Delphi XE4 at this time).
~ HIGHLIGHTING:
@@ -89,17 +89,18 @@ would be folded.
~ KEYWORDS:
The list of keywords that can be used in pascal.properties file (up to Delphi
2009):
XE4):
- Keywords: absolute abstract and array as asm assembler automated begin case
cdecl class const constructor deprecated destructor dispid dispinterface div do
downto dynamic else end except export exports external far file final
finalization finally for forward function goto if implementation in inherited
initialization inline interface is label library message mod near nil not object
of on or out overload override packed pascal platform private procedure program
property protected public published raise record register reintroduce repeat
resourcestring safecall sealed set shl shr static stdcall strict string then
threadvar to try type unit unsafe until uses var varargs virtual while with xor
cdecl class const constructor delayed deprecated destructor dispid dispinterface
div do downto dynamic else end except experimental export exports external far
file final finalization finally for forward function goto helper if
implementation in inherited initialization inline interface is label library
message mod near nil not object of on operator or out overload override packed
pascal platform private procedure program property protected public published
raise record reference register reintroduce repeat resourcestring safecall
sealed set shl shr static stdcall strict string then threadvar to try type unit
unsafe until uses var varargs virtual while winapi with xor
- Keywords related to the "smart highlithing" feature: add default implements
index name nodefault read readonly remove stored write writeonly

View File

@@ -188,28 +188,12 @@ static int styleCheckIdentifier(LexAccessor &styler, unsigned int bk) {
return 0;
}
static int inputsymbolScan(LexAccessor &styler, unsigned int pos, unsigned int endPos) {
// looks forward for matching > on same line; a bit ugly
unsigned int fw = pos;
while (++fw < endPos) {
int fwch = static_cast<unsigned char>(styler.SafeGetCharAt(fw));
if (fwch == '\r' || fwch == '\n') {
return 0;
} else if (fwch == '>') {
if (styler.Match(fw - 2, "<=>")) // '<=>' case
return 0;
return fw - pos;
}
}
return 0;
}
static int podLineScan(LexAccessor &styler, unsigned int &pos, unsigned int endPos) {
// forward scan the current line to classify line for POD style
int state = -1;
while (pos <= endPos) {
while (pos < endPos) {
int ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos));
if (ch == '\n' || ch == '\r' || pos >= endPos) {
if (ch == '\n' || ch == '\r') {
if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++;
break;
}
@@ -398,6 +382,7 @@ public:
static ILexer *LexerFactoryPerl() {
return new LexerPerl();
}
int InputSymbolScan(StyleContext &sc);
void InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern=false);
};
@@ -427,6 +412,21 @@ int SCI_METHOD LexerPerl::WordListSet(int n, const char *wl) {
return firstModification;
}
int LexerPerl::InputSymbolScan(StyleContext &sc) {
// forward scan for matching > on same line; file handles
int c, sLen = 0;
while ((c = sc.GetRelativeCharacter(++sLen)) != 0) {
if (c == '\r' || c == '\n') {
return 0;
} else if (c == '>') {
if (sc.Match("<=>")) // '<=>' case
return 0;
return sLen;
}
}
return 0;
}
void LexerPerl::InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern) {
// interpolate a segment (with no active backslashes or delimiters within)
// switch in or out of an interpolation style or continue current style
@@ -441,39 +441,42 @@ void LexerPerl::InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern)
if (sc.ch == '$' && sc.chNext == '#') { // starts with $#
sLen++;
}
while ((maxSeg > sLen) && (sc.GetRelative(sLen) == '$')) // >0 $ dereference within
while ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '$')) // >0 $ dereference within
sLen++;
if ((maxSeg > sLen) && (sc.GetRelative(sLen) == '{')) { // { start for {word}
if ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '{')) { // { start for {word}
sLen++;
braces = true;
}
if (maxSeg > sLen) {
int c = sc.GetRelative(sLen);
int c = sc.GetRelativeCharacter(sLen);
if (setWordStart.Contains(c)) { // word (various)
sLen++;
isVar = true;
while ((maxSeg > sLen) && setWord.Contains(sc.GetRelative(sLen)))
while (maxSeg > sLen) {
if (!setWord.Contains(sc.GetRelativeCharacter(sLen)))
break;
sLen++;
}
} else if (braces && IsADigit(c) && (sLen == 2)) { // digit for ${digit}
sLen++;
isVar = true;
}
}
if (braces) {
if ((maxSeg > sLen) && (sc.GetRelative(sLen) == '}')) { // } end for {word}
if ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '}')) { // } end for {word}
sLen++;
} else
isVar = false;
}
}
if (!isVar && (maxSeg > 1)) { // $- or @-specific variable patterns
sLen = 1;
int c = sc.chNext;
if (sc.ch == '$') {
sLen = 1;
if (IsADigit(c)) { // $[0-9] and slurp trailing digits
sLen++;
isVar = true;
while ((maxSeg > sLen) && IsADigit(sc.GetRelative(sLen)))
while ((maxSeg > sLen) && IsADigit(sc.GetRelativeCharacter(sLen)))
sLen++;
} else if (setSpecialVar.Contains(c)) { // $ special variables
sLen++;
@@ -483,12 +486,13 @@ void LexerPerl::InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern)
isVar = true;
} else if (c == '^') { // $^A control-char style
sLen++;
if ((maxSeg > sLen) && setControlVar.Contains(sc.GetRelative(sLen))) {
if ((maxSeg > sLen) && setControlVar.Contains(sc.GetRelativeCharacter(sLen))) {
sLen++;
isVar = true;
}
}
} else if (sc.ch == '@') {
sLen = 1;
if (!isPattern && ((c == '+') || (c == '-'))) { // @ specials non-pattern
sLen++;
isVar = true;
@@ -576,7 +580,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
int Count;
int Up, Down;
QuoteCls() {
this->New(1);
New(1);
}
void New(int r = 1) {
Rep = r;
@@ -857,10 +861,14 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
sc.Forward();
}
if (sc.ch != '\r') { // skip CR if CRLF
HereDoc.Append(sc.ch);
int i = 0; // else append char, possibly an extended char
while (i < sc.width) {
HereDoc.Append(static_cast<unsigned char>(styler.SafeGetCharAt(sc.currentPos + i)));
i++;
}
}
} else { // an unquoted here-doc delimiter
}
} else { // an unquoted here-doc delimiter, no extended charsets
if (setHereDocDelim.Contains(sc.ch)) {
HereDoc.Append(sc.ch);
} else {
@@ -881,7 +889,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (HereDoc.DelimiterLength == 0 || sc.Match(HereDoc.Delimiter)) {
int c = sc.GetRelative(HereDoc.DelimiterLength);
if (c == '\r' || c == '\n') { // peek first, do not consume match
sc.Forward(HereDoc.DelimiterLength);
sc.ForwardBytes(HereDoc.DelimiterLength);
sc.SetState(SCE_PL_DEFAULT);
backFlag = BACK_NONE;
HereDoc.State = 0;
@@ -896,19 +904,18 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
break;
}
while (!sc.atLineEnd) { // "EOF" and `EOF` interpolated
int s = 0, endType = 0;
int maxSeg = endPos - sc.currentPos;
while (s < maxSeg) { // scan to break string into segments
int c = sc.GetRelative(s);
int c, sLen = 0, endType = 0;
while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
// scan to break string into segments
if (c == '\\') {
endType = 1; break;
} else if (c == '\r' || c == '\n') {
endType = 2; break;
}
s++;
sLen++;
}
if (s > 0) // process non-empty segments
InterpolateSegment(sc, s);
if (sLen > 0) // process non-empty segments
InterpolateSegment(sc, sLen);
if (endType == 1) {
sc.Forward();
// \ at end-of-line does not appear to have any effect, skip
@@ -936,7 +943,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (pod == SCE_PL_DEFAULT) {
if (sc.state == SCE_PL_POD_VERB) {
unsigned int fw2 = fw;
while (fw2 <= endPos && pod == SCE_PL_DEFAULT) {
while (fw2 < (endPos - 1) && pod == SCE_PL_DEFAULT) {
fw = fw2++; // penultimate line (last blank line)
pod = podLineScan(styler, fw2, endPos);
styler.SetLineState(styler.GetLine(fw2), pod);
@@ -958,7 +965,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
}
sc.SetState(pod);
}
sc.Forward(fw - sc.currentPos); // commit style
sc.ForwardBytes(fw - sc.currentPos); // commit style
}
break;
case SCE_PL_REGEX:
@@ -969,10 +976,9 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
} else if (!Quote.Up && !IsASpace(sc.ch)) {
Quote.Open(sc.ch);
} else {
int s = 0, endType = 0;
int maxSeg = endPos - sc.currentPos;
while (s < maxSeg) { // scan to break string into segments
int c = sc.GetRelative(s);
int c, sLen = 0, endType = 0;
while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
// scan to break string into segments
if (IsASpace(c)) {
break;
} else if (c == '\\' && Quote.Up != '\\') {
@@ -985,13 +991,13 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
}
} else if (c == Quote.Up)
Quote.Count++;
s++;
sLen++;
}
if (s > 0) { // process non-empty segments
if (sLen > 0) { // process non-empty segments
if (Quote.Up != '\'') {
InterpolateSegment(sc, s, true);
InterpolateSegment(sc, sLen, true);
} else // non-interpolated path
sc.Forward(s);
sc.Forward(sLen);
}
if (endType == 1)
sc.Forward();
@@ -1005,11 +1011,10 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
} else if (!Quote.Up && !IsASpace(sc.ch)) {
Quote.Open(sc.ch);
} else {
int s = 0, endType = 0;
int maxSeg = endPos - sc.currentPos;
int c, sLen = 0, endType = 0;
bool isPattern = (Quote.Rep == 2);
while (s < maxSeg) { // scan to break string into segments
int c = sc.GetRelative(s);
while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
// scan to break string into segments
if (c == '\\' && Quote.Up != '\\') {
endType = 2; break;
} else if (Quote.Count == 0 && Quote.Rep == 1) {
@@ -1020,7 +1025,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
// For '#', if no whitespace in between, it's a delimiter.
if (IsASpace(c)) {
// Keep going
} else if (c == '#' && IsASpaceOrTab(sc.GetRelative(s - 1))) {
} else if (c == '#' && IsASpaceOrTab(sc.GetRelativeCharacter(sLen - 1))) {
endType = 3;
} else
Quote.Open(c);
@@ -1039,13 +1044,13 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
Quote.Count++;
} else if (IsASpace(c))
break;
s++;
sLen++;
}
if (s > 0) { // process non-empty segments
if (sLen > 0) { // process non-empty segments
if (sc.state == SCE_PL_REGSUBST && Quote.Up != '\'') {
InterpolateSegment(sc, s, isPattern);
InterpolateSegment(sc, sLen, isPattern);
} else // non-interpolated path
sc.Forward(s);
sc.Forward(sLen);
}
if (endType == 2) {
sc.Forward();
@@ -1063,10 +1068,9 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (!Quote.Down && !IsASpace(sc.ch)) {
Quote.Open(sc.ch);
} else {
int s = 0, endType = 0;
int maxSeg = endPos - sc.currentPos;
while (s < maxSeg) { // scan to break string into segments
int c = sc.GetRelative(s);
int c, sLen = 0, endType = 0;
while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
// scan to break string into segments
if (IsASpace(c)) {
break;
} else if (c == '\\' && Quote.Up != '\\') {
@@ -1078,23 +1082,23 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
}
} else if (c == Quote.Up)
Quote.Count++;
s++;
sLen++;
}
if (s > 0) { // process non-empty segments
if (sLen > 0) { // process non-empty segments
switch (sc.state) {
case SCE_PL_STRING:
case SCE_PL_STRING_QQ:
case SCE_PL_BACKTICKS:
InterpolateSegment(sc, s);
InterpolateSegment(sc, sLen);
break;
case SCE_PL_STRING_QX:
if (Quote.Up != '\'') {
InterpolateSegment(sc, s);
InterpolateSegment(sc, sLen);
break;
}
// (continued for ' delim)
default: // non-interpolated path
sc.Forward(s);
sc.Forward(sLen);
}
}
if (endType == 2) {
@@ -1109,7 +1113,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
while (setSubPrototype.Contains(sc.GetRelative(i)))
i++;
if (sc.GetRelative(i) == ')') { // valid sub prototype
sc.Forward(i);
sc.ForwardBytes(i);
sc.ForwardSetState(SCE_PL_DEFAULT);
} else {
// abandon prototype, restart from '('
@@ -1322,7 +1326,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (setArray.Contains(sc.chNext)) {
// no special treatment
} else if (sc.chNext == ':' && sc.GetRelative(2) == ':') {
sc.Forward(2);
sc.ForwardBytes(2);
} else if (sc.chNext == '{' || sc.chNext == '[') {
sc.ForwardSetState(SCE_PL_OPERATOR);
} else {
@@ -1445,7 +1449,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (preferRE) {
sc.SetState(SCE_PL_SYMBOLTABLE);
if (sc.chNext == ':' && sc.GetRelative(2) == ':') {
sc.Forward(2);
sc.ForwardBytes(2);
} else if (sc.chNext == '{') {
sc.ForwardSetState(SCE_PL_OPERATOR);
} else {
@@ -1462,7 +1466,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (setHash.Contains(sc.chNext)) {
sc.Forward();
} else if (sc.chNext == ':' && sc.GetRelative(2) == ':') {
sc.Forward(2);
sc.ForwardBytes(2);
} else if (sc.chNext == '{') {
sc.ForwardSetState(SCE_PL_OPERATOR);
} else {
@@ -1474,7 +1478,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
} else if (sc.ch == '<') { // handle '<', inputsymbol
if (preferRE) {
// forward scan
int i = inputsymbolScan(styler, sc.currentPos, endPos);
int i = InputSymbolScan(sc);
if (i > 0) {
sc.SetState(SCE_PL_IDENTIFIER);
sc.Forward(i);
@@ -1626,7 +1630,7 @@ void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initSt
else if (styler.Match(i, "=head"))
podHeading = PodHeadingLevel(i, styler);
} else if (style == SCE_PL_DATASECTION) {
if (ch == '=' && isascii(chNext) && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE)
if (ch == '=' && IsASCII(chNext) && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE)
levelCurrent++;
else if (styler.Match(i, "=cut") && levelCurrent > SC_FOLDLEVELBASE)
levelCurrent = (levelCurrent & ~PERL_HEADFOLD_MASK) - 1;

View File

@@ -40,6 +40,7 @@ static void ColourisePowerShellDoc(unsigned int startPos, int length, int initSt
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
styler.StartAt(startPos);
@@ -52,9 +53,26 @@ static void ColourisePowerShellDoc(unsigned int startPos, int length, int initSt
sc.SetState(SCE_POWERSHELL_DEFAULT);
}
} else if (sc.state == SCE_POWERSHELL_COMMENTSTREAM) {
if(sc.atLineStart) {
while(IsASpaceOrTab(sc.ch)) {
sc.Forward();
}
if (sc.ch == '.' && IsAWordChar(sc.chNext)) {
sc.SetState(SCE_POWERSHELL_COMMENTDOCKEYWORD);
}
}
if (sc.ch == '>' && sc.chPrev == '#') {
sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
}
} else if (sc.state == SCE_POWERSHELL_COMMENTDOCKEYWORD) {
if(!IsAWordChar(sc.ch)) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (!keywords6.InList(s + 1)) {
sc.ChangeState(SCE_POWERSHELL_COMMENTSTREAM);
}
sc.SetState(SCE_POWERSHELL_COMMENTSTREAM);
}
} else if (sc.state == SCE_POWERSHELL_STRING) {
// This is a doubles quotes string
if (sc.ch == '\"') {
@@ -65,6 +83,18 @@ static void ColourisePowerShellDoc(unsigned int startPos, int length, int initSt
if (sc.ch == '\'') {
sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
}
} else if (sc.state == SCE_POWERSHELL_HERE_STRING) {
// This is a doubles quotes here-string
if (sc.atLineStart && sc.ch == '\"' && sc.chNext == '@') {
sc.Forward(2);
sc.SetState(SCE_POWERSHELL_DEFAULT);
}
} else if (sc.state == SCE_POWERSHELL_HERE_CHARACTER) {
// This is a single quote here-string
if (sc.atLineStart && sc.ch == '\'' && sc.chNext == '@') {
sc.Forward(2);
sc.SetState(SCE_POWERSHELL_DEFAULT);
}
} else if (sc.state == SCE_POWERSHELL_NUMBER) {
if (!IsADigit(sc.ch)) {
sc.SetState(SCE_POWERSHELL_DEFAULT);
@@ -107,6 +137,10 @@ static void ColourisePowerShellDoc(unsigned int startPos, int length, int initSt
sc.SetState(SCE_POWERSHELL_STRING);
} else if (sc.ch == '\'') {
sc.SetState(SCE_POWERSHELL_CHARACTER);
} else if (sc.ch == '@' && sc.chNext == '\"') {
sc.SetState(SCE_POWERSHELL_HERE_STRING);
} else if (sc.ch == '@' && sc.chNext == '\'') {
sc.SetState(SCE_POWERSHELL_HERE_CHARACTER);
} else if (sc.ch == '$') {
sc.SetState(SCE_POWERSHELL_VARIABLE);
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
@@ -159,11 +193,23 @@ static void FoldPowerShellDoc(unsigned int startPos, int length, int initStyle,
levelNext--;
}
} else if (foldComment && style == SCE_POWERSHELL_COMMENTSTREAM) {
if (stylePrev != SCE_POWERSHELL_COMMENTSTREAM) {
if (stylePrev != SCE_POWERSHELL_COMMENTSTREAM && stylePrev != SCE_POWERSHELL_COMMENTDOCKEYWORD) {
levelNext++;
} else if (styleNext != SCE_POWERSHELL_COMMENTSTREAM) {
} else if (styleNext != SCE_POWERSHELL_COMMENTSTREAM && styleNext != SCE_POWERSHELL_COMMENTDOCKEYWORD) {
levelNext--;
}
} else if (foldComment && style == SCE_POWERSHELL_COMMENT) {
if (ch == '#') {
unsigned int j = i + 1;
while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
j++;
}
if (styler.Match(j, "region")) {
levelNext++;
} else if (styler.Match(j, "endregion")) {
levelNext--;
}
}
}
if (!IsASpace(ch))
visibleChars++;
@@ -194,6 +240,7 @@ static const char * const powershellWordLists[] = {
"Aliases",
"Functions",
"User1",
"DocComment",
0
};

View File

@@ -385,7 +385,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
base_n_number = false;
sc.SetState(SCE_P_NUMBER);
}
} else if ((isascii(sc.ch) && isoperator(static_cast<char>(sc.ch))) || sc.ch == '`') {
} else if ((IsASCII(sc.ch) && isoperator(static_cast<char>(sc.ch))) || sc.ch == '`') {
sc.SetState(SCE_P_OPERATOR);
} else if (sc.ch == '#') {
sc.SetState(sc.chNext == '#' ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE);

View File

@@ -37,7 +37,7 @@ static inline bool IsAWordStart(const int ch) {
}
static inline bool IsAnOperator(const int ch) {
if (isascii(ch) && isalnum(ch))
if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '-' || ch == '+' || ch == '!' || ch == '~' ||

View File

@@ -119,7 +119,7 @@ static int ClassifyWordRb(unsigned int start, unsigned int end, WordList &keywor
chAttr = SCE_RB_MODULE_NAME;
else if (0 == strcmp(prevWord, "def"))
chAttr = SCE_RB_DEFNAME;
else if (keywords.InList(s) && !followsDot(start - 1, styler)) {
else if (keywords.InList(s) && ((start == 0) || !followsDot(start - 1, styler))) {
if (keywordIsAmbiguous(s)
&& keywordIsModifier(s, start, styler)) {
@@ -254,7 +254,7 @@ class QuoteCls {
char Up;
char Down;
QuoteCls() {
this->New();
New();
}
void New() {
Count = 0;
@@ -465,7 +465,9 @@ static bool sureThisIsNotHeredoc(int lt2StartPos,
}
prevStyle = styler.StyleAt(firstWordPosn);
// If we have '<<' following a keyword, it's not a heredoc
if (prevStyle != SCE_RB_IDENTIFIER) {
if (prevStyle != SCE_RB_IDENTIFIER
&& prevStyle != SCE_RB_INSTANCE_VAR
&& prevStyle != SCE_RB_CLASS_VAR) {
return definitely_not_a_here_doc;
}
int newStyle = prevStyle;
@@ -495,6 +497,9 @@ static bool sureThisIsNotHeredoc(int lt2StartPos,
} else {
break;
}
// on second and next passes, only identifiers may appear since
// class and instance variable are private
prevStyle = SCE_RB_IDENTIFIER;
}
// Skip next batch of white-space
firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler);
@@ -1436,7 +1441,8 @@ static bool keywordIsAmbiguous(const char *prevWord)
|| !strcmp(prevWord, "do")
|| !strcmp(prevWord, "while")
|| !strcmp(prevWord, "unless")
|| !strcmp(prevWord, "until")) {
|| !strcmp(prevWord, "until")
|| !strcmp(prevWord, "for")) {
return true;
} else {
return false;
@@ -1554,6 +1560,7 @@ static bool keywordIsModifier(const char *word,
#define WHILE_BACKWARDS "elihw"
#define UNTIL_BACKWARDS "litnu"
#define FOR_BACKWARDS "rof"
// Nothing fancy -- look to see if we follow a while/until somewhere
// on the current line
@@ -1591,7 +1598,8 @@ static bool keywordDoStartsLoop(int pos,
*dst = 0;
// Did we see our keyword?
if (!strcmp(prevWord, WHILE_BACKWARDS)
|| !strcmp(prevWord, UNTIL_BACKWARDS)) {
|| !strcmp(prevWord, UNTIL_BACKWARDS)
|| !strcmp(prevWord, FOR_BACKWARDS)) {
return true;
}
// We can move pos to the beginning of the keyword, and then

View File

@@ -0,0 +1,781 @@
/** @file LexRust.cxx
** Lexer for Rust.
**
** Copyright (c) 2013 by SiegeLord <slabode@aim.com>
** Converted to lexer object and added further folding features/properties by "Udo Lechner" <dlchnr(at)gmx(dot)net>
**/
// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <string>
#include <map>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
#include "OptionSet.h"
#include "PropSetSimple.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
static const int NUM_RUST_KEYWORD_LISTS = 7;
static const int MAX_RUST_IDENT_CHARS = 1023;
static bool IsStreamCommentStyle(int style) {
return style == SCE_RUST_COMMENTBLOCK ||
style == SCE_RUST_COMMENTBLOCKDOC;
}
// Options used for LexerRust
struct OptionsRust {
bool fold;
bool foldSyntaxBased;
bool foldComment;
bool foldCommentMultiline;
bool foldCommentExplicit;
std::string foldExplicitStart;
std::string foldExplicitEnd;
bool foldExplicitAnywhere;
bool foldCompact;
int foldAtElseInt;
bool foldAtElse;
OptionsRust() {
fold = false;
foldSyntaxBased = true;
foldComment = false;
foldCommentMultiline = true;
foldCommentExplicit = true;
foldExplicitStart = "";
foldExplicitEnd = "";
foldExplicitAnywhere = false;
foldCompact = true;
foldAtElseInt = -1;
foldAtElse = false;
}
};
static const char * const rustWordLists[NUM_RUST_KEYWORD_LISTS + 1] = {
"Primary keywords and identifiers",
"Built in types",
"Other keywords",
"Keywords 4",
"Keywords 5",
"Keywords 6",
"Keywords 7",
0,
};
struct OptionSetRust : public OptionSet<OptionsRust> {
OptionSetRust() {
DefineProperty("fold", &OptionsRust::fold);
DefineProperty("fold.comment", &OptionsRust::foldComment);
DefineProperty("fold.compact", &OptionsRust::foldCompact);
DefineProperty("fold.at.else", &OptionsRust::foldAtElse);
DefineProperty("fold.rust.syntax.based", &OptionsRust::foldSyntaxBased,
"Set this property to 0 to disable syntax based folding.");
DefineProperty("fold.rust.comment.multiline", &OptionsRust::foldCommentMultiline,
"Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
DefineProperty("fold.rust.comment.explicit", &OptionsRust::foldCommentExplicit,
"Set this property to 0 to disable folding explicit fold points when fold.comment=1.");
DefineProperty("fold.rust.explicit.start", &OptionsRust::foldExplicitStart,
"The string to use for explicit fold start points, replacing the standard //{.");
DefineProperty("fold.rust.explicit.end", &OptionsRust::foldExplicitEnd,
"The string to use for explicit fold end points, replacing the standard //}.");
DefineProperty("fold.rust.explicit.anywhere", &OptionsRust::foldExplicitAnywhere,
"Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
DefineProperty("lexer.rust.fold.at.else", &OptionsRust::foldAtElseInt,
"This option enables Rust folding on a \"} else {\" line of an if statement.");
DefineWordListSets(rustWordLists);
}
};
class LexerRust : public ILexer {
WordList keywords[NUM_RUST_KEYWORD_LISTS];
OptionsRust options;
OptionSetRust osRust;
public:
virtual ~LexerRust() {
}
void SCI_METHOD Release() {
delete this;
}
int SCI_METHOD Version() const {
return lvOriginal;
}
const char * SCI_METHOD PropertyNames() {
return osRust.PropertyNames();
}
int SCI_METHOD PropertyType(const char *name) {
return osRust.PropertyType(name);
}
const char * SCI_METHOD DescribeProperty(const char *name) {
return osRust.DescribeProperty(name);
}
int SCI_METHOD PropertySet(const char *key, const char *val);
const char * SCI_METHOD DescribeWordListSets() {
return osRust.DescribeWordListSets();
}
int SCI_METHOD WordListSet(int n, const char *wl);
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
void * SCI_METHOD PrivateCall(int, void *) {
return 0;
}
static ILexer *LexerFactoryRust() {
return new LexerRust();
}
};
int SCI_METHOD LexerRust::PropertySet(const char *key, const char *val) {
if (osRust.PropertySet(&options, key, val)) {
return 0;
}
return -1;
}
int SCI_METHOD LexerRust::WordListSet(int n, const char *wl) {
int firstModification = -1;
if (n < NUM_RUST_KEYWORD_LISTS) {
WordList *wordListN = &keywords[n];
WordList wlNew;
wlNew.Set(wl);
if (*wordListN != wlNew) {
wordListN->Set(wl);
firstModification = 0;
}
}
return firstModification;
}
static bool IsWhitespace(int c) {
return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}
/* This isn't quite right for Unicode identifiers */
static bool IsIdentifierStart(int ch) {
return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch);
}
/* This isn't quite right for Unicode identifiers */
static bool IsIdentifierContinue(int ch) {
return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch);
}
static void ScanWhitespace(Accessor& styler, int& pos, int max) {
while (IsWhitespace(styler.SafeGetCharAt(pos, '\0')) && pos < max) {
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), 0);
pos++;
}
styler.ColourTo(pos-1, SCE_RUST_DEFAULT);
}
static void GrabString(char* s, Accessor& styler, int start, int len) {
for (int ii = 0; ii < len; ii++)
s[ii] = styler[ii + start];
s[len] = '\0';
}
static void ScanIdentifier(Accessor& styler, int& pos, WordList *keywords) {
int start = pos;
while (IsIdentifierContinue(styler.SafeGetCharAt(pos, '\0')))
pos++;
if (styler.SafeGetCharAt(pos, '\0') == '!') {
pos++;
styler.ColourTo(pos - 1, SCE_RUST_MACRO);
} else {
char s[MAX_RUST_IDENT_CHARS + 1];
int len = pos - start;
len = len > MAX_RUST_IDENT_CHARS ? MAX_RUST_IDENT_CHARS : len;
GrabString(s, styler, start, len);
bool keyword = false;
for (int ii = 0; ii < NUM_RUST_KEYWORD_LISTS; ii++) {
if (keywords[ii].InList(s)) {
styler.ColourTo(pos - 1, SCE_RUST_WORD + ii);
keyword = true;
break;
}
}
if (!keyword) {
styler.ColourTo(pos - 1, SCE_RUST_IDENTIFIER);
}
}
}
static void ScanDigits(Accessor& styler, int& pos, int base) {
for (;;) {
int c = styler.SafeGetCharAt(pos, '\0');
if (IsADigit(c, base) || c == '_')
pos++;
else
break;
}
}
static void ScanNumber(Accessor& styler, int& pos) {
int base = 10;
int c = styler.SafeGetCharAt(pos, '\0');
int n = styler.SafeGetCharAt(pos + 1, '\0');
bool error = false;
if (c == '0' && n == 'x') {
pos += 2;
base = 16;
} else if (c == '0' && n == 'b') {
pos += 2;
base = 2;
} else if (c == '0' && n == 'o') {
pos += 2;
base = 8;
}
int old_pos = pos;
ScanDigits(styler, pos, base);
c = styler.SafeGetCharAt(pos, '\0');
if (c == 'u' || c == 'i') {
pos++;
c = styler.SafeGetCharAt(pos, '\0');
n = styler.SafeGetCharAt(pos + 1, '\0');
if (c == '8') {
pos++;
} else if (c == '1' && n == '6') {
pos += 2;
} else if (c == '3' && n == '2') {
pos += 2;
} else if (c == '6' && n == '4') {
pos += 2;
}
} else {
n = styler.SafeGetCharAt(pos + 1, '\0');
if (c == '.' && !(IsIdentifierStart(n) || n == '.')) {
error |= base != 10;
pos++;
ScanDigits(styler, pos, 10);
}
c = styler.SafeGetCharAt(pos, '\0');
if (c == 'e' || c == 'E') {
error |= base != 10;
pos++;
c = styler.SafeGetCharAt(pos, '\0');
if (c == '-' || c == '+')
pos++;
int old_pos = pos;
ScanDigits(styler, pos, 10);
if (old_pos == pos) {
error = true;
}
}
c = styler.SafeGetCharAt(pos, '\0');
if (c == 'f') {
error |= base != 10;
pos++;
c = styler.SafeGetCharAt(pos, '\0');
n = styler.SafeGetCharAt(pos + 1, '\0');
if (c == '3' && n == '2') {
pos += 2;
} else if (c == '6' && n == '4') {
pos += 2;
} else {
error = true;
}
}
}
if (old_pos == pos) {
error = true;
}
if (error)
styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
else
styler.ColourTo(pos - 1, SCE_RUST_NUMBER);
}
static bool IsOneCharOperator(int c) {
return c == ';' || c == ',' || c == '(' || c == ')'
|| c == '{' || c == '}' || c == '[' || c == ']'
|| c == '@' || c == '#' || c == '~' || c == '+'
|| c == '*' || c == '/' || c == '^' || c == '%'
|| c == '.' || c == ':' || c == '!' || c == '<'
|| c == '>' || c == '=' || c == '-' || c == '&'
|| c == '|' || c == '$';
}
static bool IsTwoCharOperator(int c, int n) {
return (c == '.' && n == '.') || (c == ':' && n == ':')
|| (c == '!' && n == '=') || (c == '<' && n == '<')
|| (c == '<' && n == '=') || (c == '>' && n == '>')
|| (c == '>' && n == '=') || (c == '=' && n == '=')
|| (c == '=' && n == '>') || (c == '-' && n == '>')
|| (c == '&' && n == '&') || (c == '|' && n == '|')
|| (c == '-' && n == '=') || (c == '&' && n == '=')
|| (c == '|' && n == '=') || (c == '+' && n == '=')
|| (c == '*' && n == '=') || (c == '/' && n == '=')
|| (c == '^' && n == '=') || (c == '%' && n == '=');
}
static bool IsThreeCharOperator(int c, int n, int n2) {
return (c == '<' && n == '<' && n2 == '=')
|| (c == '>' && n == '>' && n2 == '=');
}
static bool IsValidCharacterEscape(int c) {
return c == 'n' || c == 'r' || c == 't' || c == '\\'
|| c == '\'' || c == '"' || c == '0';
}
static bool IsValidStringEscape(int c) {
return IsValidCharacterEscape(c) || c == '\n';
}
static bool ScanNumericEscape(Accessor &styler, int& pos, int num_digits, bool stop_asap) {
for (;;) {
int c = styler.SafeGetCharAt(pos, '\0');
if (!IsADigit(c, 16))
break;
num_digits--;
pos++;
if (num_digits == 0 && stop_asap)
return true;
}
if (num_digits == 0) {
return true;
} else {
return false;
}
}
/* This is overly permissive for character literals in order to accept UTF-8 encoded
* character literals. */
static void ScanCharacterLiteralOrLifetime(Accessor &styler, int& pos) {
pos++;
int c = styler.SafeGetCharAt(pos, '\0');
int n = styler.SafeGetCharAt(pos + 1, '\0');
bool done = false;
bool valid_lifetime = IsIdentifierStart(c);
bool valid_char = true;
bool first = true;
while (!done) {
switch (c) {
case '\\':
done = true;
if (IsValidCharacterEscape(n)) {
pos += 2;
} else if (n == 'x') {
pos += 2;
valid_char = ScanNumericEscape(styler, pos, 2, false);
} else if (n == 'u') {
pos += 2;
valid_char = ScanNumericEscape(styler, pos, 4, false);
} else if (n == 'U') {
pos += 2;
valid_char = ScanNumericEscape(styler, pos, 8, false);
} else {
valid_char = false;
}
break;
case '\'':
valid_char = !first;
done = true;
break;
case '\t':
case '\n':
case '\r':
case '\0':
valid_char = false;
done = true;
break;
default:
if (!IsIdentifierContinue(c) && !first) {
done = true;
} else {
pos++;
}
break;
}
c = styler.SafeGetCharAt(pos, '\0');
n = styler.SafeGetCharAt(pos + 1, '\0');
first = false;
}
if (styler.SafeGetCharAt(pos, '\0') == '\'') {
valid_lifetime = false;
} else {
valid_char = false;
}
if (valid_lifetime) {
styler.ColourTo(pos - 1, SCE_RUST_LIFETIME);
} else if (valid_char) {
pos++;
styler.ColourTo(pos - 1, SCE_RUST_CHARACTER);
} else {
styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
}
}
enum CommentState {
UnknownComment,
DocComment,
NotDocComment
};
/*
* The rule for block-doc comments is as follows: /xxN and /x! (where x is an asterisk, N is a non-asterisk) start doc comments.
* Otherwise it's a regular comment.
*/
static void ResumeBlockComment(Accessor &styler, int& pos, int max, CommentState state, int level) {
int c = styler.SafeGetCharAt(pos, '\0');
bool maybe_doc_comment = false;
if (c == '*') {
int n = styler.SafeGetCharAt(pos + 1, '\0');
if (n != '*' && n != '/') {
maybe_doc_comment = true;
}
} else if (c == '!') {
maybe_doc_comment = true;
}
for (;;) {
int n = styler.SafeGetCharAt(pos + 1, '\0');
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), level);
if (c == '*') {
pos++;
if (n == '/') {
pos++;
level--;
if (level == 0) {
styler.SetLineState(styler.GetLine(pos), 0);
if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
else
styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK);
break;
}
}
} else if (c == '/') {
pos++;
if (n == '*') {
pos++;
level++;
}
}
else {
pos++;
}
if (pos >= max) {
if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
else
styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK);
break;
}
c = styler.SafeGetCharAt(pos, '\0');
}
}
/*
* The rule for line-doc comments is as follows... ///N and //! (where N is a non slash) start doc comments.
* Otherwise it's a normal line comment.
*/
static void ResumeLineComment(Accessor &styler, int& pos, int max, CommentState state) {
bool maybe_doc_comment = false;
int c = styler.SafeGetCharAt(pos, '\0');
if (c == '/') {
if (pos < max) {
pos++;
c = styler.SafeGetCharAt(pos, '\0');
if (c != '/') {
maybe_doc_comment = true;
}
}
} else if (c == '!') {
maybe_doc_comment = true;
}
while (pos < max && c != '\n') {
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), 0);
pos++;
c = styler.SafeGetCharAt(pos, '\0');
}
if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
styler.ColourTo(pos - 1, SCE_RUST_COMMENTLINEDOC);
else
styler.ColourTo(pos - 1, SCE_RUST_COMMENTLINE);
}
static void ScanComments(Accessor &styler, int& pos, int max) {
pos++;
int c = styler.SafeGetCharAt(pos, '\0');
pos++;
if (c == '/')
ResumeLineComment(styler, pos, max, UnknownComment);
else if (c == '*')
ResumeBlockComment(styler, pos, max, UnknownComment, 1);
}
static void ResumeString(Accessor &styler, int& pos, int max) {
int c = styler.SafeGetCharAt(pos, '\0');
bool error = false;
while (c != '"' && !error) {
if (pos >= max) {
error = true;
break;
}
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), 0);
if (c == '\\') {
int n = styler.SafeGetCharAt(pos + 1, '\0');
if (IsValidStringEscape(n)) {
pos += 2;
} else if (n == 'x') {
pos += 2;
error = !ScanNumericEscape(styler, pos, 2, true);
} else if (n == 'u') {
pos += 2;
error = !ScanNumericEscape(styler, pos, 4, true);
} else if (n == 'U') {
pos += 2;
error = !ScanNumericEscape(styler, pos, 8, true);
} else {
pos += 1;
error = true;
}
} else {
pos++;
}
c = styler.SafeGetCharAt(pos, '\0');
}
if (!error)
pos++;
styler.ColourTo(pos - 1, SCE_RUST_STRING);
}
static void ResumeRawString(Accessor &styler, int& pos, int max, int num_hashes) {
for (;;) {
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), num_hashes);
int c = styler.SafeGetCharAt(pos, '\0');
if (c == '"') {
pos++;
int trailing_num_hashes = 0;
while (styler.SafeGetCharAt(pos, '\0') == '#' && trailing_num_hashes < num_hashes) {
trailing_num_hashes++;
pos++;
}
if (trailing_num_hashes == num_hashes) {
styler.SetLineState(styler.GetLine(pos), 0);
styler.ColourTo(pos - 1, SCE_RUST_STRINGR);
break;
}
} else if (pos >= max) {
styler.ColourTo(pos - 1, SCE_RUST_STRINGR);
break;
} else {
pos++;
}
}
}
static void ScanRawString(Accessor &styler, int& pos, int max) {
pos++;
int num_hashes = 0;
while (styler.SafeGetCharAt(pos, '\0') == '#') {
num_hashes++;
pos++;
}
if (styler.SafeGetCharAt(pos, '\0') != '"') {
styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
} else {
pos++;
ResumeRawString(styler, pos, max, num_hashes);
}
}
void SCI_METHOD LexerRust::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
PropSetSimple props;
Accessor styler(pAccess, &props);
int pos = startPos;
int max = pos + length;
styler.StartAt(pos);
styler.StartSegment(pos);
if (initStyle == SCE_RUST_COMMENTBLOCK || initStyle == SCE_RUST_COMMENTBLOCKDOC) {
ResumeBlockComment(styler, pos, max, initStyle == SCE_RUST_COMMENTBLOCKDOC ? DocComment : NotDocComment, styler.GetLineState(styler.GetLine(pos) - 1));
} else if (initStyle == SCE_RUST_COMMENTLINE || initStyle == SCE_RUST_COMMENTLINEDOC) {
ResumeLineComment(styler, pos, max, initStyle == SCE_RUST_COMMENTLINEDOC ? DocComment : NotDocComment);
} else if (initStyle == SCE_RUST_STRING) {
ResumeString(styler, pos, max);
} else if (initStyle == SCE_RUST_STRINGR) {
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1));
}
while (pos < max) {
int c = styler.SafeGetCharAt(pos, '\0');
int n = styler.SafeGetCharAt(pos + 1, '\0');
int n2 = styler.SafeGetCharAt(pos + 2, '\0');
if (pos == 0 && c == '#' && n == '!') {
pos += 2;
ResumeLineComment(styler, pos, max, NotDocComment);
} else if (IsWhitespace(c)) {
ScanWhitespace(styler, pos, max);
} else if (c == '/' && (n == '/' || n == '*')) {
ScanComments(styler, pos, max);
} else if (c == 'r' && (n == '#' || n == '"')) {
ScanRawString(styler, pos, max);
} else if (IsIdentifierStart(c)) {
ScanIdentifier(styler, pos, keywords);
} else if (IsADigit(c)) {
ScanNumber(styler, pos);
} else if (IsThreeCharOperator(c, n, n2)) {
pos += 3;
styler.ColourTo(pos - 1, SCE_RUST_OPERATOR);
} else if (IsTwoCharOperator(c, n)) {
pos += 2;
styler.ColourTo(pos - 1, SCE_RUST_OPERATOR);
} else if (IsOneCharOperator(c)) {
pos++;
styler.ColourTo(pos - 1, SCE_RUST_OPERATOR);
} else if (c == '\'') {
ScanCharacterLiteralOrLifetime(styler, pos);
} else if (c == '"') {
pos++;
ResumeString(styler, pos, max);
} else {
pos++;
styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
}
}
styler.ColourTo(pos - 1, SCE_RUST_DEFAULT);
styler.Flush();
}
void SCI_METHOD LexerRust::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
if (!options.fold)
return;
LexAccessor styler(pAccess);
unsigned int endPos = startPos + length;
int visibleChars = 0;
bool inLineComment = false;
int lineCurrent = styler.GetLine(startPos);
int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0)
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
unsigned int lineStartNext = styler.LineStart(lineCurrent+1);
int levelMinCurrent = levelCurrent;
int levelNext = levelCurrent;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = i == (lineStartNext-1);
if ((style == SCE_RUST_COMMENTLINE) || (style == SCE_RUST_COMMENTLINEDOC))
inLineComment = true;
if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
if (!IsStreamCommentStyle(stylePrev)) {
levelNext++;
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelNext--;
}
}
if (options.foldComment && options.foldCommentExplicit && ((style == SCE_RUST_COMMENTLINE) || options.foldExplicitAnywhere)) {
if (userDefinedFoldMarkers) {
if (styler.Match(i, options.foldExplicitStart.c_str())) {
levelNext++;
} else if (styler.Match(i, options.foldExplicitEnd.c_str())) {
levelNext--;
}
} else {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
levelNext++;
} else if (chNext2 == '}') {
levelNext--;
}
}
}
}
if (options.foldSyntaxBased && (style == SCE_RUST_OPERATOR)) {
if (ch == '{') {
// Measure the minimum before a '{' to allow
// folding on "} else {"
if (levelMinCurrent > levelNext) {
levelMinCurrent = levelNext;
}
levelNext++;
} else if (ch == '}') {
levelNext--;
}
}
if (!IsASpace(ch))
visibleChars++;
if (atEOL || (i == endPos-1)) {
int levelUse = levelCurrent;
if (options.foldSyntaxBased && options.foldAtElse) {
levelUse = levelMinCurrent;
}
int lev = levelUse | levelNext << 16;
if (visibleChars == 0 && options.foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if (levelUse < levelNext)
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev);
}
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent+1);
levelCurrent = levelNext;
levelMinCurrent = levelCurrent;
if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
// There is an empty line at end of file so give it same level and empty
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
}
visibleChars = 0;
inLineComment = false;
}
}
}
LexerModule lmRust(SCLEX_RUST, LexerRust::LexerFactoryRust, "rust", rustWordLists);

View File

@@ -62,6 +62,7 @@ static inline bool IsANumberChar(int ch) {
ch == '.' || ch == '-' || ch == '+');
}
typedef unsigned int sql_state_t;
class SQLStates {
public :
@@ -69,7 +70,7 @@ public :
sqlStatement.Set(lineNumber, sqlStatesLine);
}
unsigned short int IgnoreWhen (unsigned short int sqlStatesLine, bool enable) {
sql_state_t IgnoreWhen (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_IGNORE_WHEN;
else
@@ -78,7 +79,7 @@ public :
return sqlStatesLine;
}
unsigned short int IntoCondition (unsigned short int sqlStatesLine, bool enable) {
sql_state_t IntoCondition (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_INTO_CONDITION;
else
@@ -87,7 +88,7 @@ public :
return sqlStatesLine;
}
unsigned short int IntoExceptionBlock (unsigned short int sqlStatesLine, bool enable) {
sql_state_t IntoExceptionBlock (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_INTO_EXCEPTION;
else
@@ -96,7 +97,7 @@ public :
return sqlStatesLine;
}
unsigned short int IntoDeclareBlock (unsigned short int sqlStatesLine, bool enable) {
sql_state_t IntoDeclareBlock (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_INTO_DECLARE;
else
@@ -105,7 +106,7 @@ public :
return sqlStatesLine;
}
unsigned short int IntoMergeStatement (unsigned short int sqlStatesLine, bool enable) {
sql_state_t IntoMergeStatement (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_MERGE_STATEMENT;
else
@@ -114,7 +115,7 @@ public :
return sqlStatesLine;
}
unsigned short int CaseMergeWithoutWhenFound (unsigned short int sqlStatesLine, bool found) {
sql_state_t CaseMergeWithoutWhenFound (sql_state_t sqlStatesLine, bool found) {
if (found)
sqlStatesLine |= MASK_CASE_MERGE_WITHOUT_WHEN_FOUND;
else
@@ -122,79 +123,117 @@ public :
return sqlStatesLine;
}
unsigned short int IntoSelectStatement (unsigned short int sqlStatesLine, bool found) {
sql_state_t IntoSelectStatementOrAssignment (sql_state_t sqlStatesLine, bool found) {
if (found)
sqlStatesLine |= MASK_INTO_SELECT_STATEMENT;
sqlStatesLine |= MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT;
else
sqlStatesLine &= ~MASK_INTO_SELECT_STATEMENT;
sqlStatesLine &= ~MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT;
return sqlStatesLine;
}
unsigned short int BeginCaseBlock (unsigned short int sqlStatesLine) {
sql_state_t BeginCaseBlock (sql_state_t sqlStatesLine) {
if ((sqlStatesLine & MASK_NESTED_CASES) < MASK_NESTED_CASES) {
sqlStatesLine++;
}
return sqlStatesLine;
}
unsigned short int EndCaseBlock (unsigned short int sqlStatesLine) {
sql_state_t EndCaseBlock (sql_state_t sqlStatesLine) {
if ((sqlStatesLine & MASK_NESTED_CASES) > 0) {
sqlStatesLine--;
}
return sqlStatesLine;
}
bool IsIgnoreWhen (unsigned short int sqlStatesLine) {
sql_state_t IntoCreateStatement (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_INTO_CREATE;
else
sqlStatesLine &= ~MASK_INTO_CREATE;
return sqlStatesLine;
}
sql_state_t IntoCreateViewStatement (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_INTO_CREATE_VIEW;
else
sqlStatesLine &= ~MASK_INTO_CREATE_VIEW;
return sqlStatesLine;
}
sql_state_t IntoCreateViewAsStatement (sql_state_t sqlStatesLine, bool enable) {
if (enable)
sqlStatesLine |= MASK_INTO_CREATE_VIEW_AS_STATEMENT;
else
sqlStatesLine &= ~MASK_INTO_CREATE_VIEW_AS_STATEMENT;
return sqlStatesLine;
}
bool IsIgnoreWhen (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_IGNORE_WHEN) != 0;
}
bool IsIntoCondition (unsigned short int sqlStatesLine) {
bool IsIntoCondition (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_CONDITION) != 0;
}
bool IsIntoCaseBlock (unsigned short int sqlStatesLine) {
bool IsIntoCaseBlock (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_NESTED_CASES) != 0;
}
bool IsIntoExceptionBlock (unsigned short int sqlStatesLine) {
bool IsIntoExceptionBlock (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_EXCEPTION) != 0;
}
bool IsIntoSelectStatement (unsigned short int sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_SELECT_STATEMENT) != 0;
bool IsIntoSelectStatementOrAssignment (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT) != 0;
}
bool IsCaseMergeWithoutWhenFound (unsigned short int sqlStatesLine) {
bool IsCaseMergeWithoutWhenFound (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_CASE_MERGE_WITHOUT_WHEN_FOUND) != 0;
}
bool IsIntoDeclareBlock (unsigned short int sqlStatesLine) {
bool IsIntoDeclareBlock (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_DECLARE) != 0;
}
bool IsIntoMergeStatement (unsigned short int sqlStatesLine) {
bool IsIntoMergeStatement (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_MERGE_STATEMENT) != 0;
}
unsigned short int ForLine(int lineNumber) {
bool IsIntoCreateStatement (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_CREATE) != 0;
}
bool IsIntoCreateViewStatement (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_CREATE_VIEW) != 0;
}
bool IsIntoCreateViewAsStatement (sql_state_t sqlStatesLine) {
return (sqlStatesLine & MASK_INTO_CREATE_VIEW_AS_STATEMENT) != 0;
}
sql_state_t ForLine(int lineNumber) {
return sqlStatement.ValueAt(lineNumber);
}
SQLStates() {}
private :
SparseState <unsigned short int> sqlStatement;
SparseState <sql_state_t> sqlStatement;
enum {
MASK_NESTED_CASES = 0x01FF,
MASK_INTO_SELECT_STATEMENT = 0x0200,
MASK_CASE_MERGE_WITHOUT_WHEN_FOUND = 0x0400,
MASK_MERGE_STATEMENT = 0x0800,
MASK_INTO_DECLARE = 0x1000,
MASK_INTO_EXCEPTION = 0x2000,
MASK_INTO_CONDITION = 0x4000,
MASK_IGNORE_WHEN = 0x8000
MASK_NESTED_CASES = 0x0001FF,
MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT = 0x000200,
MASK_CASE_MERGE_WITHOUT_WHEN_FOUND = 0x000400,
MASK_MERGE_STATEMENT = 0x000800,
MASK_INTO_DECLARE = 0x001000,
MASK_INTO_EXCEPTION = 0x002000,
MASK_INTO_CONDITION = 0x004000,
MASK_IGNORE_WHEN = 0x008000,
MASK_INTO_CREATE = 0x010000,
MASK_INTO_CREATE_VIEW = 0x020000,
MASK_INTO_CREATE_VIEW_AS_STATEMENT = 0x040000
};
};
@@ -565,12 +604,46 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
if (lineCurrent > 0) {
// Backtrack to previous line in case need to fix its fold status for folding block of single-line comments (i.e. '--').
lineCurrent -= 1;
startPos = styler.LineStart(lineCurrent);
int lastNLPos = -1;
// And keep going back until we find an operator ';' followed
// by white-space and/or comments. This will improve folding.
while (--startPos > 0) {
char ch = styler[startPos];
if (ch == '\n' || (ch == '\r' && styler[startPos + 1] != '\n')) {
lastNLPos = startPos;
} else if (ch == ';' &&
styler.StyleAt(startPos) == SCE_SQL_OPERATOR) {
bool isAllClear = true;
for (int tempPos = startPos + 1;
tempPos < lastNLPos;
++tempPos) {
int tempStyle = styler.StyleAt(tempPos);
if (!IsCommentStyle(tempStyle)
&& tempStyle != SCE_SQL_DEFAULT) {
isAllClear = false;
break;
}
}
if (isAllClear) {
startPos = lastNLPos + 1;
break;
}
}
}
lineCurrent = styler.GetLine(startPos);
if (lineCurrent > 0)
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
}
// And because folding ends at ';', keep going until we find one
// Otherwise if create ... view ... as is split over multiple
// lines the folding won't always update immediately.
unsigned int docLength = styler.Length();
for (; endPos < docLength; ++endPos) {
if (styler.SafeGetCharAt(endPos) == ';') {
break;
}
}
int levelNext = levelCurrent;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
@@ -580,7 +653,7 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
// this statementFound flag avoids to fold when the statement is on only one line by ignoring ELSE or ELSIF
// eg. "IF condition1 THEN ... ELSIF condition2 THEN ... ELSE ... END IF;"
bool statementFound = false;
unsigned short int sqlStatesCurrentLine = 0;
sql_state_t sqlStatesCurrentLine = 0;
if (!options.foldOnlyBegin) {
sqlStatesCurrentLine = sqlStates.ForLine(lineCurrent);
}
@@ -608,9 +681,22 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
sqlStatesCurrentLine = sqlStates.IntoMergeStatement(sqlStatesCurrentLine, false);
levelNext--;
}
if (sqlStates.IsIntoSelectStatement(sqlStatesCurrentLine))
sqlStatesCurrentLine = sqlStates.IntoSelectStatement(sqlStatesCurrentLine, false);
if (sqlStates.IsIntoSelectStatementOrAssignment(sqlStatesCurrentLine))
sqlStatesCurrentLine = sqlStates.IntoSelectStatementOrAssignment(sqlStatesCurrentLine, false);
if (sqlStates.IsIntoCreateStatement(sqlStatesCurrentLine)) {
if (sqlStates.IsIntoCreateViewStatement(sqlStatesCurrentLine)) {
if (sqlStates.IsIntoCreateViewAsStatement(sqlStatesCurrentLine)) {
levelNext--;
sqlStatesCurrentLine = sqlStates.IntoCreateViewAsStatement(sqlStatesCurrentLine, false);
}
sqlStatesCurrentLine = sqlStates.IntoCreateViewStatement(sqlStatesCurrentLine, false);
}
sqlStatesCurrentLine = sqlStates.IntoCreateStatement(sqlStatesCurrentLine, false);
}
}
if (ch == ':' && chNext == '=' && !IsCommentStyle(style))
sqlStatesCurrentLine = sqlStates.IntoSelectStatementOrAssignment(sqlStatesCurrentLine, true);
if (options.foldComment && IsStreamCommentStyle(style)) {
if (!IsStreamCommentStyle(stylePrev)) {
levelNext++;
@@ -666,10 +752,9 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
} else {
s[j] = '\0';
}
if (!options.foldOnlyBegin &&
strcmp(s, "select") == 0) {
sqlStatesCurrentLine = sqlStates.IntoSelectStatement(sqlStatesCurrentLine, true);
sqlStatesCurrentLine = sqlStates.IntoSelectStatementOrAssignment(sqlStatesCurrentLine, true);
} else if (strcmp(s, "if") == 0) {
if (endFound) {
endFound = false;
@@ -719,8 +804,10 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
levelNext--; //again for the "end case;" and block when
}
} else if (!options.foldOnlyBegin) {
if (strcmp(s, "case") == 0)
if (strcmp(s, "case") == 0) {
sqlStatesCurrentLine = sqlStates.BeginCaseBlock(sqlStatesCurrentLine);
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
}
if (levelCurrent > levelNext)
levelCurrent = levelNext;
@@ -728,7 +815,6 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
if (!statementFound)
levelNext++;
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
statementFound = true;
} else if (levelCurrent > levelNext) {
// doesn't include this line into the folding block
@@ -765,7 +851,7 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
(strcmp(s, "endif") == 0)) {
endFound = true;
levelNext--;
if (sqlStates.IsIntoSelectStatement(sqlStatesCurrentLine) && !sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
if (sqlStates.IsIntoSelectStatementOrAssignment(sqlStatesCurrentLine) && !sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
levelNext--;
if (levelNext < SC_FOLDLEVELBASE) {
levelNext = SC_FOLDLEVELBASE;
@@ -806,6 +892,19 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
levelNext++;
statementFound = true;
} else if ((!options.foldOnlyBegin) &&
strcmp(s, "create") == 0) {
sqlStatesCurrentLine = sqlStates.IntoCreateStatement(sqlStatesCurrentLine, true);
} else if ((!options.foldOnlyBegin) &&
strcmp(s, "view") == 0 &&
sqlStates.IsIntoCreateStatement(sqlStatesCurrentLine)) {
sqlStatesCurrentLine = sqlStates.IntoCreateViewStatement(sqlStatesCurrentLine, true);
} else if ((!options.foldOnlyBegin) &&
strcmp(s, "as") == 0 &&
sqlStates.IsIntoCreateViewStatement(sqlStatesCurrentLine) &&
! sqlStates.IsIntoCreateViewAsStatement(sqlStatesCurrentLine)) {
sqlStatesCurrentLine = sqlStates.IntoCreateViewAsStatement(sqlStatesCurrentLine, true);
levelNext++;
}
}
if (atEOL) {

View File

@@ -0,0 +1,406 @@
// Scintilla source code edit control
/** @file LexSTTXT.cxx
** Lexer for Structured Text language.
** Written by Pavel Bulochkin
**/
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
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);
}
else if ((*keywordlists[1]).InList(s)) {
sc.ChangeState(SCE_STTXT_TYPE);
}
else if ((*keywordlists[2]).InList(s)) {
sc.ChangeState(SCE_STTXT_FUNCTION);
}
else if ((*keywordlists[3]).InList(s)) {
sc.ChangeState(SCE_STTXT_FB);
}
else if ((*keywordlists[4]).InList(s)) {
sc.ChangeState(SCE_STTXT_VARS);
}
else if ((*keywordlists[5]).InList(s)) {
sc.ChangeState(SCE_STTXT_PRAGMAS);
}
sc.SetState(SCE_STTXT_DEFAULT);
}
static void ColouriseSTTXTDoc (unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler)
{
StyleContext sc(startPos, length, initStyle, styler);
CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
CharacterSet setNumber(CharacterSet::setDigits, "_.eE");
CharacterSet setHexNumber(CharacterSet::setDigits, "_abcdefABCDEF");
CharacterSet setOperator(CharacterSet::setNone,",.+-*/:;<=>[]()%&");
CharacterSet setDataTime(CharacterSet::setDigits,"_.-:dmshDMSH");
for ( ; sc.More() ; sc.Forward())
{
if(sc.atLineStart && sc.state != SCE_STTXT_COMMENT)
sc.SetState(SCE_STTXT_DEFAULT);
switch(sc.state)
{
case SCE_STTXT_NUMBER: {
if(!setNumber.Contains(sc.ch))
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_HEXNUMBER: {
if (setHexNumber.Contains(sc.ch))
continue;
else if(setDataTime.Contains(sc.ch))
sc.ChangeState(SCE_STTXT_DATETIME);
else if(setWord.Contains(sc.ch))
sc.ChangeState(SCE_STTXT_DEFAULT);
else
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_DATETIME: {
if (setDataTime.Contains(sc.ch))
continue;
else if(setWord.Contains(sc.ch))
sc.ChangeState(SCE_STTXT_DEFAULT);
else
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_OPERATOR: {
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_PRAGMA: {
if (sc.ch == '}')
sc.ForwardSetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_COMMENTLINE: {
if (sc.atLineStart)
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_COMMENT: {
if(sc.Match('*',')'))
{
sc.Forward();
sc.ForwardSetState(SCE_STTXT_DEFAULT);
}
break;
}
case SCE_STTXT_STRING1: {
if(sc.atLineEnd)
sc.SetState(SCE_STTXT_STRINGEOL);
else if(sc.ch == '\'' && sc.chPrev != '$')
sc.ForwardSetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_STRING2: {
if (sc.atLineEnd)
sc.SetState(SCE_STTXT_STRINGEOL);
else if(sc.ch == '\"' && sc.chPrev != '$')
sc.ForwardSetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_STRINGEOL: {
if(sc.atLineStart)
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_CHARACTER: {
if(setHexNumber.Contains(sc.ch))
sc.SetState(SCE_STTXT_HEXNUMBER);
else if(setDataTime.Contains(sc.ch))
sc.SetState(SCE_STTXT_DATETIME);
else sc.SetState(SCE_STTXT_DEFAULT);
break;
}
case SCE_STTXT_IDENTIFIER: {
if(!setWord.Contains(sc.ch))
ClassifySTTXTWord(keywordlists, sc);
break;
}
}
if(sc.state == SCE_STTXT_DEFAULT)
{
if(IsADigit(sc.ch))
sc.SetState(SCE_STTXT_NUMBER);
else if (setWordStart.Contains(sc.ch))
sc.SetState(SCE_STTXT_IDENTIFIER);
else if (sc.Match('/', '/'))
sc.SetState(SCE_STTXT_COMMENTLINE);
else if(sc.Match('(', '*'))
sc.SetState(SCE_STTXT_COMMENT);
else if (sc.ch == '{')
sc.SetState(SCE_STTXT_PRAGMA);
else if (sc.ch == '\'')
sc.SetState(SCE_STTXT_STRING1);
else if (sc.ch == '\"')
sc.SetState(SCE_STTXT_STRING2);
else if(sc.ch == '#')
sc.SetState(SCE_STTXT_CHARACTER);
else if (setOperator.Contains(sc.ch))
sc.SetState(SCE_STTXT_OPERATOR);
}
}
if (sc.state == SCE_STTXT_IDENTIFIER && setWord.Contains(sc.chPrev))
ClassifySTTXTWord(keywordlists, sc);
sc.Complete();
}
static const char * const STTXTWordListDesc[] = {
"Keywords",
"Types",
"Functions",
"FB",
"Local_Var",
"Local_Pragma",
0
};
static bool IsCommentLine(int line, Accessor &styler, bool type)
{
int pos = styler.LineStart(line);
int eolPos = styler.LineStart(line + 1) - 1;
for (int i = pos; i < eolPos; i++)
{
char ch = styler[i];
char chNext = styler.SafeGetCharAt(i + 1);
int style = styler.StyleAt(i);
if(type) {
if (ch == '/' && chNext == '/' && style == SCE_STTXT_COMMENTLINE)
return true;
}
else if (ch == '(' && chNext == '*' && style == SCE_STTXT_COMMENT)
break;
if (!IsASpaceOrTab(ch))
return false;
}
for (int i = eolPos-2; i>pos; i--)
{
char ch = styler[i];
char chPrev = styler.SafeGetCharAt(i-1);
int style = styler.StyleAt(i);
if(ch == ')' && chPrev == '*' && style == SCE_STTXT_COMMENT)
return true;
if(!IsASpaceOrTab(ch))
return false;
}
return false;
}
static bool IsPragmaLine(int line, Accessor &styler)
{
int pos = styler.LineStart(line);
int eolPos = styler.LineStart(line+1) - 1;
for (int i = pos ; i < eolPos ; i++)
{
char ch = styler[i];
int style = styler.StyleAt(i);
if(ch == '{' && style == SCE_STTXT_PRAGMA)
return true;
else if (!IsASpaceOrTab(ch))
return false;
}
return false;
}
static void GetRangeUpper(unsigned int start,unsigned int end,Accessor &styler,char *s,unsigned int len)
{
unsigned int i = 0;
while ((i < end - start + 1) && (i < len-1)) {
s[i] = static_cast<char>(toupper(styler[start + i]));
i++;
}
s[i] = '\0';
}
static void ClassifySTTXTWordFoldPoint(int &levelCurrent,unsigned int lastStart,
unsigned int currentPos, Accessor &styler)
{
char s[256];
GetRangeUpper(lastStart, currentPos, styler, s, sizeof(s));
// See Table C.2 - Keywords
if (!strcmp(s, "ACTION") ||
!strcmp(s, "CASE") ||
!strcmp(s, "CONFIGURATION") ||
!strcmp(s, "FOR") ||
!strcmp(s, "FUNCTION") ||
!strcmp(s, "FUNCTION_BLOCK") ||
!strcmp(s, "IF") ||
!strcmp(s, "INITIAL_STEP") ||
!strcmp(s, "REPEAT") ||
!strcmp(s, "RESOURCE") ||
!strcmp(s, "STEP") ||
!strcmp(s, "STRUCT") ||
!strcmp(s, "TRANSITION") ||
!strcmp(s, "TYPE") ||
!strcmp(s, "VAR") ||
!strcmp(s, "VAR_INPUT") ||
!strcmp(s, "VAR_OUTPUT") ||
!strcmp(s, "VAR_IN_OUT") ||
!strcmp(s, "VAR_TEMP") ||
!strcmp(s, "VAR_EXTERNAL") ||
!strcmp(s, "VAR_ACCESS") ||
!strcmp(s, "VAR_CONFIG") ||
!strcmp(s, "VAR_GLOBAL") ||
!strcmp(s, "WHILE"))
{
levelCurrent++;
}
else if (!strcmp(s, "END_ACTION") ||
!strcmp(s, "END_CASE") ||
!strcmp(s, "END_CONFIGURATION") ||
!strcmp(s, "END_FOR") ||
!strcmp(s, "END_FUNCTION") ||
!strcmp(s, "END_FUNCTION_BLOCK") ||
!strcmp(s, "END_IF") ||
!strcmp(s, "END_REPEAT") ||
!strcmp(s, "END_RESOURCE") ||
!strcmp(s, "END_STEP") ||
!strcmp(s, "END_STRUCT") ||
!strcmp(s, "END_TRANSITION") ||
!strcmp(s, "END_TYPE") ||
!strcmp(s, "END_VAR") ||
!strcmp(s, "END_WHILE"))
{
levelCurrent--;
if (levelCurrent < SC_FOLDLEVELBASE) {
levelCurrent = SC_FOLDLEVELBASE;
}
}
}
static void FoldSTTXTDoc(unsigned int startPos, int length, int initStyle, WordList *[],Accessor &styler)
{
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
int lastStart = 0;
CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
for (unsigned int i = startPos; i < endPos; i++)
{
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (foldComment && style == SCE_STTXT_COMMENT) {
if(stylePrev != SCE_STTXT_COMMENT)
levelCurrent++;
else if(styleNext != SCE_STTXT_COMMENT && !atEOL)
levelCurrent--;
}
if ( foldComment && atEOL && ( IsCommentLine(lineCurrent, styler,false)
|| IsCommentLine(lineCurrent,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--;
if (!IsCommentLine(lineCurrent-1, styler,false) && IsCommentLine(lineCurrent+1, styler,false))
levelCurrent++;
if (IsCommentLine(lineCurrent-1, styler,false) && !IsCommentLine(lineCurrent+1, styler,false))
levelCurrent--;
}
if(foldPreprocessor && atEOL && IsPragmaLine(lineCurrent, styler)) {
if(!IsPragmaLine(lineCurrent-1, styler) && IsPragmaLine(lineCurrent+1, styler ))
levelCurrent++;
else if(IsPragmaLine(lineCurrent-1, styler) && !IsPragmaLine(lineCurrent+1, styler))
levelCurrent--;
}
if (stylePrev != SCE_STTXT_KEYWORD && style == SCE_STTXT_KEYWORD) {
lastStart = i;
}
if(stylePrev == SCE_STTXT_KEYWORD) {
if(setWord.Contains(ch) && !setWord.Contains(chNext))
ClassifySTTXTWordFoldPoint(levelCurrent,lastStart, i, styler);
}
if (!IsASpace(ch)) {
visibleChars++;
}
if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent))
styler.SetLevel(lineCurrent, lev);
lineCurrent++;
levelPrev = levelCurrent;
visibleChars = 0;
}
// If we didn't reach the EOL in previous loop, store line level and whitespace information.
// The rest will be filled in later...
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
styler.SetLevel(lineCurrent, lev);
}
}
LexerModule lmSTTXT(SCLEX_STTXT, ColouriseSTTXTDoc, "fcST", FoldSTTXTDoc, STTXTWordListDesc);

View File

@@ -27,7 +27,7 @@ using namespace Scintilla;
static void ClassifyWordSol(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord)
{
char s[100];
char s[100] = "";
bool wordIsNumber = isdigit(styler[start]) != 0;
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++)
{

View File

@@ -60,11 +60,7 @@ static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribut
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute);
static inline bool IsDelimiterCharacter(int ch);
static inline bool IsNumberStartCharacter(int ch);
static inline bool IsNumberCharacter(int ch);
static inline bool IsSeparatorOrDelimiterCharacter(int ch);
static inline bool IsWordStartCharacter(int ch);
static inline bool IsWordCharacter(int ch);
static void ColouriseComment(StyleContext& sc, bool&) {
sc.SetState(SCE_SPICE_COMMENTLINE);
@@ -205,27 +201,6 @@ static inline bool IsDelimiterCharacter(int ch) {
}
}
static inline bool IsNumberCharacter(int ch) {
return IsNumberStartCharacter(ch) ||
ch == '_' ||
ch == '.' ||
ch == '#' ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F');
}
static inline bool IsNumberStartCharacter(int ch) {
return IsADigit(ch);
}
static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
return IsASpace(ch) || IsDelimiterCharacter(ch);
}
static inline bool IsWordCharacter(int ch) {
return IsWordStartCharacter(ch) || IsADigit(ch);
}
static inline bool IsWordStartCharacter(int ch) {
return (isascii(ch) && isalpha(ch)) || ch == '_';
}

View File

@@ -30,7 +30,7 @@ using namespace Scintilla;
static bool IsAlphabetic(int ch) {
return isascii(ch) && isalpha(ch);
return IsASCII(ch) && isalpha(ch);
}
static inline bool AtEOL(Accessor &styler, unsigned int i) {
@@ -47,11 +47,6 @@ static bool IsBSeparator(char ch) {
return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == ' ') || (ch == '\t') || (ch == '[') || (ch == ']') || (ch == '\"') || (ch == '\'') || (ch == '/');
}
// Tests for Environment Variable symbol
static inline bool IsEnvironmentVar(char ch) {
return isalpha(ch) || isdigit(ch) || (ch == '_') || (ch == '$');
}
// Find length of CMD FOR variable with modifier (%~...) or return 0
static unsigned int GetBatchVarLen( char *wordBuffer )
{
@@ -112,7 +107,7 @@ static void ColouriseTCMDLine( char *lineBuffer, unsigned int lengthLine, unsign
// Examples are: cd. cd\ echo: echo. path=
bool inString = false; // Used for processing while ""
// Special Keyword Buffer used to determine if the first n characters is a Keyword
char sKeywordBuffer[260]; // Special Keyword Buffer
char sKeywordBuffer[260] = ""; // Special Keyword Buffer
bool sKeywordFound; // Exit Special Keyword for-loop if found
// Skip leading whitespace
@@ -445,7 +440,7 @@ static void FoldTCMDDoc(unsigned int startPos, int length, int, WordList *[], Ac
int level = styler.LevelAt(line);
int levelIndent = 0;
unsigned int endPos = startPos + length;
char s[16];
char s[16] = "";
char chPrev = styler.SafeGetCharAt(startPos - 1);

View File

@@ -51,7 +51,7 @@ static inline bool IsAWordStart(const int ch) {
}
/***************************************/
inline bool IsABlank(unsigned int ch) {
static inline bool IsABlank(unsigned int ch) {
return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ;
}

View File

@@ -7,6 +7,10 @@
// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
// The line state contains:
// In SCE_VISUALPROLOG_STRING_VERBATIM_EOL (i.e. multiline string literal): The closingQuote.
// else (for SCE_VISUALPROLOG_COMMENT_BLOCK): The comment nesting level
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -32,6 +36,7 @@
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "CharacterCategory.h"
#include "LexerModule.h"
#include "OptionSet.h"
@@ -144,15 +149,73 @@ struct After {
After(int line_) : line(line_) {}
};
static bool isLowerLetter(int ch){
return ccLl == CategoriseCharacter(ch);
}
static bool isUpperLetter(int ch){
return ccLu == CategoriseCharacter(ch);
}
static bool isAlphaNum(int ch){
CharacterCategory cc = CategoriseCharacter(ch);
return (ccLu == cc || ccLl == cc || ccLt == cc || ccLm == cc || ccLo == cc || ccNd == cc || ccNl == cc || ccNo == cc);
}
static bool isIdChar(int ch){
return ('_') == ch || isAlphaNum(ch);
}
static bool isOpenStringVerbatim(int next, int &closingQuote){
switch (next) {
case L'<':
closingQuote = L'>';
return true;
case L'>':
closingQuote = L'<';
return true;
case L'(':
closingQuote = L')';
return true;
case L')':
closingQuote = L'(';
return true;
case L'[':
closingQuote = L']';
return true;
case L']':
closingQuote = L'[';
return true;
case L'{':
closingQuote = L'}';
return true;
case L'}':
closingQuote = L'{';
return true;
case L'_':
case L'.':
case L',':
case L';':
return false;
default:
if (isAlphaNum(next)) {
return false;
} else {
closingQuote = next;
return true;
}
}
}
// Look ahead to see which colour "end" should have (takes colour after the following keyword)
static void endLookAhead(char s[], LexAccessor &styler, int start, CharacterSet &setIdentifier) {
static void endLookAhead(char s[], LexAccessor &styler, int start) {
char ch = styler.SafeGetCharAt(start, '\n');
while (' ' == ch) {
start++;
ch = styler.SafeGetCharAt(start, '\n');
}
int i = 0;
while (i < 100 && setIdentifier.Contains(ch)){
while (i < 100 && isLowerLetter(ch)){
s[i] = ch;
i++;
ch = styler.SafeGetCharAt(start + i, '\n');
@@ -160,11 +223,11 @@ static void endLookAhead(char s[], LexAccessor &styler, int start, CharacterSet
s[i] = '\0';
}
static void forwardEscapeLiteral(StyleContext &sc, int OwnChar, int EscapeState) {
static void forwardEscapeLiteral(StyleContext &sc, int EscapeState) {
sc.Forward();
if (sc.ch == OwnChar || sc.ch == '\\' || sc.ch == 'n' || sc.ch == 'l' || sc.ch == 'r' || sc.ch == 't') {
if (sc.Match('"') || sc.Match('\'') || sc.Match('\\') || sc.Match('n') || sc.Match('l') || sc.Match('r') || sc.Match('t')) {
sc.ChangeState(EscapeState);
} else if (sc.ch == 'u') {
} else if (sc.Match('u')) {
if (IsADigit(sc.chNext, 16)) {
sc.Forward();
if (IsADigit(sc.chNext, 16)) {
@@ -183,45 +246,26 @@ static void forwardEscapeLiteral(StyleContext &sc, int OwnChar, int EscapeState)
void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
LexAccessor styler(pAccess);
CharacterSet setDoxygen(CharacterSet::setAlpha, "");
CharacterSet setNumber(CharacterSet::setNone, "+-.0123456789abcdefABCDEFxoXO");
CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]");
CharacterSet setLowerStart(CharacterSet::setLower);
CharacterSet setVariableStart(CharacterSet::setUpper);
CharacterSet setIdentifier(CharacterSet::setAlphaNum, "_", 0x80, true);
StyleContext sc(startPos, length, initStyle, styler, 0x7f);
int styleBeforeDocKeyword = SCE_VISUALPROLOG_DEFAULT;
int currentLine = styler.GetLine(startPos);
int closingQuote = '"';
int nestLevel = 0;
if (currentLine >= 1)
{
nestLevel = styler.GetLineState(currentLine - 1);
closingQuote = nestLevel;
}
StyleContext sc(startPos, length, initStyle, styler, 0x7f);
// Truncate ppDefineHistory before current line
for (; sc.More(); sc.Forward()) {
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
styler.SetLineState(currentLine, nestLevel);
currentLine++;
}
if (sc.atLineStart) {
if ((sc.state == SCE_VISUALPROLOG_STRING) || (sc.state == SCE_VISUALPROLOG_CHARACTER)) {
// Prevent SCE_VISUALPROLOG_STRING_EOL from leaking back to previous line which
// ends with a line continuation by locking in the state upto this position.
sc.SetState(sc.state);
}
}
const bool atLineEndBeforeSwitch = sc.atLineEnd;
// Determine if the current state should terminate.
switch (sc.state) {
case SCE_VISUALPROLOG_OPERATOR:
@@ -229,16 +273,16 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
break;
case SCE_VISUALPROLOG_NUMBER:
// We accept almost anything because of hex. and number suffixes
if (!(setIdentifier.Contains(sc.ch) || (sc.ch == '.') || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) {
if (!(setNumber.Contains(sc.ch))) {
sc.SetState(SCE_VISUALPROLOG_DEFAULT);
}
break;
case SCE_VISUALPROLOG_IDENTIFIER:
if (!setIdentifier.Contains(sc.ch)) {
if (!isIdChar(sc.ch)) {
char s[1000];
sc.GetCurrent(s, sizeof(s));
if (0 == strcmp(s, "end")) {
endLookAhead(s, styler, sc.currentPos, setIdentifier);
endLookAhead(s, styler, sc.currentPos);
}
if (majorKeywords.InList(s)) {
sc.ChangeState(SCE_VISUALPROLOG_KEY_MAJOR);
@@ -250,12 +294,12 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
break;
case SCE_VISUALPROLOG_VARIABLE:
case SCE_VISUALPROLOG_ANONYMOUS:
if (!setIdentifier.Contains(sc.ch)) {
if (!isIdChar(sc.ch)) {
sc.SetState(SCE_VISUALPROLOG_DEFAULT);
}
break;
case SCE_VISUALPROLOG_KEY_DIRECTIVE:
if (!setLowerStart.Contains(sc.ch)) {
if (!isLowerLetter(sc.ch)) {
char s[1000];
sc.GetCurrent(s, sizeof(s));
if (!directiveKeywords.InList(s+1)) {
@@ -273,9 +317,7 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
} else if (sc.Match('/', '*')) {
sc.Forward();
nestLevel++;
} else if (sc.ch == '%') {
sc.SetState(SCE_VISUALPROLOG_COMMENT_LINE);
} else if (sc.ch == '@') {
} else if (sc.Match('@')) {
styleBeforeDocKeyword = sc.state;
sc.SetState(SCE_VISUALPROLOG_COMMENT_KEY_ERROR);
}
@@ -284,24 +326,34 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
if (sc.atLineEnd) {
int nextState = (nestLevel == 0) ? SCE_VISUALPROLOG_DEFAULT : SCE_VISUALPROLOG_COMMENT_BLOCK;
sc.SetState(nextState);
} else if (sc.ch == '@') {
} else if (sc.Match('@')) {
styleBeforeDocKeyword = sc.state;
sc.SetState(SCE_VISUALPROLOG_COMMENT_KEY_ERROR);
}
break;
case SCE_VISUALPROLOG_COMMENT_KEY_ERROR:
if (!setDoxygen.Contains(sc.ch)) {
if (!setDoxygen.Contains(sc.ch) || sc.atLineEnd) {
char s[1000];
sc.GetCurrent(s, sizeof(s));
if (docKeywords.InList(s+1)) {
sc.ChangeState(SCE_VISUALPROLOG_COMMENT_KEY);
}
if (SCE_VISUALPROLOG_COMMENT_LINE == styleBeforeDocKeyword && sc.atLineEnd) {
// end line comment
int nextState = (nestLevel == 0) ? SCE_VISUALPROLOG_DEFAULT : SCE_VISUALPROLOG_COMMENT_BLOCK;
sc.SetState(nextState);
} else {
sc.SetState(styleBeforeDocKeyword);
}
if (SCE_VISUALPROLOG_COMMENT_LINE == styleBeforeDocKeyword && sc.atLineStart) {
if (SCE_VISUALPROLOG_COMMENT_BLOCK == styleBeforeDocKeyword && sc.Match('*', '/')) {
// we have consumed the '*' if it comes immediately after the docKeyword
sc.Forward();
sc.Forward();
nestLevel--;
if (0 == nestLevel) {
sc.SetState(SCE_VISUALPROLOG_DEFAULT);
} else if (SCE_VISUALPROLOG_COMMENT_BLOCK == styleBeforeDocKeyword && sc.atLineStart) {
sc.SetState(SCE_VISUALPROLOG_COMMENT_BLOCK);
}
}
}
}
break;
case SCE_VISUALPROLOG_STRING_ESCAPE:
@@ -311,38 +363,11 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
case SCE_VISUALPROLOG_STRING:
if (sc.atLineEnd) {
sc.SetState(SCE_VISUALPROLOG_STRING_EOL_OPEN);
} else if (sc.ch == '"') {
} else if (sc.Match(closingQuote)) {
sc.ForwardSetState(SCE_VISUALPROLOG_DEFAULT);
} else if (sc.ch == '\\') {
} else if (sc.Match('\\')) {
sc.SetState(SCE_VISUALPROLOG_STRING_ESCAPE_ERROR);
forwardEscapeLiteral(sc, '"', SCE_VISUALPROLOG_STRING_ESCAPE);
}
break;
case SCE_VISUALPROLOG_CHARACTER_TOO_MANY:
if (sc.atLineStart) {
sc.SetState(SCE_VISUALPROLOG_DEFAULT);
} else if (sc.ch == '\'') {
sc.SetState(SCE_VISUALPROLOG_CHARACTER);
sc.ForwardSetState(SCE_VISUALPROLOG_DEFAULT);
}
break;
case SCE_VISUALPROLOG_CHARACTER:
if (sc.atLineEnd) {
sc.SetState(SCE_VISUALPROLOG_STRING_EOL_OPEN); // reuse STRING_EOL_OPEN for this
} else if (sc.ch == '\'') {
sc.SetState(SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR);
sc.ForwardSetState(SCE_VISUALPROLOG_DEFAULT);
} else {
if (sc.ch == '\\') {
sc.SetState(SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR);
forwardEscapeLiteral(sc, '\'', SCE_VISUALPROLOG_CHARACTER);
}
sc.ForwardSetState(SCE_VISUALPROLOG_CHARACTER);
if (sc.ch == '\'') {
sc.ForwardSetState(SCE_VISUALPROLOG_DEFAULT);
} else {
sc.SetState(SCE_VISUALPROLOG_CHARACTER_TOO_MANY);
}
forwardEscapeLiteral(sc, SCE_VISUALPROLOG_STRING_ESCAPE);
}
break;
case SCE_VISUALPROLOG_STRING_EOL_OPEN:
@@ -357,8 +382,8 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
case SCE_VISUALPROLOG_STRING_VERBATIM:
if (sc.atLineEnd) {
sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM_EOL);
} else if (sc.ch == '\"') {
if (sc.chNext == '\"') {
} else if (sc.Match(closingQuote)) {
if (closingQuote == sc.chNext) {
sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL);
sc.Forward();
} else {
@@ -368,37 +393,46 @@ void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int in
break;
}
if (sc.atLineEnd && !atLineEndBeforeSwitch) {
// State exit processing consumed characters up to end of line.
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) {
lineState = closingQuote;
} else if (SCE_VISUALPROLOG_COMMENT_BLOCK == sc.state) {
lineState = nestLevel;
}
styler.SetLineState(currentLine, lineState);
currentLine++;
}
// Determine if a new state should be entered.
if (sc.state == SCE_VISUALPROLOG_DEFAULT) {
if (sc.Match('@', '\"')) {
if (sc.Match('@') && isOpenStringVerbatim(sc.chNext, closingQuote)) {
sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM);
sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
} else if (IsADigit(sc.ch) || (sc.Match('.') && IsADigit(sc.chNext))) {
sc.SetState(SCE_VISUALPROLOG_NUMBER);
} else if (setLowerStart.Contains(sc.ch)) {
} else if (isLowerLetter(sc.ch)) {
sc.SetState(SCE_VISUALPROLOG_IDENTIFIER);
} else if (setVariableStart.Contains(sc.ch)) {
} else if (isUpperLetter(sc.ch)) {
sc.SetState(SCE_VISUALPROLOG_VARIABLE);
} else if (sc.ch == '_') {
} else if (sc.Match('_')) {
sc.SetState(SCE_VISUALPROLOG_ANONYMOUS);
} else if (sc.Match('/', '*')) {
sc.SetState(SCE_VISUALPROLOG_COMMENT_BLOCK);
nestLevel = 1;
sc.Forward(); // Eat the * so it isn't used for the end of the comment
} else if (sc.ch == '%') {
} else if (sc.Match('%')) {
sc.SetState(SCE_VISUALPROLOG_COMMENT_LINE);
} else if (sc.ch == '\"') {
} else if (sc.Match('\'')) {
closingQuote = '\'';
sc.SetState(SCE_VISUALPROLOG_STRING);
} else if (sc.ch == '\'') {
sc.SetState(SCE_VISUALPROLOG_CHARACTER);
} else if (sc.ch == '#') {
} else if (sc.Match('"')) {
closingQuote = '"';
sc.SetState(SCE_VISUALPROLOG_STRING);
} else if (sc.Match('#')) {
sc.SetState(SCE_VISUALPROLOG_KEY_DIRECTIVE);
} else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '\\') {
} else if (isoperator(static_cast<char>(sc.ch)) || sc.Match('\\')) {
sc.SetState(SCE_VISUALPROLOG_OPERATOR);
}
}

View File

@@ -150,7 +150,7 @@ static void ColouriseYAMLLine(
} else {
unsigned int i2 = i;
while ((i < lengthLine) && lineBuffer[i]) {
if (!(isascii(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') {
if (!(IsASCII(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') {
styler.ColourTo(endPos, SCE_YAML_DEFAULT);
return;
}
@@ -169,7 +169,7 @@ static void ColouriseYAMLLine(
}
static void ColouriseYAMLDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) {
char lineBuffer[1024];
char lineBuffer[1024] = "";
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;

View File

@@ -60,37 +60,39 @@ OBJECTS=LexA68k.obj,LexAbaqus.obj,LexAda.obj,LexAPDL.obj,LexAsm.obj,\
LexCPP.obj,LexCrontab.obj,LexCsound.obj,LexCSS.obj,LexD.obj,\
LexECL.obj,LexEiffel.obj,LexErlang.obj,LexEScript.obj,LexFlagship.obj,\
LexForth.obj,LexFortran.obj,LexGAP.obj,LexGui4Cli.obj,LexHaskell.obj,\
LexHTML.obj,LexInno.obj,LexKix.obj,LexLisp.obj,LexLout.obj,LexLua.obj,\
LexMagik.obj,LexMarkdown.obj,LexMatlab.obj,LexMetapost.obj
LexHTML.obj,LexInno.obj,LexKix.obj,LexKVIrc.obj,LexLaTeX.obj,LexLisp.obj,\
LexLout.obj,LexLua.obj,LexMagik.obj,LexMarkdown.obj,LexMatlab.obj,\
LexMetapost.obj
OBJECTS1=LexMMIXAL.obj,LexModula.obj,LexMPT.obj,LexMSSQL.obj,LexMySQL.obj,\
LexNimrod.obj,LexNsis.obj,LexOpal.obj,LexOScript.obj,LexOthers.obj,\
LexPascal.obj,LexPB.obj,LexPerl.obj,LexPLM.obj,LexPOV.obj,\
LexPascal.obj,LexPB.obj,LexPerl.obj,LexPLM.obj,LexPO.obj,LexPOV.obj,\
LexPowerPro.obj,LexPowerShell.obj,LexProgress.obj,LexPS.obj,\
LexPython.obj,LexR.obj,LexRebol.obj,LexRuby.obj,LexScriptol.obj,\
LexSmalltalk.obj,LexSML.obj,LexSorcus.obj,LexSpecman.obj,LexSpice.obj,\
LexSQL.obj,LexTACL.obj,LexTADS3.obj,LexTAL.obj,LexTCL.obj,LexTCMD.obj,\
LexTeX.obj,LexTxt2tags.obj,LexVB.obj,LexVerilog.obj,LexVHDL.obj,\
LexVisualProlog.obj,LexYAML.obj
LexPython.obj,LexR.obj,LexRebol.obj,LexRuby.obj,LexRust.obj,\
LexScriptol.obj,LexSmalltalk.obj,LexSML.obj,LexSorcus.obj,LexSpecman.obj,\
LexSpice.obj,LexSQL.obj,LexSTTXT.obj,LexTACL.obj,LexTADS3.obj,LexTAL.obj,\
LexTCL.obj,LexTCMD.obj,LexTeX.obj,LexTxt2tags.obj,LexVB.obj,\
LexVerilog.obj,LexVHDL.obj,LexVisualProlog.obj,LexYAML.obj
SOURCES=LexA68k.cxx,LexAbaqus.cxx,LexAda.cxx,LexAPDL.cxx,LexAsm.cxx,\
LexAsn1.cxx,LexASY.cxx,LexAU3.cxx,LexAVE.cxx,LexAVS.cxx,LexBaan.cxx,\
LexBash.cxx,LexBasic.cxx,LexBullant.cxx,LexCaml.cxx,LexCLW.cxx,\
LexCmake.cxx,LexCOBOL.cxx,LexCoffeeScript.cxx,LexConf.cxx,\
LexCPP.cxx,LexCrontab.cxx,LexCsound.cxx,LexCSS.cxx,LexD.cxx,\
LexCPP.cxx,LexCrontab.cxx,LexCsound.cxx,LexCSS.cxx,LexD.cxx,LexDMAP.cxx,\
LexECL.cxx,LexEiffel.cxx,LexErlang.cxx,LexEScript.cxx,LexFlagship.cxx,\
LexForth.cxx,LexFortran.cxx,LexGAP.cxx,LexGui4Cli.cxx,LexHaskell.cxx,\
LexHTML.cxx,LexInno.cxx,LexKix.cxx,LexLisp.cxx,LexLout.cxx,LexLua.cxx,\
LexMagik.cxx,LexMarkdown.cxx,LexMatlab.cxx,LexMetapost.cxx,\
LexHTML.cxx,LexInno.cxx,LexKix.cxx,LexKVIrc.cxx,LexLaTeX.cxx,LexLisp.cxx,\
LexLout.cxx,LexLua.cxx,LexMagik.cxx,LexMarkdown.cxx,LexMatlab.cxx,\
LexMetapost.cxx,\
LexMMIXAL.cxx,LexModula.cxx,LexMPT.cxx,LexMSSQL.cxx,LexMySQL.cxx,\
LexNimrod.cxx,LexNsis.cxx,LexOpal.cxx,LexOScript.cxx,LexOthers.cxx,\
LexPascal.cxx,LexPB.cxx,LexPerl.cxx,LexPLM.cxx,LexPOV.cxx,\
LexPascal.cxx,LexPB.cxx,LexPerl.cxx,LexPLM.cxx,LexPO.cxx,LexPOV.cxx,\
LexPowerPro.cxx,LexPowerShell.cxx,LexProgress.cxx,LexPS.cxx,\
LexPython.cxx,LexR.cxx,LexRebol.cxx,LexRuby.cxx,LexScriptol.cxx,\
LexSmalltalk.cxx,LexSML.cxx,LexSorcus.cxx,LexSpecman.cxx,LexSpice.cxx,\
LexSQL.cxx,LexTACL.cxx,LexTADS3.cxx,LexTAL.cxx,LexTCL.cxx,LexTCMD.cxx,\
LexTeX.cxx,LexTxt2tags.cxx,LexVB.cxx,LexVerilog.cxx,LexVHDL.cxx,\
LexVisualProlog.cxx,LexYAML.cxx
LexPython.cxx,LexR.cxx,LexRebol.cxx,LexRuby.cxx,LexRust.cxx,\
LexScriptol.cxx,LexSmalltalk.cxx,LexSML.cxx,LexSorcus.cxx,LexSpecman.cxx,\
LexSpice.cxx,LexSQL.cxx,LexSTTXT.cxx,LexTACL.cxx,LexTADS3.cxx,LexTAL.cxx,\
LexTCL.cxx,LexTCMD.cxx,LexTeX.cxx,LexTxt2tags.cxx,LexVB.cxx,\
LexVerilog.cxx,LexVHDL.cxx,LexVisualProlog.cxx,LexYAML.cxx
all : $(SOURCES)
$(MMS)$(MMSQUALIFIERS) $(OBJECTS)
@@ -147,6 +149,7 @@ LexCrontab.obj : LexCrontab.cxx
LexCsound.obj : LexCsound.cxx
LexCSS.obj : LexCSS.cxx
LexD.obj : LexD.cxx
LexDMAP.obj : LexDMAP.cxx
LexECL.obj : LexECL.cxx
LexEiffel.obj : LexEiffel.cxx
LexErlang.obj : LexErlang.cxx
@@ -160,6 +163,8 @@ LexHaskell.obj : LexHaskell.cxx
LexHTML.obj : LexHTML.cxx
LexInno.obj : LexInno.cxx
LexKix.obj : LexKix.cxx
LexKVIrc.obj : LexKVIrc.cxx
LexLaTeX.obj : LexLaTeX.cxx
LexLisp.obj : LexLisp.cxx
LexLout.obj : LexLout.cxx
LexLua.obj : LexLua.cxx
@@ -181,6 +186,7 @@ LexPascal.obj : LexPascal.cxx
LexPB.obj : LexPB.cxx
LexPerl.obj : LexPerl.cxx
LexPLM.obj : LexPLM.cxx
LexPO.obj : LexPO.cxx
LexPOV.obj : LexPOV.cxx
LexPowerPro.obj : LexPowerPro.cxx
LexPowerShell.obj : LexPowerShell.cxx
@@ -190,6 +196,7 @@ LexPython.obj : LexPython.cxx
LexR.obj : LexR.cxx
LexRebol.obj : LexRebol.cxx
LexRuby.obj : LexRuby.cxx
LexRust.obj : LexRust.cxx
LexScriptol.obj : LexScriptol.cxx
LexSmalltalk.obj : LexSmalltalk.cxx
LexSML.obj : LexSML.cxx
@@ -197,6 +204,7 @@ LexSorcus.obj : LexSorcus.cxx
LexSpecman.obj : LexSpecman.cxx
LexSpice.obj : LexSpice.cxx
LexSQL.obj : LexSQL.cxx
LexSTTXT.obj : LexSTTXT.cxx
LexTACL.obj : LexTACL.cxx
LexTADS3.obj : LexTADS3.cxx
LexTAL.obj : LexTAL.cxx

View File

@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
@@ -28,7 +28,7 @@ using namespace Scintilla;
Accessor::Accessor(IDocument *pAccess_, PropSetSimple *pprops_) : LexAccessor(pAccess_), pprops(pprops_) {
}
int Accessor::GetPropertyInt(const char *key, int defaultValue) {
int Accessor::GetPropertyInt(const char *key, int defaultValue) const {
return pprops->GetInt(key, defaultValue);
}

View File

@@ -24,7 +24,7 @@ class Accessor : public LexAccessor {
public:
PropSetSimple *pprops;
Accessor(IDocument *pAccess_, PropSetSimple *pprops_);
int GetPropertyInt(const char *, int defaultValue=0);
int GetPropertyInt(const char *, int defaultValue=0) const;
int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
// Scintilla source code edit control
/** @file CharacterCategory.h
** Returns the Unicode general category of a character.
**/
// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CHARACTERCATEGORY_H
#define CHARACTERCATEGORY_H
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
enum CharacterCategory {
ccLu, ccLl, ccLt, ccLm, ccLo,
ccMn, ccMc, ccMe,
ccNd, ccNl, ccNo,
ccPc, ccPd, ccPs, ccPe, ccPi, ccPf, ccPo,
ccSm, ccSc, ccSk, ccSo,
ccZs, ccZl, ccZp,
ccCc, ccCf, ccCs, ccCo, ccCn
};
CharacterCategory CategoriseCharacter(int character);
#ifdef SCI_NAMESPACE
}
#endif
#endif

View File

@@ -8,8 +8,8 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <ctype.h>
#include <assert.h>
#include "CharacterSet.h"

View File

@@ -12,6 +12,8 @@
namespace Scintilla {
#endif
enum EncodingType { enc8bit, encUnicode, encDBCS };
class LexAccessor {
private:
IDocument *pAccess;
@@ -25,6 +27,7 @@ private:
int startPos;
int endPos;
int codePage;
enum EncodingType encodingType;
int lenDoc;
int mask;
char styleBuf[bufferSize];
@@ -33,6 +36,7 @@ private:
char chWhile;
unsigned int startSeg;
int startPosStyling;
int documentVersion;
void Fill(int position) {
startPos = position - slopSize;
@@ -49,11 +53,25 @@ private:
}
public:
LexAccessor(IDocument *pAccess_) :
explicit LexAccessor(IDocument *pAccess_) :
pAccess(pAccess_), startPos(extremePosition), endPos(0),
codePage(pAccess->CodePage()), lenDoc(pAccess->Length()),
codePage(pAccess->CodePage()),
encodingType(enc8bit),
lenDoc(pAccess->Length()),
mask(127), validLen(0), chFlags(0), chWhile(0),
startSeg(0), startPosStyling(0) {
startSeg(0), startPosStyling(0),
documentVersion(pAccess->Version()) {
switch (codePage) {
case 65001:
encodingType = encUnicode;
break;
case 932:
case 936:
case 949:
case 950:
case 1361:
encodingType = encDBCS;
}
}
char operator[](int position) {
if (position < startPos || position >= endPos) {
@@ -61,6 +79,12 @@ public:
}
return buf[position - startPos];
}
IDocumentWithLineEnd *MultiByteAccess() const {
if (documentVersion >= dvLineEnd) {
return static_cast<IDocumentWithLineEnd *>(pAccess);
}
return 0;
}
/** Safe version of operator[], returning a defined value for invalid position. */
char SafeGetCharAt(int position, char chDefault=' ') {
if (position < startPos || position >= endPos) {
@@ -72,10 +96,12 @@ public:
}
return buf[position - startPos];
}
bool IsLeadByte(char ch) {
bool IsLeadByte(char ch) const {
return pAccess->IsDBCSLeadByte(ch);
}
EncodingType Encoding() const {
return encodingType;
}
bool Match(int pos, const char *s) {
for (int i=0; *s; i++) {
if (*s != SafeGetCharAt(pos+i))
@@ -84,30 +110,42 @@ public:
}
return true;
}
char StyleAt(int position) {
char StyleAt(int position) const {
return static_cast<char>(pAccess->StyleAt(position) & mask);
}
int GetLine(int position) {
int GetLine(int position) const {
return pAccess->LineFromPosition(position);
}
int LineStart(int line) {
int LineStart(int line) const {
return pAccess->LineStart(line);
}
int LevelAt(int line) {
int LineEnd(int line) {
if (documentVersion >= dvLineEnd) {
return (static_cast<IDocumentWithLineEnd *>(pAccess))->LineEnd(line);
} else {
// Old interface means only '\r', '\n' and '\r\n' line ends.
int startNext = pAccess->LineStart(line+1);
char chLineEnd = SafeGetCharAt(startNext-1);
if (chLineEnd == '\n' && (SafeGetCharAt(startNext-2) == '\r'))
return startNext - 2;
else
return startNext - 1;
}
}
int LevelAt(int line) const {
return pAccess->GetLevel(line);
}
int Length() const {
return lenDoc;
}
void Flush() {
startPos = extremePosition;
if (validLen > 0) {
pAccess->SetStyles(validLen, styleBuf);
startPosStyling += validLen;
validLen = 0;
}
}
int GetLineState(int line) {
int GetLineState(int line) const {
return pAccess->GetLineState(line);
}
int SetLineState(int line, int state) {

View File

@@ -1,5 +1,5 @@
// Scintilla source code edit control
/** @file LexerSimple.cxx
/** @file LexerBase.cxx
** A simple lexer with no state.
**/
// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"

View File

@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <string>
@@ -74,11 +74,9 @@ int LexerModule::GetNumWordLists() const {
}
const char *LexerModule::GetWordListDescription(int index) const {
static const char *emptyStr = "";
assert(index < GetNumWordLists());
if (index >= GetNumWordLists()) {
return emptyStr;
if (!wordListDescriptions || (index >= GetNumWordLists())) {
return "";
} else {
return wordListDescriptions[index];
}

View File

@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"

View File

@@ -5,8 +5,8 @@
// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef LexerNoExceptions_H
#define LexerNoExceptions_H
#ifndef LEXERNOEXCEPTIONS_H
#define LEXERNOEXCEPTIONS_H
#ifdef SCI_NAMESPACE
namespace Scintilla {

View File

@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <string>

View File

@@ -17,7 +17,7 @@ class LexerSimple : public LexerBase {
const LexerModule *module;
std::string wordLists;
public:
LexerSimple(const LexerModule *module_);
explicit LexerSimple(const LexerModule *module_);
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);

View File

@@ -40,7 +40,7 @@ class OptionSet {
Option(plcos ps_, std::string description_) :
opType(SC_TYPE_STRING), ps(ps_), description(description_) {
}
bool Set(T *base, const char *val) {
bool Set(T *base, const char *val) const {
switch (opType) {
case SC_TYPE_BOOLEAN: {
bool option = atoi(val) != 0;
@@ -94,7 +94,7 @@ public:
nameToDef[name] = Option(ps, description);
AppendName(name);
}
const char *PropertyNames() {
const char *PropertyNames() const {
return names.c_str();
}
int PropertyType(const char *name) {
@@ -130,7 +130,7 @@ public:
}
}
const char *DescribeWordListSets() {
const char *DescribeWordListSets() const {
return wordLists.c_str();
}
};

Some files were not shown because too many files have changed in this diff Show More