Update Scintilla to version 1.75
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c95e653ca4
commit
7e0c58e92c
44
Makefile.in
44
Makefile.in
@ -215,6 +215,7 @@ WXSCINTILLA_OBJECTS = \
|
||||
wxscintilla_CellBuffer.o \
|
||||
wxscintilla_CharClassify.o \
|
||||
wxscintilla_ContractionState.o \
|
||||
wxscintilla_Decoration.o \
|
||||
wxscintilla_Document.o \
|
||||
wxscintilla_DocumentAccessor.o \
|
||||
wxscintilla_Editor.o \
|
||||
@ -224,7 +225,9 @@ WXSCINTILLA_OBJECTS = \
|
||||
wxscintilla_KeyWords.o \
|
||||
wxscintilla_LexAPDL.o \
|
||||
wxscintilla_LexAU3.o \
|
||||
wxscintilla_LexASY.o \
|
||||
wxscintilla_LexAVE.o \
|
||||
wxscintilla_LexAbaqus.o \
|
||||
wxscintilla_LexAda.o \
|
||||
wxscintilla_LexAsm.o \
|
||||
wxscintilla_LexAsn1.o \
|
||||
@ -233,18 +236,21 @@ WXSCINTILLA_OBJECTS = \
|
||||
wxscintilla_LexBasic.o \
|
||||
wxscintilla_LexBullant.o \
|
||||
wxscintilla_LexCLW.o \
|
||||
wxscintilla_LexCmake.o \
|
||||
wxscintilla_LexCPP.o \
|
||||
wxscintilla_LexCSS.o \
|
||||
wxscintilla_LexCaml.o \
|
||||
wxscintilla_LexCsound.o \
|
||||
wxscintilla_LexConf.o \
|
||||
wxscintilla_LexCrontab.o \
|
||||
wxscintilla_LexD.o \
|
||||
wxscintilla_LexEScript.o \
|
||||
wxscintilla_LexEiffel.o \
|
||||
wxscintilla_LexErlang.o \
|
||||
wxscintilla_LexFlagship.o \
|
||||
wxscintilla_LexForth.o \
|
||||
wxscintilla_LexFortran.o \
|
||||
wxscintilla_LexGAP.o \
|
||||
wxscintilla_LexGui4Cli.o \
|
||||
wxscintilla_LexHTML.o \
|
||||
wxscintilla_LexHaskell.o \
|
||||
@ -262,11 +268,14 @@ WXSCINTILLA_OBJECTS = \
|
||||
wxscintilla_LexOpal.o \
|
||||
wxscintilla_LexOthers.o \
|
||||
wxscintilla_LexPB.o \
|
||||
wxscintilla_LexPLM.o \
|
||||
wxscintilla_LexPOV.o \
|
||||
wxscintilla_LexProgress.o \
|
||||
wxscintilla_LexPS.o \
|
||||
wxscintilla_LexPascal.o \
|
||||
wxscintilla_LexPerl.o \
|
||||
wxscintilla_LexPython.o \
|
||||
wxscintilla_LexR.o \
|
||||
wxscintilla_LexRebol.o \
|
||||
wxscintilla_LexRuby.o \
|
||||
wxscintilla_LexSQL.o \
|
||||
@ -282,8 +291,10 @@ WXSCINTILLA_OBJECTS = \
|
||||
wxscintilla_LexVerilog.o \
|
||||
wxscintilla_LexYAML.o \
|
||||
wxscintilla_LineMarker.o \
|
||||
wxscintilla_PositionCache.o \
|
||||
wxscintilla_PropSet.o \
|
||||
wxscintilla_RESearch.o \
|
||||
wxscintilla_RunStyles.o \
|
||||
wxscintilla_ScintillaBase.o \
|
||||
wxscintilla_Style.o \
|
||||
wxscintilla_StyleContext.o \
|
||||
@ -13235,6 +13246,9 @@ wxscintilla_CharClassify.o: $(srcdir)/src/stc/scintilla/src/CharClassify.cxx
|
||||
wxscintilla_ContractionState.o: $(srcdir)/src/stc/scintilla/src/ContractionState.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/ContractionState.cxx
|
||||
|
||||
wxscintilla_Decoration.o: $(srcdir)/src/stc/scintilla/src/Decoration.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/Decoration.cxx
|
||||
|
||||
wxscintilla_Document.o: $(srcdir)/src/stc/scintilla/src/Document.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/Document.cxx
|
||||
|
||||
@ -13262,9 +13276,15 @@ wxscintilla_LexAPDL.o: $(srcdir)/src/stc/scintilla/src/LexAPDL.cxx
|
||||
wxscintilla_LexAU3.o: $(srcdir)/src/stc/scintilla/src/LexAU3.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexAU3.cxx
|
||||
|
||||
wxscintilla_LexASY.o: $(srcdir)/src/stc/scintilla/src/LexASY.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexASY.cxx
|
||||
|
||||
wxscintilla_LexAVE.o: $(srcdir)/src/stc/scintilla/src/LexAVE.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexAVE.cxx
|
||||
|
||||
wxscintilla_LexAbaqus.o: $(srcdir)/src/stc/scintilla/src/LexAbaqus.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexAbaqus.cxx
|
||||
|
||||
wxscintilla_LexAda.o: $(srcdir)/src/stc/scintilla/src/LexAda.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexAda.cxx
|
||||
|
||||
@ -13289,6 +13309,9 @@ wxscintilla_LexBullant.o: $(srcdir)/src/stc/scintilla/src/LexBullant.cxx
|
||||
wxscintilla_LexCLW.o: $(srcdir)/src/stc/scintilla/src/LexCLW.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexCLW.cxx
|
||||
|
||||
wxscintilla_LexCmake.o: $(srcdir)/src/stc/scintilla/src/LexCmake.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexCmake.cxx
|
||||
|
||||
wxscintilla_LexCPP.o: $(srcdir)/src/stc/scintilla/src/LexCPP.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexCPP.cxx
|
||||
|
||||
@ -13307,6 +13330,9 @@ wxscintilla_LexConf.o: $(srcdir)/src/stc/scintilla/src/LexConf.cxx
|
||||
wxscintilla_LexCrontab.o: $(srcdir)/src/stc/scintilla/src/LexCrontab.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexCrontab.cxx
|
||||
|
||||
wxscintilla_LexD.o: $(srcdir)/src/stc/scintilla/src/LexD.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexD.cxx
|
||||
|
||||
wxscintilla_LexEScript.o: $(srcdir)/src/stc/scintilla/src/LexEScript.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexEScript.cxx
|
||||
|
||||
@ -13325,6 +13351,9 @@ wxscintilla_LexForth.o: $(srcdir)/src/stc/scintilla/src/LexForth.cxx
|
||||
wxscintilla_LexFortran.o: $(srcdir)/src/stc/scintilla/src/LexFortran.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexFortran.cxx
|
||||
|
||||
wxscintilla_LexGAP.o: $(srcdir)/src/stc/scintilla/src/LexGAP.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexGAP.cxx
|
||||
|
||||
wxscintilla_LexGui4Cli.o: $(srcdir)/src/stc/scintilla/src/LexGui4Cli.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexGui4Cli.cxx
|
||||
|
||||
@ -13376,9 +13405,15 @@ wxscintilla_LexOthers.o: $(srcdir)/src/stc/scintilla/src/LexOthers.cxx
|
||||
wxscintilla_LexPB.o: $(srcdir)/src/stc/scintilla/src/LexPB.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexPB.cxx
|
||||
|
||||
wxscintilla_LexPLM.o: $(srcdir)/src/stc/scintilla/src/LexPLM.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexPLM.cxx
|
||||
|
||||
wxscintilla_LexPOV.o: $(srcdir)/src/stc/scintilla/src/LexPOV.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexPOV.cxx
|
||||
|
||||
wxscintilla_LexProgress.o: $(srcdir)/src/stc/scintilla/src/LexProgress.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexProgress.cxx
|
||||
|
||||
wxscintilla_LexPS.o: $(srcdir)/src/stc/scintilla/src/LexPS.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexPS.cxx
|
||||
|
||||
@ -13391,6 +13426,9 @@ wxscintilla_LexPerl.o: $(srcdir)/src/stc/scintilla/src/LexPerl.cxx
|
||||
wxscintilla_LexPython.o: $(srcdir)/src/stc/scintilla/src/LexPython.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexPython.cxx
|
||||
|
||||
wxscintilla_LexR.o: $(srcdir)/src/stc/scintilla/src/LexR.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexR.cxx
|
||||
|
||||
wxscintilla_LexRebol.o: $(srcdir)/src/stc/scintilla/src/LexRebol.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LexRebol.cxx
|
||||
|
||||
@ -13436,12 +13474,18 @@ wxscintilla_LexYAML.o: $(srcdir)/src/stc/scintilla/src/LexYAML.cxx
|
||||
wxscintilla_LineMarker.o: $(srcdir)/src/stc/scintilla/src/LineMarker.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/LineMarker.cxx
|
||||
|
||||
wxscintilla_PositionCache.o: $(srcdir)/src/stc/scintilla/src/PositionCache.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/PositionCache.cxx
|
||||
|
||||
wxscintilla_PropSet.o: $(srcdir)/src/stc/scintilla/src/PropSet.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/PropSet.cxx
|
||||
|
||||
wxscintilla_RESearch.o: $(srcdir)/src/stc/scintilla/src/RESearch.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/RESearch.cxx
|
||||
|
||||
wxscintilla_RunStyles.o: $(srcdir)/src/stc/scintilla/src/RunStyles.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/RunStyles.cxx
|
||||
|
||||
wxscintilla_ScintillaBase.o: $(srcdir)/src/stc/scintilla/src/ScintillaBase.cxx
|
||||
$(CXXC) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(srcdir)/src/stc/scintilla/src/ScintillaBase.cxx
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
src/stc/scintilla/src/CellBuffer.cxx
|
||||
src/stc/scintilla/src/CharClassify.cxx
|
||||
src/stc/scintilla/src/ContractionState.cxx
|
||||
src/stc/scintilla/src/Decoration.cxx
|
||||
src/stc/scintilla/src/Document.cxx
|
||||
src/stc/scintilla/src/DocumentAccessor.cxx
|
||||
src/stc/scintilla/src/Editor.cxx
|
||||
@ -38,7 +39,9 @@
|
||||
src/stc/scintilla/src/KeyWords.cxx
|
||||
src/stc/scintilla/src/LexAPDL.cxx
|
||||
src/stc/scintilla/src/LexAU3.cxx
|
||||
src/stc/scintilla/src/LexASY.cxx
|
||||
src/stc/scintilla/src/LexAVE.cxx
|
||||
src/stc/scintilla/src/LexAbaqus.cxx
|
||||
src/stc/scintilla/src/LexAda.cxx
|
||||
src/stc/scintilla/src/LexAsm.cxx
|
||||
src/stc/scintilla/src/LexAsn1.cxx
|
||||
@ -47,18 +50,21 @@
|
||||
src/stc/scintilla/src/LexBasic.cxx
|
||||
src/stc/scintilla/src/LexBullant.cxx
|
||||
src/stc/scintilla/src/LexCLW.cxx
|
||||
src/stc/scintilla/src/LexCmake.cxx
|
||||
src/stc/scintilla/src/LexCPP.cxx
|
||||
src/stc/scintilla/src/LexCSS.cxx
|
||||
src/stc/scintilla/src/LexCaml.cxx
|
||||
src/stc/scintilla/src/LexCsound.cxx
|
||||
src/stc/scintilla/src/LexConf.cxx
|
||||
src/stc/scintilla/src/LexCrontab.cxx
|
||||
src/stc/scintilla/src/LexD.cxx
|
||||
src/stc/scintilla/src/LexEScript.cxx
|
||||
src/stc/scintilla/src/LexEiffel.cxx
|
||||
src/stc/scintilla/src/LexErlang.cxx
|
||||
src/stc/scintilla/src/LexFlagship.cxx
|
||||
src/stc/scintilla/src/LexForth.cxx
|
||||
src/stc/scintilla/src/LexFortran.cxx
|
||||
src/stc/scintilla/src/LexGAP.cxx
|
||||
src/stc/scintilla/src/LexGui4Cli.cxx
|
||||
src/stc/scintilla/src/LexHTML.cxx
|
||||
src/stc/scintilla/src/LexHaskell.cxx
|
||||
@ -76,11 +82,14 @@
|
||||
src/stc/scintilla/src/LexOpal.cxx
|
||||
src/stc/scintilla/src/LexOthers.cxx
|
||||
src/stc/scintilla/src/LexPB.cxx
|
||||
src/stc/scintilla/src/LexPLM.cxx
|
||||
src/stc/scintilla/src/LexPOV.cxx
|
||||
src/stc/scintilla/src/LexProgress.cxx
|
||||
src/stc/scintilla/src/LexPS.cxx
|
||||
src/stc/scintilla/src/LexPascal.cxx
|
||||
src/stc/scintilla/src/LexPerl.cxx
|
||||
src/stc/scintilla/src/LexPython.cxx
|
||||
src/stc/scintilla/src/LexR.cxx
|
||||
src/stc/scintilla/src/LexRebol.cxx
|
||||
src/stc/scintilla/src/LexRuby.cxx
|
||||
src/stc/scintilla/src/LexSQL.cxx
|
||||
@ -96,8 +105,10 @@
|
||||
src/stc/scintilla/src/LexVerilog.cxx
|
||||
src/stc/scintilla/src/LexYAML.cxx
|
||||
src/stc/scintilla/src/LineMarker.cxx
|
||||
src/stc/scintilla/src/PositionCache.cxx
|
||||
src/stc/scintilla/src/PropSet.cxx
|
||||
src/stc/scintilla/src/RESearch.cxx
|
||||
src/stc/scintilla/src/RunStyles.cxx
|
||||
src/stc/scintilla/src/ScintillaBase.cxx
|
||||
src/stc/scintilla/src/Style.cxx
|
||||
src/stc/scintilla/src/StyleContext.cxx
|
||||
|
@ -198,6 +198,7 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_CellBuffer.obj \
|
||||
$(OBJS)\wxscintilla_CharClassify.obj \
|
||||
$(OBJS)\wxscintilla_ContractionState.obj \
|
||||
$(OBJS)\wxscintilla_Decoration.obj \
|
||||
$(OBJS)\wxscintilla_Document.obj \
|
||||
$(OBJS)\wxscintilla_DocumentAccessor.obj \
|
||||
$(OBJS)\wxscintilla_Editor.obj \
|
||||
@ -207,7 +208,9 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_KeyWords.obj \
|
||||
$(OBJS)\wxscintilla_LexAPDL.obj \
|
||||
$(OBJS)\wxscintilla_LexAU3.obj \
|
||||
$(OBJS)\wxscintilla_LexASY.obj \
|
||||
$(OBJS)\wxscintilla_LexAVE.obj \
|
||||
$(OBJS)\wxscintilla_LexAbaqus.obj \
|
||||
$(OBJS)\wxscintilla_LexAda.obj \
|
||||
$(OBJS)\wxscintilla_LexAsm.obj \
|
||||
$(OBJS)\wxscintilla_LexAsn1.obj \
|
||||
@ -216,18 +219,21 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexBasic.obj \
|
||||
$(OBJS)\wxscintilla_LexBullant.obj \
|
||||
$(OBJS)\wxscintilla_LexCLW.obj \
|
||||
$(OBJS)\wxscintilla_LexCmake.obj \
|
||||
$(OBJS)\wxscintilla_LexCPP.obj \
|
||||
$(OBJS)\wxscintilla_LexCSS.obj \
|
||||
$(OBJS)\wxscintilla_LexCaml.obj \
|
||||
$(OBJS)\wxscintilla_LexCsound.obj \
|
||||
$(OBJS)\wxscintilla_LexConf.obj \
|
||||
$(OBJS)\wxscintilla_LexCrontab.obj \
|
||||
$(OBJS)\wxscintilla_LexD.obj \
|
||||
$(OBJS)\wxscintilla_LexEScript.obj \
|
||||
$(OBJS)\wxscintilla_LexEiffel.obj \
|
||||
$(OBJS)\wxscintilla_LexErlang.obj \
|
||||
$(OBJS)\wxscintilla_LexFlagship.obj \
|
||||
$(OBJS)\wxscintilla_LexForth.obj \
|
||||
$(OBJS)\wxscintilla_LexFortran.obj \
|
||||
$(OBJS)\wxscintilla_LexGAP.obj \
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.obj \
|
||||
$(OBJS)\wxscintilla_LexHTML.obj \
|
||||
$(OBJS)\wxscintilla_LexHaskell.obj \
|
||||
@ -245,11 +251,14 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexOpal.obj \
|
||||
$(OBJS)\wxscintilla_LexOthers.obj \
|
||||
$(OBJS)\wxscintilla_LexPB.obj \
|
||||
$(OBJS)\wxscintilla_LexPLM.obj \
|
||||
$(OBJS)\wxscintilla_LexPOV.obj \
|
||||
$(OBJS)\wxscintilla_LexProgress.obj \
|
||||
$(OBJS)\wxscintilla_LexPS.obj \
|
||||
$(OBJS)\wxscintilla_LexPascal.obj \
|
||||
$(OBJS)\wxscintilla_LexPerl.obj \
|
||||
$(OBJS)\wxscintilla_LexPython.obj \
|
||||
$(OBJS)\wxscintilla_LexR.obj \
|
||||
$(OBJS)\wxscintilla_LexRebol.obj \
|
||||
$(OBJS)\wxscintilla_LexRuby.obj \
|
||||
$(OBJS)\wxscintilla_LexSQL.obj \
|
||||
@ -265,8 +274,10 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexVerilog.obj \
|
||||
$(OBJS)\wxscintilla_LexYAML.obj \
|
||||
$(OBJS)\wxscintilla_LineMarker.obj \
|
||||
$(OBJS)\wxscintilla_PositionCache.obj \
|
||||
$(OBJS)\wxscintilla_PropSet.obj \
|
||||
$(OBJS)\wxscintilla_RESearch.obj \
|
||||
$(OBJS)\wxscintilla_RunStyles.obj \
|
||||
$(OBJS)\wxscintilla_ScintillaBase.obj \
|
||||
$(OBJS)\wxscintilla_Style.obj \
|
||||
$(OBJS)\wxscintilla_StyleContext.obj \
|
||||
@ -4895,6 +4906,9 @@ $(OBJS)\wxscintilla_CharClassify.obj: ..\..\src\stc\scintilla\src\CharClassify.c
|
||||
$(OBJS)\wxscintilla_ContractionState.obj: ..\..\src\stc\scintilla\src\ContractionState.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_Decoration.obj: ..\..\src\stc\scintilla\src\Decoration.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_Document.obj: ..\..\src\stc\scintilla\src\Document.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -4922,9 +4936,15 @@ $(OBJS)\wxscintilla_LexAPDL.obj: ..\..\src\stc\scintilla\src\LexAPDL.cxx
|
||||
$(OBJS)\wxscintilla_LexAU3.obj: ..\..\src\stc\scintilla\src\LexAU3.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexASY.obj: ..\..\src\stc\scintilla\src\LexASY.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexAVE.obj: ..\..\src\stc\scintilla\src\LexAVE.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexAbaqus.obj: ..\..\src\stc\scintilla\src\LexAbaqus.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexAda.obj: ..\..\src\stc\scintilla\src\LexAda.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -4949,6 +4969,9 @@ $(OBJS)\wxscintilla_LexBullant.obj: ..\..\src\stc\scintilla\src\LexBullant.cxx
|
||||
$(OBJS)\wxscintilla_LexCLW.obj: ..\..\src\stc\scintilla\src\LexCLW.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexCmake.obj: ..\..\src\stc\scintilla\src\LexCmake.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexCPP.obj: ..\..\src\stc\scintilla\src\LexCPP.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -4967,6 +4990,9 @@ $(OBJS)\wxscintilla_LexConf.obj: ..\..\src\stc\scintilla\src\LexConf.cxx
|
||||
$(OBJS)\wxscintilla_LexCrontab.obj: ..\..\src\stc\scintilla\src\LexCrontab.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexD.obj: ..\..\src\stc\scintilla\src\LexD.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexEScript.obj: ..\..\src\stc\scintilla\src\LexEScript.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -4985,6 +5011,9 @@ $(OBJS)\wxscintilla_LexForth.obj: ..\..\src\stc\scintilla\src\LexForth.cxx
|
||||
$(OBJS)\wxscintilla_LexFortran.obj: ..\..\src\stc\scintilla\src\LexFortran.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexGAP.obj: ..\..\src\stc\scintilla\src\LexGAP.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.obj: ..\..\src\stc\scintilla\src\LexGui4Cli.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5036,9 +5065,15 @@ $(OBJS)\wxscintilla_LexOthers.obj: ..\..\src\stc\scintilla\src\LexOthers.cxx
|
||||
$(OBJS)\wxscintilla_LexPB.obj: ..\..\src\stc\scintilla\src\LexPB.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexPLM.obj: ..\..\src\stc\scintilla\src\LexPLM.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexPOV.obj: ..\..\src\stc\scintilla\src\LexPOV.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexProgress.obj: ..\..\src\stc\scintilla\src\LexProgress.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexPS.obj: ..\..\src\stc\scintilla\src\LexPS.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5051,6 +5086,9 @@ $(OBJS)\wxscintilla_LexPerl.obj: ..\..\src\stc\scintilla\src\LexPerl.cxx
|
||||
$(OBJS)\wxscintilla_LexPython.obj: ..\..\src\stc\scintilla\src\LexPython.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexR.obj: ..\..\src\stc\scintilla\src\LexR.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexRebol.obj: ..\..\src\stc\scintilla\src\LexRebol.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5096,12 +5134,18 @@ $(OBJS)\wxscintilla_LexYAML.obj: ..\..\src\stc\scintilla\src\LexYAML.cxx
|
||||
$(OBJS)\wxscintilla_LineMarker.obj: ..\..\src\stc\scintilla\src\LineMarker.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_PositionCache.obj: ..\..\src\stc\scintilla\src\PositionCache.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_PropSet.obj: ..\..\src\stc\scintilla\src\PropSet.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_RESearch.obj: ..\..\src\stc\scintilla\src\RESearch.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_RunStyles.obj: ..\..\src\stc\scintilla\src\RunStyles.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_ScintillaBase.obj: ..\..\src\stc\scintilla\src\ScintillaBase.cxx
|
||||
$(CXX) -q -c -P -o$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
|
@ -183,6 +183,7 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_CellBuffer.o \
|
||||
$(OBJS)\wxscintilla_CharClassify.o \
|
||||
$(OBJS)\wxscintilla_ContractionState.o \
|
||||
$(OBJS)\wxscintilla_Decoration.o \
|
||||
$(OBJS)\wxscintilla_Document.o \
|
||||
$(OBJS)\wxscintilla_DocumentAccessor.o \
|
||||
$(OBJS)\wxscintilla_Editor.o \
|
||||
@ -192,7 +193,9 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_KeyWords.o \
|
||||
$(OBJS)\wxscintilla_LexAPDL.o \
|
||||
$(OBJS)\wxscintilla_LexAU3.o \
|
||||
$(OBJS)\wxscintilla_LexASY.o \
|
||||
$(OBJS)\wxscintilla_LexAVE.o \
|
||||
$(OBJS)\wxscintilla_LexAbaqus.o \
|
||||
$(OBJS)\wxscintilla_LexAda.o \
|
||||
$(OBJS)\wxscintilla_LexAsm.o \
|
||||
$(OBJS)\wxscintilla_LexAsn1.o \
|
||||
@ -201,18 +204,21 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexBasic.o \
|
||||
$(OBJS)\wxscintilla_LexBullant.o \
|
||||
$(OBJS)\wxscintilla_LexCLW.o \
|
||||
$(OBJS)\wxscintilla_LexCmake.o \
|
||||
$(OBJS)\wxscintilla_LexCPP.o \
|
||||
$(OBJS)\wxscintilla_LexCSS.o \
|
||||
$(OBJS)\wxscintilla_LexCaml.o \
|
||||
$(OBJS)\wxscintilla_LexCsound.o \
|
||||
$(OBJS)\wxscintilla_LexConf.o \
|
||||
$(OBJS)\wxscintilla_LexCrontab.o \
|
||||
$(OBJS)\wxscintilla_LexD.o \
|
||||
$(OBJS)\wxscintilla_LexEScript.o \
|
||||
$(OBJS)\wxscintilla_LexEiffel.o \
|
||||
$(OBJS)\wxscintilla_LexErlang.o \
|
||||
$(OBJS)\wxscintilla_LexFlagship.o \
|
||||
$(OBJS)\wxscintilla_LexForth.o \
|
||||
$(OBJS)\wxscintilla_LexFortran.o \
|
||||
$(OBJS)\wxscintilla_LexGAP.o \
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.o \
|
||||
$(OBJS)\wxscintilla_LexHTML.o \
|
||||
$(OBJS)\wxscintilla_LexHaskell.o \
|
||||
@ -230,11 +236,14 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexOpal.o \
|
||||
$(OBJS)\wxscintilla_LexOthers.o \
|
||||
$(OBJS)\wxscintilla_LexPB.o \
|
||||
$(OBJS)\wxscintilla_LexPLM.o \
|
||||
$(OBJS)\wxscintilla_LexPOV.o \
|
||||
$(OBJS)\wxscintilla_LexProgress.o \
|
||||
$(OBJS)\wxscintilla_LexPS.o \
|
||||
$(OBJS)\wxscintilla_LexPascal.o \
|
||||
$(OBJS)\wxscintilla_LexPerl.o \
|
||||
$(OBJS)\wxscintilla_LexPython.o \
|
||||
$(OBJS)\wxscintilla_LexR.o \
|
||||
$(OBJS)\wxscintilla_LexRebol.o \
|
||||
$(OBJS)\wxscintilla_LexRuby.o \
|
||||
$(OBJS)\wxscintilla_LexSQL.o \
|
||||
@ -250,8 +259,10 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexVerilog.o \
|
||||
$(OBJS)\wxscintilla_LexYAML.o \
|
||||
$(OBJS)\wxscintilla_LineMarker.o \
|
||||
$(OBJS)\wxscintilla_PositionCache.o \
|
||||
$(OBJS)\wxscintilla_PropSet.o \
|
||||
$(OBJS)\wxscintilla_RESearch.o \
|
||||
$(OBJS)\wxscintilla_RunStyles.o \
|
||||
$(OBJS)\wxscintilla_ScintillaBase.o \
|
||||
$(OBJS)\wxscintilla_Style.o \
|
||||
$(OBJS)\wxscintilla_StyleContext.o \
|
||||
@ -5035,6 +5046,9 @@ $(OBJS)\wxscintilla_CharClassify.o: ../../src/stc/scintilla/src/CharClassify.cxx
|
||||
$(OBJS)\wxscintilla_ContractionState.o: ../../src/stc/scintilla/src/ContractionState.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_Decoration.o: ../../src/stc/scintilla/src/Decoration.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_Document.o: ../../src/stc/scintilla/src/Document.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5062,9 +5076,15 @@ $(OBJS)\wxscintilla_LexAPDL.o: ../../src/stc/scintilla/src/LexAPDL.cxx
|
||||
$(OBJS)\wxscintilla_LexAU3.o: ../../src/stc/scintilla/src/LexAU3.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexASY.o: ../../src/stc/scintilla/src/LexASY.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexAVE.o: ../../src/stc/scintilla/src/LexAVE.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexAbaqus.o: ../../src/stc/scintilla/src/LexAbaqus.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexAda.o: ../../src/stc/scintilla/src/LexAda.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5089,6 +5109,9 @@ $(OBJS)\wxscintilla_LexBullant.o: ../../src/stc/scintilla/src/LexBullant.cxx
|
||||
$(OBJS)\wxscintilla_LexCLW.o: ../../src/stc/scintilla/src/LexCLW.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexCmake.o: ../../src/stc/scintilla/src/LexCmake.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexCPP.o: ../../src/stc/scintilla/src/LexCPP.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5107,6 +5130,9 @@ $(OBJS)\wxscintilla_LexConf.o: ../../src/stc/scintilla/src/LexConf.cxx
|
||||
$(OBJS)\wxscintilla_LexCrontab.o: ../../src/stc/scintilla/src/LexCrontab.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexD.o: ../../src/stc/scintilla/src/LexD.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexEScript.o: ../../src/stc/scintilla/src/LexEScript.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5125,6 +5151,9 @@ $(OBJS)\wxscintilla_LexForth.o: ../../src/stc/scintilla/src/LexForth.cxx
|
||||
$(OBJS)\wxscintilla_LexFortran.o: ../../src/stc/scintilla/src/LexFortran.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexGAP.o: ../../src/stc/scintilla/src/LexGAP.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.o: ../../src/stc/scintilla/src/LexGui4Cli.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5176,9 +5205,15 @@ $(OBJS)\wxscintilla_LexOthers.o: ../../src/stc/scintilla/src/LexOthers.cxx
|
||||
$(OBJS)\wxscintilla_LexPB.o: ../../src/stc/scintilla/src/LexPB.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexPLM.o: ../../src/stc/scintilla/src/LexPLM.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexPOV.o: ../../src/stc/scintilla/src/LexPOV.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexProgress.o: ../../src/stc/scintilla/src/LexProgress.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexPS.o: ../../src/stc/scintilla/src/LexPS.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5191,6 +5226,9 @@ $(OBJS)\wxscintilla_LexPerl.o: ../../src/stc/scintilla/src/LexPerl.cxx
|
||||
$(OBJS)\wxscintilla_LexPython.o: ../../src/stc/scintilla/src/LexPython.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexR.o: ../../src/stc/scintilla/src/LexR.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexRebol.o: ../../src/stc/scintilla/src/LexRebol.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@ -5236,12 +5274,18 @@ $(OBJS)\wxscintilla_LexYAML.o: ../../src/stc/scintilla/src/LexYAML.cxx
|
||||
$(OBJS)\wxscintilla_LineMarker.o: ../../src/stc/scintilla/src/LineMarker.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_PositionCache.o: ../../src/stc/scintilla/src/PositionCache.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_PropSet.o: ../../src/stc/scintilla/src/PropSet.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_RESearch.o: ../../src/stc/scintilla/src/RESearch.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_RunStyles.o: ../../src/stc/scintilla/src/RunStyles.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_ScintillaBase.o: ../../src/stc/scintilla/src/ScintillaBase.cxx
|
||||
$(CXX) -c -o $@ $(WXSCINTILLA_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
@ -194,6 +194,7 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_CellBuffer.obj \
|
||||
$(OBJS)\wxscintilla_CharClassify.obj \
|
||||
$(OBJS)\wxscintilla_ContractionState.obj \
|
||||
$(OBJS)\wxscintilla_Decoration.obj \
|
||||
$(OBJS)\wxscintilla_Document.obj \
|
||||
$(OBJS)\wxscintilla_DocumentAccessor.obj \
|
||||
$(OBJS)\wxscintilla_Editor.obj \
|
||||
@ -203,7 +204,9 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_KeyWords.obj \
|
||||
$(OBJS)\wxscintilla_LexAPDL.obj \
|
||||
$(OBJS)\wxscintilla_LexAU3.obj \
|
||||
$(OBJS)\wxscintilla_LexASY.obj \
|
||||
$(OBJS)\wxscintilla_LexAVE.obj \
|
||||
$(OBJS)\wxscintilla_LexAbaqus.obj \
|
||||
$(OBJS)\wxscintilla_LexAda.obj \
|
||||
$(OBJS)\wxscintilla_LexAsm.obj \
|
||||
$(OBJS)\wxscintilla_LexAsn1.obj \
|
||||
@ -212,18 +215,21 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexBasic.obj \
|
||||
$(OBJS)\wxscintilla_LexBullant.obj \
|
||||
$(OBJS)\wxscintilla_LexCLW.obj \
|
||||
$(OBJS)\wxscintilla_LexCmake.obj \
|
||||
$(OBJS)\wxscintilla_LexCPP.obj \
|
||||
$(OBJS)\wxscintilla_LexCSS.obj \
|
||||
$(OBJS)\wxscintilla_LexCaml.obj \
|
||||
$(OBJS)\wxscintilla_LexCsound.obj \
|
||||
$(OBJS)\wxscintilla_LexConf.obj \
|
||||
$(OBJS)\wxscintilla_LexCrontab.obj \
|
||||
$(OBJS)\wxscintilla_LexD.obj \
|
||||
$(OBJS)\wxscintilla_LexEScript.obj \
|
||||
$(OBJS)\wxscintilla_LexEiffel.obj \
|
||||
$(OBJS)\wxscintilla_LexErlang.obj \
|
||||
$(OBJS)\wxscintilla_LexFlagship.obj \
|
||||
$(OBJS)\wxscintilla_LexForth.obj \
|
||||
$(OBJS)\wxscintilla_LexFortran.obj \
|
||||
$(OBJS)\wxscintilla_LexGAP.obj \
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.obj \
|
||||
$(OBJS)\wxscintilla_LexHTML.obj \
|
||||
$(OBJS)\wxscintilla_LexHaskell.obj \
|
||||
@ -241,11 +247,14 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexOpal.obj \
|
||||
$(OBJS)\wxscintilla_LexOthers.obj \
|
||||
$(OBJS)\wxscintilla_LexPB.obj \
|
||||
$(OBJS)\wxscintilla_LexPLM.obj \
|
||||
$(OBJS)\wxscintilla_LexPOV.obj \
|
||||
$(OBJS)\wxscintilla_LexProgress.obj \
|
||||
$(OBJS)\wxscintilla_LexPS.obj \
|
||||
$(OBJS)\wxscintilla_LexPascal.obj \
|
||||
$(OBJS)\wxscintilla_LexPerl.obj \
|
||||
$(OBJS)\wxscintilla_LexPython.obj \
|
||||
$(OBJS)\wxscintilla_LexR.obj \
|
||||
$(OBJS)\wxscintilla_LexRebol.obj \
|
||||
$(OBJS)\wxscintilla_LexRuby.obj \
|
||||
$(OBJS)\wxscintilla_LexSQL.obj \
|
||||
@ -261,8 +270,10 @@ WXSCINTILLA_OBJECTS = \
|
||||
$(OBJS)\wxscintilla_LexVerilog.obj \
|
||||
$(OBJS)\wxscintilla_LexYAML.obj \
|
||||
$(OBJS)\wxscintilla_LineMarker.obj \
|
||||
$(OBJS)\wxscintilla_PositionCache.obj \
|
||||
$(OBJS)\wxscintilla_PropSet.obj \
|
||||
$(OBJS)\wxscintilla_RESearch.obj \
|
||||
$(OBJS)\wxscintilla_RunStyles.obj \
|
||||
$(OBJS)\wxscintilla_ScintillaBase.obj \
|
||||
$(OBJS)\wxscintilla_Style.obj \
|
||||
$(OBJS)\wxscintilla_StyleContext.obj \
|
||||
@ -4484,7 +4495,7 @@ clean:
|
||||
-if exist $(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gl.lib del $(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gl.lib
|
||||
cd ..\..\samples
|
||||
$(MAKE) -f makefile.vc $(MAKEARGS) clean
|
||||
cd "$(MAKEDIR)"
|
||||
cd $(MAKEDIR)
|
||||
|
||||
setup_h: $(SETUPHDIR)\wx ..\..\include\wx\$(__SETUP_H_SUBDIR_FILENAMES)\setup.h $(SETUPHDIR)\wx\setup.h $(SETUPHDIR)\wx\msw\rcdefs.h
|
||||
|
||||
@ -4803,7 +4814,7 @@ wxgl: $(____wxgl_namedll_DEP) $(____wxgl_namelib_DEP)
|
||||
sub_samples:
|
||||
cd ..\..\samples
|
||||
$(MAKE) -f makefile.vc $(MAKEARGS) all
|
||||
cd "$(MAKEDIR)"
|
||||
cd $(MAKEDIR)
|
||||
|
||||
$(LIBDIRNAME):
|
||||
if not exist $(LIBDIRNAME) mkdir $(LIBDIRNAME)
|
||||
@ -5227,6 +5238,9 @@ $(OBJS)\wxscintilla_CharClassify.obj: ..\..\src\stc\scintilla\src\CharClassify.c
|
||||
$(OBJS)\wxscintilla_ContractionState.obj: ..\..\src\stc\scintilla\src\ContractionState.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_Decoration.obj: ..\..\src\stc\scintilla\src\Decoration.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_Document.obj: ..\..\src\stc\scintilla\src\Document.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5254,9 +5268,15 @@ $(OBJS)\wxscintilla_LexAPDL.obj: ..\..\src\stc\scintilla\src\LexAPDL.cxx
|
||||
$(OBJS)\wxscintilla_LexAU3.obj: ..\..\src\stc\scintilla\src\LexAU3.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexASY.obj: ..\..\src\stc\scintilla\src\LexASY.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexAVE.obj: ..\..\src\stc\scintilla\src\LexAVE.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexAbaqus.obj: ..\..\src\stc\scintilla\src\LexAbaqus.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexAda.obj: ..\..\src\stc\scintilla\src\LexAda.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5281,6 +5301,9 @@ $(OBJS)\wxscintilla_LexBullant.obj: ..\..\src\stc\scintilla\src\LexBullant.cxx
|
||||
$(OBJS)\wxscintilla_LexCLW.obj: ..\..\src\stc\scintilla\src\LexCLW.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexCmake.obj: ..\..\src\stc\scintilla\src\LexCmake.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexCPP.obj: ..\..\src\stc\scintilla\src\LexCPP.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5299,6 +5322,9 @@ $(OBJS)\wxscintilla_LexConf.obj: ..\..\src\stc\scintilla\src\LexConf.cxx
|
||||
$(OBJS)\wxscintilla_LexCrontab.obj: ..\..\src\stc\scintilla\src\LexCrontab.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexD.obj: ..\..\src\stc\scintilla\src\LexD.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexEScript.obj: ..\..\src\stc\scintilla\src\LexEScript.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5317,6 +5343,9 @@ $(OBJS)\wxscintilla_LexForth.obj: ..\..\src\stc\scintilla\src\LexForth.cxx
|
||||
$(OBJS)\wxscintilla_LexFortran.obj: ..\..\src\stc\scintilla\src\LexFortran.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexGAP.obj: ..\..\src\stc\scintilla\src\LexGAP.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.obj: ..\..\src\stc\scintilla\src\LexGui4Cli.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5368,9 +5397,15 @@ $(OBJS)\wxscintilla_LexOthers.obj: ..\..\src\stc\scintilla\src\LexOthers.cxx
|
||||
$(OBJS)\wxscintilla_LexPB.obj: ..\..\src\stc\scintilla\src\LexPB.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexPLM.obj: ..\..\src\stc\scintilla\src\LexPLM.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexPOV.obj: ..\..\src\stc\scintilla\src\LexPOV.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexProgress.obj: ..\..\src\stc\scintilla\src\LexProgress.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexPS.obj: ..\..\src\stc\scintilla\src\LexPS.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5383,6 +5418,9 @@ $(OBJS)\wxscintilla_LexPerl.obj: ..\..\src\stc\scintilla\src\LexPerl.cxx
|
||||
$(OBJS)\wxscintilla_LexPython.obj: ..\..\src\stc\scintilla\src\LexPython.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexR.obj: ..\..\src\stc\scintilla\src\LexR.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_LexRebol.obj: ..\..\src\stc\scintilla\src\LexRebol.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
@ -5428,12 +5466,18 @@ $(OBJS)\wxscintilla_LexYAML.obj: ..\..\src\stc\scintilla\src\LexYAML.cxx
|
||||
$(OBJS)\wxscintilla_LineMarker.obj: ..\..\src\stc\scintilla\src\LineMarker.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_PositionCache.obj: ..\..\src\stc\scintilla\src\PositionCache.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_PropSet.obj: ..\..\src\stc\scintilla\src\PropSet.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_RESearch.obj: ..\..\src\stc\scintilla\src\RESearch.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_RunStyles.obj: ..\..\src\stc\scintilla\src\RunStyles.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
$(OBJS)\wxscintilla_ScintillaBase.obj: ..\..\src\stc\scintilla\src\ScintillaBase.cxx
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(WXSCINTILLA_CXXFLAGS) $**
|
||||
|
||||
|
@ -3135,6 +3135,7 @@ WXSCINTILLA_OBJECTS = &
|
||||
$(OBJS)\wxscintilla_CellBuffer.obj &
|
||||
$(OBJS)\wxscintilla_CharClassify.obj &
|
||||
$(OBJS)\wxscintilla_ContractionState.obj &
|
||||
$(OBJS)\wxscintilla_Decoration.obj &
|
||||
$(OBJS)\wxscintilla_Document.obj &
|
||||
$(OBJS)\wxscintilla_DocumentAccessor.obj &
|
||||
$(OBJS)\wxscintilla_Editor.obj &
|
||||
@ -3144,7 +3145,9 @@ WXSCINTILLA_OBJECTS = &
|
||||
$(OBJS)\wxscintilla_KeyWords.obj &
|
||||
$(OBJS)\wxscintilla_LexAPDL.obj &
|
||||
$(OBJS)\wxscintilla_LexAU3.obj &
|
||||
$(OBJS)\wxscintilla_LexASY.obj &
|
||||
$(OBJS)\wxscintilla_LexAVE.obj &
|
||||
$(OBJS)\wxscintilla_LexAbaqus.obj &
|
||||
$(OBJS)\wxscintilla_LexAda.obj &
|
||||
$(OBJS)\wxscintilla_LexAsm.obj &
|
||||
$(OBJS)\wxscintilla_LexAsn1.obj &
|
||||
@ -3153,18 +3156,21 @@ WXSCINTILLA_OBJECTS = &
|
||||
$(OBJS)\wxscintilla_LexBasic.obj &
|
||||
$(OBJS)\wxscintilla_LexBullant.obj &
|
||||
$(OBJS)\wxscintilla_LexCLW.obj &
|
||||
$(OBJS)\wxscintilla_LexCmake.obj &
|
||||
$(OBJS)\wxscintilla_LexCPP.obj &
|
||||
$(OBJS)\wxscintilla_LexCSS.obj &
|
||||
$(OBJS)\wxscintilla_LexCaml.obj &
|
||||
$(OBJS)\wxscintilla_LexCsound.obj &
|
||||
$(OBJS)\wxscintilla_LexConf.obj &
|
||||
$(OBJS)\wxscintilla_LexCrontab.obj &
|
||||
$(OBJS)\wxscintilla_LexD.obj &
|
||||
$(OBJS)\wxscintilla_LexEScript.obj &
|
||||
$(OBJS)\wxscintilla_LexEiffel.obj &
|
||||
$(OBJS)\wxscintilla_LexErlang.obj &
|
||||
$(OBJS)\wxscintilla_LexFlagship.obj &
|
||||
$(OBJS)\wxscintilla_LexForth.obj &
|
||||
$(OBJS)\wxscintilla_LexFortran.obj &
|
||||
$(OBJS)\wxscintilla_LexGAP.obj &
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.obj &
|
||||
$(OBJS)\wxscintilla_LexHTML.obj &
|
||||
$(OBJS)\wxscintilla_LexHaskell.obj &
|
||||
@ -3182,11 +3188,14 @@ WXSCINTILLA_OBJECTS = &
|
||||
$(OBJS)\wxscintilla_LexOpal.obj &
|
||||
$(OBJS)\wxscintilla_LexOthers.obj &
|
||||
$(OBJS)\wxscintilla_LexPB.obj &
|
||||
$(OBJS)\wxscintilla_LexPLM.obj &
|
||||
$(OBJS)\wxscintilla_LexPOV.obj &
|
||||
$(OBJS)\wxscintilla_LexProgress.obj &
|
||||
$(OBJS)\wxscintilla_LexPS.obj &
|
||||
$(OBJS)\wxscintilla_LexPascal.obj &
|
||||
$(OBJS)\wxscintilla_LexPerl.obj &
|
||||
$(OBJS)\wxscintilla_LexPython.obj &
|
||||
$(OBJS)\wxscintilla_LexR.obj &
|
||||
$(OBJS)\wxscintilla_LexRebol.obj &
|
||||
$(OBJS)\wxscintilla_LexRuby.obj &
|
||||
$(OBJS)\wxscintilla_LexSQL.obj &
|
||||
@ -3202,8 +3211,10 @@ WXSCINTILLA_OBJECTS = &
|
||||
$(OBJS)\wxscintilla_LexVerilog.obj &
|
||||
$(OBJS)\wxscintilla_LexYAML.obj &
|
||||
$(OBJS)\wxscintilla_LineMarker.obj &
|
||||
$(OBJS)\wxscintilla_PositionCache.obj &
|
||||
$(OBJS)\wxscintilla_PropSet.obj &
|
||||
$(OBJS)\wxscintilla_RESearch.obj &
|
||||
$(OBJS)\wxscintilla_RunStyles.obj &
|
||||
$(OBJS)\wxscintilla_ScintillaBase.obj &
|
||||
$(OBJS)\wxscintilla_Style.obj &
|
||||
$(OBJS)\wxscintilla_StyleContext.obj &
|
||||
@ -5269,6 +5280,9 @@ $(OBJS)\wxscintilla_CharClassify.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\
|
||||
$(OBJS)\wxscintilla_ContractionState.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\ContractionState.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_Decoration.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\Decoration.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_Document.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\Document.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5296,9 +5310,15 @@ $(OBJS)\wxscintilla_LexAPDL.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexAP
|
||||
$(OBJS)\wxscintilla_LexAU3.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexAU3.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexASY.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexASY.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexAVE.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexAVE.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexAbaqus.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexAbaqus.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexAda.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexAda.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5323,6 +5343,9 @@ $(OBJS)\wxscintilla_LexBullant.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\Le
|
||||
$(OBJS)\wxscintilla_LexCLW.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexCLW.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexCmake.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexCmake.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexCPP.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexCPP.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5341,6 +5364,9 @@ $(OBJS)\wxscintilla_LexConf.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexCo
|
||||
$(OBJS)\wxscintilla_LexCrontab.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexCrontab.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexD.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexD.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexEScript.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexEScript.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5359,6 +5385,9 @@ $(OBJS)\wxscintilla_LexForth.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexF
|
||||
$(OBJS)\wxscintilla_LexFortran.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexFortran.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexGAP.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexGAP.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexGui4Cli.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexGui4Cli.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5410,9 +5439,15 @@ $(OBJS)\wxscintilla_LexOthers.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\Lex
|
||||
$(OBJS)\wxscintilla_LexPB.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexPB.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexPLM.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexPLM.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexPOV.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexPOV.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexProgress.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexProgress.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexPS.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexPS.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5425,6 +5460,9 @@ $(OBJS)\wxscintilla_LexPerl.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexPe
|
||||
$(OBJS)\wxscintilla_LexPython.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexPython.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexR.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexR.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_LexRebol.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexRebol.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
@ -5470,12 +5508,18 @@ $(OBJS)\wxscintilla_LexYAML.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LexYA
|
||||
$(OBJS)\wxscintilla_LineMarker.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\LineMarker.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_PositionCache.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\PositionCache.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_PropSet.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\PropSet.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_RESearch.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\RESearch.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_RunStyles.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\RunStyles.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\wxscintilla_ScintillaBase.obj : .AUTODEPEND ..\..\src\stc\scintilla\src\ScintillaBase.cxx
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(WXSCINTILLA_CXXFLAGS) $<
|
||||
|
||||
|
@ -255,6 +255,10 @@ SOURCE=..\..\src\stc\scintilla\src\ContractionState.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\Decoration.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\Document.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -287,6 +291,10 @@ SOURCE=..\..\src\stc\scintilla\src\LexAPDL.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexASY.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexAU3.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -295,6 +303,10 @@ SOURCE=..\..\src\stc\scintilla\src\LexAVE.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexAbaqus.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexAda.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -339,6 +351,10 @@ SOURCE=..\..\src\stc\scintilla\src\LexCaml.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexCmake.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexConf.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -351,6 +367,10 @@ SOURCE=..\..\src\stc\scintilla\src\LexCsound.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexD.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexEScript.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -375,6 +395,10 @@ SOURCE=..\..\src\stc\scintilla\src\LexFortran.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexGAP.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexGui4Cli.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -443,6 +467,10 @@ SOURCE=..\..\src\stc\scintilla\src\LexPB.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexPLM.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexPOV.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -459,10 +487,18 @@ SOURCE=..\..\src\stc\scintilla\src\LexPerl.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexProgress.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexPython.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexR.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\LexRebol.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -523,6 +559,10 @@ SOURCE=..\..\src\stc\scintilla\src\LineMarker.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\PositionCache.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\PropSet.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -531,6 +571,10 @@ SOURCE=..\..\src\stc\scintilla\src\RESearch.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\RunStyles.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\stc\scintilla\src\ScintillaBase.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -129,7 +129,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_STYLE_INDENTGUIDE 37
|
||||
#define wxSTC_STYLE_CALLTIP 38
|
||||
#define wxSTC_STYLE_LASTPREDEFINED 39
|
||||
#define wxSTC_STYLE_MAX 127
|
||||
#define wxSTC_STYLE_MAX 255
|
||||
|
||||
// Character set identifiers are used in StyleSetCharacterSet.
|
||||
// The values are the same as the Windows *_CHARSET values.
|
||||
@ -157,7 +157,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_CASE_MIXED 0
|
||||
#define wxSTC_CASE_UPPER 1
|
||||
#define wxSTC_CASE_LOWER 2
|
||||
#define wxSTC_INDIC_MAX 7
|
||||
|
||||
// Indicator style enumeration and some constants
|
||||
#define wxSTC_INDIC_PLAIN 0
|
||||
#define wxSTC_INDIC_SQUIGGLE 1
|
||||
#define wxSTC_INDIC_TT 2
|
||||
@ -166,10 +167,16 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_INDIC_HIDDEN 5
|
||||
#define wxSTC_INDIC_BOX 6
|
||||
#define wxSTC_INDIC_ROUNDBOX 7
|
||||
#define wxSTC_INDIC_MAX 31
|
||||
#define wxSTC_INDIC_CONTAINER 8
|
||||
#define wxSTC_INDIC0_MASK 0x20
|
||||
#define wxSTC_INDIC1_MASK 0x40
|
||||
#define wxSTC_INDIC2_MASK 0x80
|
||||
#define wxSTC_INDICS_MASK 0xE0
|
||||
#define wxSTC_IV_NONE 0
|
||||
#define wxSTC_IV_REAL 1
|
||||
#define wxSTC_IV_LOOKFORWARD 2
|
||||
#define wxSTC_IV_LOOKBOTH 3
|
||||
|
||||
// PrintColourMode - use same colours as screen.
|
||||
#define wxSTC_PRINT_NORMAL 0
|
||||
@ -254,7 +261,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
// where most code reside, and the lines after the caret, eg. the body of a function.
|
||||
#define wxSTC_CARET_EVEN 0x08
|
||||
|
||||
// Selection modes
|
||||
// Selection Modes
|
||||
#define wxSTC_SEL_STREAM 0
|
||||
#define wxSTC_SEL_RECTANGLE 1
|
||||
#define wxSTC_SEL_LINES 2
|
||||
@ -262,6 +269,11 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_ALPHA_OPAQUE 255
|
||||
#define wxSTC_ALPHA_NOALPHA 256
|
||||
|
||||
// Caret Styles
|
||||
#define wxSTC_CARETSTYLE_INVISIBLE 0
|
||||
#define wxSTC_CARETSTYLE_LINE 1
|
||||
#define wxSTC_CARETSTYLE_BLOCK 2
|
||||
|
||||
// Maximum value of keywordSet parameter of SetKeyWords.
|
||||
#define wxSTC_KEYWORDSET_MAX 8
|
||||
|
||||
@ -282,7 +294,10 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_MOD_BEFOREINSERT 0x400
|
||||
#define wxSTC_MOD_BEFOREDELETE 0x800
|
||||
#define wxSTC_MULTILINEUNDOREDO 0x1000
|
||||
#define wxSTC_MODEVENTMASKALL 0x1FFF
|
||||
#define wxSTC_STARTACTION 0x2000
|
||||
#define wxSTC_MOD_CHANGEINDICATOR 0x4000
|
||||
#define wxSTC_MOD_CHANGELINESTATE 0x8000
|
||||
#define wxSTC_MODEVENTMASKALL 0xFFFF
|
||||
|
||||
// Symbolic key codes and modifier flags.
|
||||
// ASCII and other printable characters below 256.
|
||||
@ -304,6 +319,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_KEY_ADD 310
|
||||
#define wxSTC_KEY_SUBTRACT 311
|
||||
#define wxSTC_KEY_DIVIDE 312
|
||||
#define wxSTC_KEY_WIN 313
|
||||
#define wxSTC_KEY_RWIN 314
|
||||
#define wxSTC_KEY_MENU 315
|
||||
#define wxSTC_SCMOD_NORM 0
|
||||
#define wxSTC_SCMOD_SHIFT 1
|
||||
#define wxSTC_SCMOD_CTRL 2
|
||||
@ -387,6 +405,14 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_LEX_INNOSETUP 76
|
||||
#define wxSTC_LEX_OPAL 77
|
||||
#define wxSTC_LEX_SPICE 78
|
||||
#define wxSTC_LEX_D 79
|
||||
#define wxSTC_LEX_CMAKE 80
|
||||
#define wxSTC_LEX_GAP 81
|
||||
#define wxSTC_LEX_PLM 82
|
||||
#define wxSTC_LEX_PROGRESS 83
|
||||
#define wxSTC_LEX_ABAQUS 84
|
||||
#define wxSTC_LEX_ASYMPTOTE 85
|
||||
#define wxSTC_LEX_R 86
|
||||
|
||||
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||
// value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||
@ -432,6 +458,26 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_C_COMMENTDOCKEYWORDERROR 18
|
||||
#define wxSTC_C_GLOBALCLASS 19
|
||||
|
||||
// Lexical states for SCLEX_D
|
||||
#define wxSTC_D_DEFAULT 0
|
||||
#define wxSTC_D_COMMENT 1
|
||||
#define wxSTC_D_COMMENTLINE 2
|
||||
#define wxSTC_D_COMMENTDOC 3
|
||||
#define wxSTC_D_COMMENTNESTED 4
|
||||
#define wxSTC_D_NUMBER 5
|
||||
#define wxSTC_D_WORD 6
|
||||
#define wxSTC_D_WORD2 7
|
||||
#define wxSTC_D_WORD3 8
|
||||
#define wxSTC_D_TYPEDEF 9
|
||||
#define wxSTC_D_STRING 10
|
||||
#define wxSTC_D_STRINGEOL 11
|
||||
#define wxSTC_D_CHARACTER 12
|
||||
#define wxSTC_D_OPERATOR 13
|
||||
#define wxSTC_D_IDENTIFIER 14
|
||||
#define wxSTC_D_COMMENTLINEDOC 15
|
||||
#define wxSTC_D_COMMENTDOCKEYWORD 16
|
||||
#define wxSTC_D_COMMENTDOCKEYWORDERROR 17
|
||||
|
||||
// Lexical states for SCLEX_TCL
|
||||
#define wxSTC_TCL_DEFAULT 0
|
||||
#define wxSTC_TCL_COMMENT 1
|
||||
@ -626,6 +672,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_PL_STRING_QR 29
|
||||
#define wxSTC_PL_STRING_QW 30
|
||||
#define wxSTC_PL_POD_VERB 31
|
||||
#define wxSTC_PL_SUB_PROTOTYPE 40
|
||||
#define wxSTC_PL_FORMAT_IDENT 41
|
||||
#define wxSTC_PL_FORMAT 42
|
||||
|
||||
// Lexical states for SCLEX_RUBY
|
||||
#define wxSTC_RB_DEFAULT 0
|
||||
@ -743,6 +792,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_ERR_ABSF 18
|
||||
#define wxSTC_ERR_TIDY 19
|
||||
#define wxSTC_ERR_JAVA_STACK 20
|
||||
#define wxSTC_ERR_VALUE 21
|
||||
|
||||
// Lexical states for SCLEX_BATCH
|
||||
#define wxSTC_BAT_DEFAULT 0
|
||||
@ -1107,6 +1157,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_YAML_DOCUMENT 6
|
||||
#define wxSTC_YAML_TEXT 7
|
||||
#define wxSTC_YAML_ERROR 8
|
||||
#define wxSTC_YAML_OPERATOR 9
|
||||
|
||||
// Lexical states for SCLEX_TEX
|
||||
#define wxSTC_TEX_DEFAULT 0
|
||||
@ -1355,6 +1406,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_T3_USER1 17
|
||||
#define wxSTC_T3_USER2 18
|
||||
#define wxSTC_T3_USER3 19
|
||||
#define wxSTC_T3_BRACE 20
|
||||
|
||||
// Lexical states for SCLEX_REBOL
|
||||
#define wxSTC_REBOL_DEFAULT 0
|
||||
@ -1512,6 +1564,124 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
#define wxSTC_SPICE_VALUE 7
|
||||
#define wxSTC_SPICE_COMMENTLINE 8
|
||||
|
||||
// Lexical states for SCLEX_CMAKE
|
||||
#define wxSTC_CMAKE_DEFAULT 0
|
||||
#define wxSTC_CMAKE_COMMENT 1
|
||||
#define wxSTC_CMAKE_STRINGDQ 2
|
||||
#define wxSTC_CMAKE_STRINGLQ 3
|
||||
#define wxSTC_CMAKE_STRINGRQ 4
|
||||
#define wxSTC_CMAKE_COMMANDS 5
|
||||
#define wxSTC_CMAKE_PARAMETERS 6
|
||||
#define wxSTC_CMAKE_VARIABLE 7
|
||||
#define wxSTC_CMAKE_USERDEFINED 8
|
||||
#define wxSTC_CMAKE_WHILEDEF 9
|
||||
#define wxSTC_CMAKE_FOREACHDEF 10
|
||||
#define wxSTC_CMAKE_IFDEFINEDEF 11
|
||||
#define wxSTC_CMAKE_MACRODEF 12
|
||||
#define wxSTC_CMAKE_STRINGVAR 13
|
||||
#define wxSTC_CMAKE_NUMBER 14
|
||||
|
||||
// Lexical states for SCLEX_GAP
|
||||
#define wxSTC_GAP_DEFAULT 0
|
||||
#define wxSTC_GAP_IDENTIFIER 1
|
||||
#define wxSTC_GAP_KEYWORD 2
|
||||
#define wxSTC_GAP_KEYWORD2 3
|
||||
#define wxSTC_GAP_KEYWORD3 4
|
||||
#define wxSTC_GAP_KEYWORD4 5
|
||||
#define wxSTC_GAP_STRING 6
|
||||
#define wxSTC_GAP_CHAR 7
|
||||
#define wxSTC_GAP_OPERATOR 8
|
||||
#define wxSTC_GAP_COMMENT 9
|
||||
#define wxSTC_GAP_NUMBER 10
|
||||
#define wxSTC_GAP_STRINGEOL 11
|
||||
|
||||
// Lexical state for SCLEX_PLM
|
||||
#define wxSTC_PLM_DEFAULT 0
|
||||
#define wxSTC_PLM_COMMENT 1
|
||||
#define wxSTC_PLM_STRING 2
|
||||
#define wxSTC_PLM_NUMBER 3
|
||||
#define wxSTC_PLM_IDENTIFIER 4
|
||||
#define wxSTC_PLM_OPERATOR 5
|
||||
#define wxSTC_PLM_CONTROL 6
|
||||
#define wxSTC_PLM_KEYWORD 7
|
||||
|
||||
// Lexical state for SCLEX_PROGRESS
|
||||
#define wxSTC_4GL_DEFAULT 0
|
||||
#define wxSTC_4GL_NUMBER 1
|
||||
#define wxSTC_4GL_WORD 2
|
||||
#define wxSTC_4GL_STRING 3
|
||||
#define wxSTC_4GL_CHARACTER 4
|
||||
#define wxSTC_4GL_PREPROCESSOR 5
|
||||
#define wxSTC_4GL_OPERATOR 6
|
||||
#define wxSTC_4GL_IDENTIFIER 7
|
||||
#define wxSTC_4GL_BLOCK 8
|
||||
#define wxSTC_4GL_END 9
|
||||
#define wxSTC_4GL_COMMENT1 10
|
||||
#define wxSTC_4GL_COMMENT2 11
|
||||
#define wxSTC_4GL_COMMENT3 12
|
||||
#define wxSTC_4GL_COMMENT4 13
|
||||
#define wxSTC_4GL_COMMENT5 14
|
||||
#define wxSTC_4GL_COMMENT6 15
|
||||
#define wxSTC_4GL_DEFAULT_ 16
|
||||
#define wxSTC_4GL_NUMBER_ 17
|
||||
#define wxSTC_4GL_WORD_ 18
|
||||
#define wxSTC_4GL_STRING_ 19
|
||||
#define wxSTC_4GL_CHARACTER_ 20
|
||||
#define wxSTC_4GL_PREPROCESSOR_ 21
|
||||
#define wxSTC_4GL_OPERATOR_ 22
|
||||
#define wxSTC_4GL_IDENTIFIER_ 23
|
||||
#define wxSTC_4GL_BLOCK_ 24
|
||||
#define wxSTC_4GL_END_ 25
|
||||
#define wxSTC_4GL_COMMENT1_ 26
|
||||
#define wxSTC_4GL_COMMENT2_ 27
|
||||
#define wxSTC_4GL_COMMENT3_ 28
|
||||
#define wxSTC_4GL_COMMENT4_ 29
|
||||
#define wxSTC_4GL_COMMENT5_ 30
|
||||
#define wxSTC_4GL_COMMENT6_ 31
|
||||
|
||||
// Lexical states for SCLEX_ABAQUS
|
||||
#define wxSTC_ABAQUS_DEFAULT 0
|
||||
#define wxSTC_ABAQUS_COMMENT 1
|
||||
#define wxSTC_ABAQUS_COMMENTBLOCK 2
|
||||
#define wxSTC_ABAQUS_NUMBER 3
|
||||
#define wxSTC_ABAQUS_STRING 4
|
||||
#define wxSTC_ABAQUS_OPERATOR 5
|
||||
#define wxSTC_ABAQUS_WORD 6
|
||||
#define wxSTC_ABAQUS_PROCESSOR 7
|
||||
#define wxSTC_ABAQUS_COMMAND 8
|
||||
#define wxSTC_ABAQUS_SLASHCOMMAND 9
|
||||
#define wxSTC_ABAQUS_STARCOMMAND 10
|
||||
#define wxSTC_ABAQUS_ARGUMENT 11
|
||||
#define wxSTC_ABAQUS_FUNCTION 12
|
||||
|
||||
// Lexical states for SCLEX_ASYMPTOTE
|
||||
#define wxSTC_ASY_DEFAULT 0
|
||||
#define wxSTC_ASY_COMMENT 1
|
||||
#define wxSTC_ASY_COMMENTLINE 2
|
||||
#define wxSTC_ASY_NUMBER 3
|
||||
#define wxSTC_ASY_WORD 4
|
||||
#define wxSTC_ASY_STRING 5
|
||||
#define wxSTC_ASY_CHARACTER 6
|
||||
#define wxSTC_ASY_OPERATOR 7
|
||||
#define wxSTC_ASY_IDENTIFIER 8
|
||||
#define wxSTC_ASY_STRINGEOL 9
|
||||
#define wxSTC_ASY_COMMENTLINEDOC 10
|
||||
#define wxSTC_ASY_WORD2 11
|
||||
|
||||
// Lexical states for SCLEX_R
|
||||
#define wxSTC_R_DEFAULT 0
|
||||
#define wxSTC_R_COMMENT 1
|
||||
#define wxSTC_R_KWORD 2
|
||||
#define wxSTC_R_BASEKWORD 3
|
||||
#define wxSTC_R_OTHERKWORD 4
|
||||
#define wxSTC_R_NUMBER 5
|
||||
#define wxSTC_R_STRING 6
|
||||
#define wxSTC_R_STRING2 7
|
||||
#define wxSTC_R_OPERATOR 8
|
||||
#define wxSTC_R_IDENTIFIER 9
|
||||
#define wxSTC_R_INFIX 10
|
||||
#define wxSTC_R_INFIXEOL 11
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Commands that can be bound to keystrokes
|
||||
@ -1651,6 +1821,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
// Delete the word to the right of the caret.
|
||||
#define wxSTC_CMD_DELWORDRIGHT 2336
|
||||
|
||||
// Delete the word to the right of the caret, but not the trailing non-word characters.
|
||||
#define wxSTC_CMD_DELWORDRIGHTEND 2518
|
||||
|
||||
// Cut the line containing the caret.
|
||||
#define wxSTC_CMD_LINECUT 2337
|
||||
|
||||
@ -1797,8 +1970,8 @@ struct SCNotification;
|
||||
|
||||
#ifndef SWIG
|
||||
extern WXDLLIMPEXP_STC const wxChar* wxSTCNameStr;
|
||||
class WXDLLIMPEXP_FWD_STC wxStyledTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_STC wxStyledTextEvent;
|
||||
class WXDLLIMPEXP_FWD_STC wxStyledTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_STC wxStyledTextEvent;
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@ -2058,6 +2231,46 @@ public:
|
||||
// Set a style to be underlined or not.
|
||||
void StyleSetUnderline(int style, bool underline);
|
||||
|
||||
// Get the foreground colour of a style.
|
||||
wxColour StyleGetForeground(int style);
|
||||
|
||||
// Get the background colour of a style.
|
||||
wxColour StyleGetBackground(int style);
|
||||
|
||||
// Get is a style bold or not.
|
||||
bool StyleGetBold(int style);
|
||||
|
||||
// Get is a style italic or not.
|
||||
bool StyleGetItalic(int style);
|
||||
|
||||
// Get the size of characters of a style.
|
||||
int StyleGetSize(int style);
|
||||
|
||||
// Get the font facename of a style
|
||||
wxString StyleGetFaceName(int style);
|
||||
|
||||
// Get is a style to have its end of line filled or not.
|
||||
bool StyleGetEOLFilled(int style);
|
||||
|
||||
// Get is a style underlined or not.
|
||||
bool StyleGetUnderline(int style);
|
||||
|
||||
// Get is a style mixed case, or to force upper or lower case.
|
||||
int StyleGetCase(int style);
|
||||
|
||||
// Get the character set of the font in a style.
|
||||
int StyleGetCharacterSet(int style);
|
||||
|
||||
// Get is a style visible or not.
|
||||
bool StyleGetVisible(int style);
|
||||
|
||||
// Get is a style changeable or not (read only).
|
||||
// Experimental feature, currently buggy.
|
||||
bool StyleGetChangeable(int style);
|
||||
|
||||
// Get is a style a hotspot or not.
|
||||
bool StyleGetHotSpot(int style);
|
||||
|
||||
// Set a style to be mixed case, or to force upper or lower case.
|
||||
void StyleSetCase(int style, int caseForce);
|
||||
|
||||
@ -2076,6 +2289,12 @@ public:
|
||||
// Set the alpha of the selection.
|
||||
void SetSelAlpha(int alpha);
|
||||
|
||||
// Is the selection end of line filled?
|
||||
bool GetSelEOLFilled();
|
||||
|
||||
// Set the selection to have its end of line filled or not.
|
||||
void SetSelEOLFilled(bool filled);
|
||||
|
||||
// Set the foreground colour of the caret.
|
||||
void SetCaretForeground(const wxColour& fore);
|
||||
|
||||
@ -2123,6 +2342,12 @@ public:
|
||||
// Retrieve the foreground colour of an indicator.
|
||||
wxColour IndicatorGetForeground(int indic);
|
||||
|
||||
// Set an indicator to draw under text or over(default).
|
||||
void IndicatorSetUnder(int indic, bool under);
|
||||
|
||||
// Retrieve whether indicator drawn under or over text.
|
||||
bool IndicatorGetUnder(int indic);
|
||||
|
||||
// Set the foreground colour of all whitespace and whether to use this setting.
|
||||
void SetWhitespaceForeground(bool useSetting, const wxColour& fore);
|
||||
|
||||
@ -2291,10 +2516,10 @@ public:
|
||||
bool GetUseHorizontalScrollBar();
|
||||
|
||||
// Show or hide indentation guides.
|
||||
void SetIndentationGuides(bool show);
|
||||
void SetIndentationGuides(int indentView);
|
||||
|
||||
// Are the indentation guides visible?
|
||||
bool GetIndentationGuides();
|
||||
int GetIndentationGuides();
|
||||
|
||||
// Set the highlighted indentation guide column.
|
||||
// 0 = no highlighted guide.
|
||||
@ -2629,6 +2854,12 @@ public:
|
||||
// Retrieve the document width assumed for scrolling.
|
||||
int GetScrollWidth();
|
||||
|
||||
// Sets whether the maximum width line displayed is used to set scroll width.
|
||||
void SetScrollWidthTracking(bool tracking);
|
||||
|
||||
// Retrieve whether the scroll width tracks wide lines.
|
||||
bool GetScrollWidthTracking();
|
||||
|
||||
// Measure the pixel width of some text in a particular style.
|
||||
// NUL terminated text argument.
|
||||
// Does not handle tab or control characters.
|
||||
@ -2789,6 +3020,9 @@ public:
|
||||
// Delete the word to the right of the caret.
|
||||
void DelWordRight();
|
||||
|
||||
// Delete the word to the right of the caret, but not the trailing non-word characters.
|
||||
void DelWordRightEnd();
|
||||
|
||||
// Cut the line containing the caret.
|
||||
void LineCut();
|
||||
|
||||
@ -3016,15 +3250,27 @@ public:
|
||||
// Set a fore colour for active hotspots.
|
||||
void SetHotspotActiveForeground(bool useSetting, const wxColour& fore);
|
||||
|
||||
// Get the fore colour for active hotspots.
|
||||
wxColour GetHotspotActiveForeground();
|
||||
|
||||
// Set a back colour for active hotspots.
|
||||
void SetHotspotActiveBackground(bool useSetting, const wxColour& back);
|
||||
|
||||
// Get the back colour for active hotspots.
|
||||
wxColour GetHotspotActiveBackground();
|
||||
|
||||
// Enable / Disable underlining active hotspots.
|
||||
void SetHotspotActiveUnderline(bool underline);
|
||||
|
||||
// Get whether underlining for active hotspots.
|
||||
bool GetHotspotActiveUnderline();
|
||||
|
||||
// Limit hotspots to single line so hotspots on two lines don't merge.
|
||||
void SetHotspotSingleLine(bool singleLine);
|
||||
|
||||
// Get the HotspotSingleLine property
|
||||
bool GetHotspotSingleLine();
|
||||
|
||||
// Move caret between paragraphs (delimited by empty lines).
|
||||
void ParaDown();
|
||||
void ParaDownExtend();
|
||||
@ -3152,6 +3398,48 @@ public:
|
||||
// Get the background alpha of the caret line.
|
||||
int GetCaretLineBackAlpha();
|
||||
|
||||
// Set the style of the caret to be drawn.
|
||||
void SetCaretStyle(int caretStyle);
|
||||
|
||||
// Returns the current style of the caret.
|
||||
int GetCaretStyle();
|
||||
|
||||
// Set the indicator used for IndicatorFillRange and IndicatorClearRange
|
||||
void SetIndicatorCurrent(int indicator);
|
||||
|
||||
// Get the current indicator
|
||||
int GetIndicatorCurrent();
|
||||
|
||||
// Set the value used for IndicatorFillRange
|
||||
void SetIndicatorValue(int value);
|
||||
|
||||
// Get the current indicator vaue
|
||||
int GetIndicatorValue();
|
||||
|
||||
// Turn a indicator on over a range.
|
||||
void IndicatorFillRange(int position, int fillLength);
|
||||
|
||||
// Turn a indicator off over a range.
|
||||
void IndicatorClearRange(int position, int clearLength);
|
||||
|
||||
// Are any indicators present at position?
|
||||
int IndicatorAllOnFor(int position);
|
||||
|
||||
// What value does a particular indicator have at at a position?
|
||||
int IndicatorValueAt(int indicator, int position);
|
||||
|
||||
// Where does a particular indicator start?
|
||||
int IndicatorStart(int indicator, int position);
|
||||
|
||||
// Where does a particular indicator end?
|
||||
int IndicatorEnd(int indicator, int position);
|
||||
|
||||
// Set number of entries in position cache
|
||||
void SetPositionCacheSize(int size);
|
||||
|
||||
// How many entries are allocated to the position cache?
|
||||
int GetPositionCacheSize();
|
||||
|
||||
// Start notifying the container of all key presses and commands.
|
||||
void StartRecord();
|
||||
|
||||
@ -3213,6 +3501,9 @@ public:
|
||||
void StyleSetSpec(int styleNum, const wxString& spec);
|
||||
|
||||
|
||||
// Get the font of a style.
|
||||
wxFont StyleGetFont(int style);
|
||||
|
||||
|
||||
// Set style size, face, bold, italic, and underline attributes from
|
||||
// a wxFont's attributes.
|
||||
@ -3521,6 +3812,8 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, 1674)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, 1675)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, 1676)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, 1677)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, 1678)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
#else
|
||||
enum {
|
||||
@ -3549,7 +3842,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
wxEVT_STC_HOTSPOT_CLICK,
|
||||
wxEVT_STC_HOTSPOT_DCLICK,
|
||||
wxEVT_STC_CALLTIP_CLICK,
|
||||
wxEVT_STC_AUTOCOMP_SELECTION
|
||||
wxEVT_STC_AUTOCOMP_SELECTION,
|
||||
wxEVT_STC_INDICATOR_CLICK,
|
||||
wxEVT_STC_INDICATOR_RELEASE
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -3584,6 +3879,9 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||
#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||
#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||
#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_STC
|
||||
|
@ -21,6 +21,10 @@
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#if wxUSE_DISPLAY
|
||||
#include "wx/display.h"
|
||||
#endif
|
||||
|
||||
#include "wx/encconv.h"
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/mstream.h"
|
||||
@ -155,7 +159,7 @@ void Font::Create(const char *faceName, int characterSet, int size, bool bold, b
|
||||
false,
|
||||
stc2wx(faceName),
|
||||
encoding);
|
||||
font->SetNoAntiAliasing(!extraFontFlag);
|
||||
//font->SetNoAntiAliasing(!extraFontFlag);
|
||||
id = font;
|
||||
}
|
||||
|
||||
@ -721,6 +725,19 @@ void Window::SetTitle(const char *s) {
|
||||
}
|
||||
|
||||
|
||||
// Returns rectangle of monitor pt is on
|
||||
PRectangle Window::GetMonitorRect(Point pt) {
|
||||
wxRect rect;
|
||||
if (! id) return PRectangle();
|
||||
#if wxUSE_DISPLAY
|
||||
// Get the display the point is found on
|
||||
int n = wxDisplay::GetFromPoint(wxPoint(pt.x, pt.y));
|
||||
wxDisplay dpy(n == wxNOT_FOUND ? 0 : n);
|
||||
rect = dpy.GetGeometry();
|
||||
#endif
|
||||
return PRectangleFromwxRect(rect);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Helper classes for ListBox
|
||||
|
||||
@ -1543,10 +1560,10 @@ wxString stc2wx(const char* str, size_t len)
|
||||
if (!len)
|
||||
return wxEmptyString;
|
||||
|
||||
size_t wclen = UCS2Length(str, len);
|
||||
size_t wclen = UTF16Length(str, len);
|
||||
wxWCharBuffer buffer(wclen+1);
|
||||
|
||||
size_t actualLen = UCS2FromUTF8(str, len, buffer.data(), wclen+1);
|
||||
size_t actualLen = UTF16FromUTF8(str, len, buffer.data(), wclen+1);
|
||||
return wxString(buffer.data(), actualLen);
|
||||
}
|
||||
|
||||
@ -1565,7 +1582,7 @@ const wxWX2MBbuf wx2stc(const wxString& str)
|
||||
size_t len = UTF8Length(wcstr, wclen);
|
||||
|
||||
wxCharBuffer buffer(len+1);
|
||||
UTF8FromUCS2(wcstr, wclen, buffer.data(), len);
|
||||
UTF8FromUTF16(wcstr, wclen, buffer.data(), len);
|
||||
|
||||
// TODO check NULL termination!!
|
||||
|
||||
|
@ -334,7 +334,7 @@ void ScintillaWX::DoStartDrag() {
|
||||
result = source.DoDragDrop(evt.GetDragAllowMove());
|
||||
if (result == wxDragMove && dropWentOutside)
|
||||
ClearSelection();
|
||||
inDragDrop = false;
|
||||
inDragDrop = ddNone;
|
||||
SetDragPosition(invalidPosition);
|
||||
}
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
@ -36,8 +36,10 @@
|
||||
#include "Accessor.h"
|
||||
#include "KeyWords.h"
|
||||
#endif
|
||||
#include "SplitVector.h"
|
||||
#include "Partitioning.h"
|
||||
#include "RunStyles.h"
|
||||
#include "ContractionState.h"
|
||||
#include "SVector.h"
|
||||
#include "CellBuffer.h"
|
||||
#include "CallTip.h"
|
||||
#include "KeyMap.h"
|
||||
@ -46,7 +48,9 @@
|
||||
#include "Style.h"
|
||||
#include "ViewStyle.h"
|
||||
#include "AutoComplete.h"
|
||||
#include "Decoration.h"
|
||||
#include "Document.h"
|
||||
#include "PositionCache.h"
|
||||
#include "Editor.h"
|
||||
#include "ScintillaBase.h"
|
||||
|
||||
|
@ -21,7 +21,7 @@ H_TEMPLATE = os.path.abspath('./stc.h.in')
|
||||
CPP_TEMPLATE = os.path.abspath('./stc.cpp.in')
|
||||
H_DEST = os.path.abspath('../../include/wx/stc/stc.h')
|
||||
CPP_DEST = os.path.abspath('./stc.cpp')
|
||||
DOCSTR_DEST = os.path.abspath('../../wxPython/contrib/stc/_stc_gendocs.i')
|
||||
DOCSTR_DEST = os.path.abspath('../../../wxPython/contrib/stc/_stc_gendocs.i')
|
||||
|
||||
|
||||
# Value prefixes to convert
|
||||
@ -37,16 +37,17 @@ valPrefixes = [('SCI_', ''),
|
||||
]
|
||||
|
||||
# Message function values that should have a CMD_ constant generated
|
||||
cmdValues = [ (2300, 2349),
|
||||
2011,
|
||||
cmdValues = [ 2011,
|
||||
2013,
|
||||
(2176, 2180),
|
||||
(2300, 2349),
|
||||
(2390, 2393),
|
||||
(2395, 2396),
|
||||
2404,
|
||||
(2413, 2416),
|
||||
(2426, 2442),
|
||||
(2450, 2455),
|
||||
2518,
|
||||
]
|
||||
|
||||
|
||||
@ -225,11 +226,27 @@ methodOverrideMap = {
|
||||
'SetMarginSensitiveN' : ('SetMarginSensitive', 0, 0, 0),
|
||||
'GetMarginSensitiveN' : ('GetMarginSensitive', 0, 0, 0),
|
||||
|
||||
|
||||
'StyleGetFore' : ('StyleGetForeground', 0, 0, 0),
|
||||
'StyleGetBack' : ('StyleGetBackground', 0, 0, 0),
|
||||
'StyleSetFore' : ('StyleSetForeground', 0, 0, 0),
|
||||
'StyleSetBack' : ('StyleSetBackground', 0, 0, 0),
|
||||
'SetSelFore' : ('SetSelForeground', 0, 0, 0),
|
||||
'SetSelBack' : ('SetSelBackground', 0, 0, 0),
|
||||
'SetCaretFore' : ('SetCaretForeground', 0, 0, 0),
|
||||
'StyleGetFont' :
|
||||
('StyleGetFaceName',
|
||||
'wxString %s(int style);',
|
||||
'''wxString %s(int style) {
|
||||
long msg = %s;
|
||||
long len = SendMsg(msg, style, 0);
|
||||
wxMemoryBuffer mbuf(len+1);
|
||||
char* buf = (char*)mbuf.GetWriteBuf(len+1);
|
||||
SendMsg(msg, style, (long)buf);
|
||||
mbuf.UngetWriteBuf(len);
|
||||
mbuf.AppendByte(0);
|
||||
return stc2wx(buf);''',
|
||||
('Get the font facename of a style',)),
|
||||
'StyleSetFont' : ('StyleSetFaceName', 0, 0, 0),
|
||||
'StyleSetCharacterSet' : (None, 0, 0, 0),
|
||||
|
||||
@ -266,7 +283,9 @@ methodOverrideMap = {
|
||||
'IndicGetStyle' : ('IndicatorGetStyle', 0, 0, 0),
|
||||
'IndicSetFore' : ('IndicatorSetForeground', 0, 0, 0),
|
||||
'IndicGetFore' : ('IndicatorGetForeground', 0, 0, 0),
|
||||
|
||||
'IndicSetUnder': ('IndicatorSetUnder', 0, 0, 0),
|
||||
'IndicGetUnder': ('IndicatorGetUnder', 0, 0, 0),
|
||||
|
||||
'SetWhitespaceFore' : ('SetWhitespaceForeground', 0, 0, 0),
|
||||
'SetWhitespaceBack' : ('SetWhitespaceBackground', 0, 0, 0),
|
||||
|
||||
@ -488,6 +507,8 @@ methodOverrideMap = {
|
||||
|
||||
'SetHotspotActiveFore' : ('SetHotspotActiveForeground', 0, 0, 0),
|
||||
'SetHotspotActiveBack' : ('SetHotspotActiveBackground', 0, 0, 0),
|
||||
'GetHotspotActiveFore' : ('GetHotspotActiveForeground', 0, 0, 0),
|
||||
'GetHotspotActiveBack' : ('GetHotspotActiveBackground', 0, 0, 0),
|
||||
|
||||
'GetCaretLineBack' : ('GetCaretLineBackground', 0, 0, 0),
|
||||
'SetCaretLineBack' : ('SetCaretLineBackground', 0, 0, 0),
|
||||
@ -626,6 +647,9 @@ methodOverrideMap = {
|
||||
|
||||
'LoadLexerLibrary' : (None, 0,0,0),
|
||||
|
||||
'SetPositionCache' : ('SetPositionCacheSize', 0, 0, 0),
|
||||
'GetPositionCache' : ('GetPositionCacheSize', 0, 0, 0),
|
||||
|
||||
|
||||
'' : ('', 0, 0, 0),
|
||||
|
||||
|
@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source
|
||||
distribution. All other code needed to implement Scintilla on top of
|
||||
wxWindows is located in the directory above this one.
|
||||
|
||||
The current version of the Scintilla code is 1.70
|
||||
The current version of the Scintilla code is 1.75
|
||||
|
||||
|
@ -75,4 +75,5 @@ public:
|
||||
virtual void ColourTo(unsigned int pos, int chAttr)=0;
|
||||
virtual void SetLevel(int line, int level)=0;
|
||||
virtual int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0)=0;
|
||||
virtual void IndicatorFill(int start, int end, int indicator, int value)=0;
|
||||
};
|
||||
|
@ -5,6 +5,10 @@
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle,
|
||||
WordList *keywordlists[], Accessor &styler);
|
||||
|
||||
@ -51,6 +55,10 @@ public:
|
||||
static const LexerModule *Find(const char *languageName);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Check if a character is a space.
|
||||
* This is ASCII specific but is safe with chars >= 0x80.
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file Platform.h
|
||||
** Interface to platform facilities. Also includes some basic utilities.
|
||||
** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWidgets.
|
||||
** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows.
|
||||
**/
|
||||
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
@ -12,10 +12,11 @@
|
||||
// PLAT_GTK = GTK+ on Linux or Win32
|
||||
// PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32
|
||||
// PLAT_WIN = Win32 API on Win32 OS
|
||||
// PLAT_WX is wxWidgets on any supported platform
|
||||
// PLAT_WX is wxWindows on any supported platform
|
||||
|
||||
#define PLAT_GTK 0
|
||||
#define PLAT_GTK_WIN32 0
|
||||
#define PLAT_MACOSX 0
|
||||
#define PLAT_WIN 0
|
||||
#define PLAT_WX 0
|
||||
#define PLAT_FOX 0
|
||||
@ -37,12 +38,19 @@
|
||||
#define PLAT_GTK_WIN32 1
|
||||
#endif
|
||||
|
||||
#elif defined(MACOSX)
|
||||
#undef PLAT_MACOSX
|
||||
#define PLAT_MACOSX 1
|
||||
|
||||
#else
|
||||
#undef PLAT_WIN
|
||||
#define PLAT_WIN 1
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
// Underlying the implementation of the platform classes are platform specific types.
|
||||
// Sometimes these need to be passed around by client code so they are defined here
|
||||
@ -114,6 +122,9 @@ public:
|
||||
}
|
||||
int Width() { return right - left; }
|
||||
int Height() { return bottom - top; }
|
||||
bool Empty() {
|
||||
return (Height() <= 0) || (Width() <= 0);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -302,8 +313,8 @@ private:
|
||||
Surface(const Surface &) {}
|
||||
Surface &operator=(const Surface &) { return *this; }
|
||||
public:
|
||||
Surface() {}
|
||||
virtual ~Surface() {}
|
||||
Surface() {};
|
||||
virtual ~Surface() {};
|
||||
static Surface *Allocate();
|
||||
|
||||
virtual void Init(WindowID wid)=0;
|
||||
@ -360,9 +371,23 @@ typedef void (*CallBackAction)(void*);
|
||||
class Window {
|
||||
protected:
|
||||
WindowID id;
|
||||
#if PLAT_MACOSX
|
||||
void *windowRef;
|
||||
void *control;
|
||||
#endif
|
||||
public:
|
||||
Window() : id(0), cursorLast(cursorInvalid) {}
|
||||
Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) {}
|
||||
Window() : id(0), cursorLast(cursorInvalid) {
|
||||
#if PLAT_MACOSX
|
||||
windowRef = 0;
|
||||
control = 0;
|
||||
#endif
|
||||
}
|
||||
Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) {
|
||||
#if PLAT_MACOSX
|
||||
windowRef = 0;
|
||||
control = 0;
|
||||
#endif
|
||||
}
|
||||
virtual ~Window();
|
||||
Window &operator=(WindowID id_) {
|
||||
id = id_;
|
||||
@ -383,6 +408,11 @@ public:
|
||||
enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
|
||||
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;
|
||||
};
|
||||
@ -443,7 +473,7 @@ public:
|
||||
*/
|
||||
class DynamicLibrary {
|
||||
public:
|
||||
virtual ~DynamicLibrary() {}
|
||||
virtual ~DynamicLibrary() {};
|
||||
|
||||
/// @return Pointer to function "name", or NULL on failure.
|
||||
virtual Function FindFunction(const char *name) = 0;
|
||||
@ -506,8 +536,16 @@ public:
|
||||
#ifdef NDEBUG
|
||||
#define PLATFORM_ASSERT(c) ((void)0)
|
||||
#else
|
||||
#ifdef SCI_NAMESPACE
|
||||
#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__))
|
||||
#else
|
||||
#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
// Shut up annoying Visual C++ warnings:
|
||||
#ifdef _MSC_VER
|
||||
|
@ -13,6 +13,10 @@ bool EqualCaseInsensitive(const char *a, const char *b);
|
||||
|
||||
bool isprefix(const char *target, const char *prefix);
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
struct Property {
|
||||
unsigned int hash;
|
||||
char *key;
|
||||
@ -29,7 +33,6 @@ protected:
|
||||
Property *props[hashRoots];
|
||||
Property *enumnext;
|
||||
int enumhash;
|
||||
static bool caseSensitiveFilenames;
|
||||
static unsigned int HashString(const char *s, size_t len) {
|
||||
unsigned int ret = 0;
|
||||
while (len--) {
|
||||
@ -39,7 +42,6 @@ protected:
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
static bool IncludesVar(const char *value, const char *key);
|
||||
|
||||
public:
|
||||
PropSet *superPS;
|
||||
@ -49,19 +51,12 @@ public:
|
||||
void Set(const char *keyVal);
|
||||
void Unset(const char *key, int lenKey=-1);
|
||||
void SetMultiple(const char *s);
|
||||
SString Get(const char *key);
|
||||
SString GetExpanded(const char *key);
|
||||
SString Expand(const char *withVars, int maxExpands=100);
|
||||
int GetInt(const char *key, int defaultValue=0);
|
||||
SString GetWild(const char *keybase, const char *filename);
|
||||
SString GetNewExpand(const char *keybase, const char *filename="");
|
||||
SString Get(const char *key) const;
|
||||
SString GetExpanded(const char *key) const;
|
||||
SString Expand(const char *withVars, int maxExpands=100) const;
|
||||
int GetInt(const char *key, int defaultValue=0) const;
|
||||
void Clear();
|
||||
char *ToString(); // Caller must delete[] the return value
|
||||
bool GetFirst(char **key, char **val);
|
||||
bool GetNext(char **key, char **val);
|
||||
static void SetCaseSensitiveFilenames(bool caseSensitiveFilenames_) {
|
||||
caseSensitiveFilenames = caseSensitiveFilenames_;
|
||||
}
|
||||
char *ToString() const; // Caller must delete[] the return value
|
||||
|
||||
private:
|
||||
// copy-value semantics not implemented
|
||||
@ -75,35 +70,30 @@ class WordList {
|
||||
public:
|
||||
// Each word contains at least one character - a empty word acts as sentinel at the end.
|
||||
char **words;
|
||||
char **wordsNoCase;
|
||||
char *list;
|
||||
int len;
|
||||
bool onlyLineEnds; ///< Delimited by any white space or only line ends
|
||||
bool sorted;
|
||||
bool sortedNoCase;
|
||||
int starts[256];
|
||||
WordList(bool onlyLineEnds_ = false) :
|
||||
words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
|
||||
sorted(false), sortedNoCase(false) {}
|
||||
words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
|
||||
sorted(false)
|
||||
{}
|
||||
~WordList() { Clear(); }
|
||||
operator bool() { return len ? true : false; }
|
||||
char *operator[](int ind) { return words[ind]; }
|
||||
void Clear();
|
||||
void Set(const char *s);
|
||||
char *Allocate(int size);
|
||||
void SetFromAllocated();
|
||||
bool InList(const char *s);
|
||||
bool InListAbbreviated(const char *s, const char marker);
|
||||
const char *GetNearestWord(const char *wordStart, int searchLen,
|
||||
bool ignoreCase = false, SString wordCharacters="", int wordIndex = -1);
|
||||
char *GetNearestWords(const char *wordStart, int searchLen,
|
||||
bool ignoreCase=false, char otherSeparator='\0', bool exactLen=false);
|
||||
};
|
||||
|
||||
inline bool IsAlphabetic(unsigned int ch) {
|
||||
return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
|
||||
}
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Visual C++ doesn't like the private copy idiom for disabling
|
||||
|
@ -8,11 +8,16 @@
|
||||
#ifndef SSTRING_H
|
||||
#define SSTRING_H
|
||||
|
||||
|
||||
// These functions are implemented because each platform calls them something different.
|
||||
int CompareCaseInsensitive(const char *a, const char *b);
|
||||
int CompareNCaseInsensitive(const char *a, const char *b, size_t len);
|
||||
bool EqualCaseInsensitive(const char *a, const char *b);
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
// Define another string class.
|
||||
// While it would be 'better' to use std::string, that doubles the executable size.
|
||||
// An SString may contain embedded nul characters.
|
||||
@ -277,4 +282,8 @@ inline char *StringDup(
|
||||
return SContainer::StringAllocate(s, len);
|
||||
}
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -91,6 +91,14 @@
|
||||
#define SCLEX_INNOSETUP 76
|
||||
#define SCLEX_OPAL 77
|
||||
#define SCLEX_SPICE 78
|
||||
#define SCLEX_D 79
|
||||
#define SCLEX_CMAKE 80
|
||||
#define SCLEX_GAP 81
|
||||
#define SCLEX_PLM 82
|
||||
#define SCLEX_PROGRESS 83
|
||||
#define SCLEX_ABAQUS 84
|
||||
#define SCLEX_ASYMPTOTE 85
|
||||
#define SCLEX_R 86
|
||||
#define SCLEX_AUTOMATIC 1000
|
||||
#define SCE_P_DEFAULT 0
|
||||
#define SCE_P_COMMENTLINE 1
|
||||
@ -128,6 +136,24 @@
|
||||
#define SCE_C_COMMENTDOCKEYWORD 17
|
||||
#define SCE_C_COMMENTDOCKEYWORDERROR 18
|
||||
#define SCE_C_GLOBALCLASS 19
|
||||
#define SCE_D_DEFAULT 0
|
||||
#define SCE_D_COMMENT 1
|
||||
#define SCE_D_COMMENTLINE 2
|
||||
#define SCE_D_COMMENTDOC 3
|
||||
#define SCE_D_COMMENTNESTED 4
|
||||
#define SCE_D_NUMBER 5
|
||||
#define SCE_D_WORD 6
|
||||
#define SCE_D_WORD2 7
|
||||
#define SCE_D_WORD3 8
|
||||
#define SCE_D_TYPEDEF 9
|
||||
#define SCE_D_STRING 10
|
||||
#define SCE_D_STRINGEOL 11
|
||||
#define SCE_D_CHARACTER 12
|
||||
#define SCE_D_OPERATOR 13
|
||||
#define SCE_D_IDENTIFIER 14
|
||||
#define SCE_D_COMMENTLINEDOC 15
|
||||
#define SCE_D_COMMENTDOCKEYWORD 16
|
||||
#define SCE_D_COMMENTDOCKEYWORDERROR 17
|
||||
#define SCE_TCL_DEFAULT 0
|
||||
#define SCE_TCL_COMMENT 1
|
||||
#define SCE_TCL_COMMENTLINE 2
|
||||
@ -293,6 +319,9 @@
|
||||
#define SCE_PL_STRING_QR 29
|
||||
#define SCE_PL_STRING_QW 30
|
||||
#define SCE_PL_POD_VERB 31
|
||||
#define SCE_PL_SUB_PROTOTYPE 40
|
||||
#define SCE_PL_FORMAT_IDENT 41
|
||||
#define SCE_PL_FORMAT 42
|
||||
#define SCE_RB_DEFAULT 0
|
||||
#define SCE_RB_ERROR 1
|
||||
#define SCE_RB_COMMENTLINE 2
|
||||
@ -398,6 +427,7 @@
|
||||
#define SCE_ERR_ABSF 18
|
||||
#define SCE_ERR_TIDY 19
|
||||
#define SCE_ERR_JAVA_STACK 20
|
||||
#define SCE_ERR_VALUE 21
|
||||
#define SCE_BAT_DEFAULT 0
|
||||
#define SCE_BAT_COMMENT 1
|
||||
#define SCE_BAT_WORD 2
|
||||
@ -710,6 +740,7 @@
|
||||
#define SCE_YAML_DOCUMENT 6
|
||||
#define SCE_YAML_TEXT 7
|
||||
#define SCE_YAML_ERROR 8
|
||||
#define SCE_YAML_OPERATOR 9
|
||||
#define SCE_TEX_DEFAULT 0
|
||||
#define SCE_TEX_SPECIAL 1
|
||||
#define SCE_TEX_GROUP 2
|
||||
@ -927,6 +958,7 @@
|
||||
#define SCE_T3_USER1 17
|
||||
#define SCE_T3_USER2 18
|
||||
#define SCE_T3_USER3 19
|
||||
#define SCE_T3_BRACE 20
|
||||
#define SCE_REBOL_DEFAULT 0
|
||||
#define SCE_REBOL_COMMENTLINE 1
|
||||
#define SCE_REBOL_COMMENTBLOCK 2
|
||||
@ -1067,6 +1099,110 @@
|
||||
#define SCE_SPICE_DELIMITER 6
|
||||
#define SCE_SPICE_VALUE 7
|
||||
#define SCE_SPICE_COMMENTLINE 8
|
||||
#define SCE_CMAKE_DEFAULT 0
|
||||
#define SCE_CMAKE_COMMENT 1
|
||||
#define SCE_CMAKE_STRINGDQ 2
|
||||
#define SCE_CMAKE_STRINGLQ 3
|
||||
#define SCE_CMAKE_STRINGRQ 4
|
||||
#define SCE_CMAKE_COMMANDS 5
|
||||
#define SCE_CMAKE_PARAMETERS 6
|
||||
#define SCE_CMAKE_VARIABLE 7
|
||||
#define SCE_CMAKE_USERDEFINED 8
|
||||
#define SCE_CMAKE_WHILEDEF 9
|
||||
#define SCE_CMAKE_FOREACHDEF 10
|
||||
#define SCE_CMAKE_IFDEFINEDEF 11
|
||||
#define SCE_CMAKE_MACRODEF 12
|
||||
#define SCE_CMAKE_STRINGVAR 13
|
||||
#define SCE_CMAKE_NUMBER 14
|
||||
#define SCE_GAP_DEFAULT 0
|
||||
#define SCE_GAP_IDENTIFIER 1
|
||||
#define SCE_GAP_KEYWORD 2
|
||||
#define SCE_GAP_KEYWORD2 3
|
||||
#define SCE_GAP_KEYWORD3 4
|
||||
#define SCE_GAP_KEYWORD4 5
|
||||
#define SCE_GAP_STRING 6
|
||||
#define SCE_GAP_CHAR 7
|
||||
#define SCE_GAP_OPERATOR 8
|
||||
#define SCE_GAP_COMMENT 9
|
||||
#define SCE_GAP_NUMBER 10
|
||||
#define SCE_GAP_STRINGEOL 11
|
||||
#define SCE_PLM_DEFAULT 0
|
||||
#define SCE_PLM_COMMENT 1
|
||||
#define SCE_PLM_STRING 2
|
||||
#define SCE_PLM_NUMBER 3
|
||||
#define SCE_PLM_IDENTIFIER 4
|
||||
#define SCE_PLM_OPERATOR 5
|
||||
#define SCE_PLM_CONTROL 6
|
||||
#define SCE_PLM_KEYWORD 7
|
||||
#define SCE_4GL_DEFAULT 0
|
||||
#define SCE_4GL_NUMBER 1
|
||||
#define SCE_4GL_WORD 2
|
||||
#define SCE_4GL_STRING 3
|
||||
#define SCE_4GL_CHARACTER 4
|
||||
#define SCE_4GL_PREPROCESSOR 5
|
||||
#define SCE_4GL_OPERATOR 6
|
||||
#define SCE_4GL_IDENTIFIER 7
|
||||
#define SCE_4GL_BLOCK 8
|
||||
#define SCE_4GL_END 9
|
||||
#define SCE_4GL_COMMENT1 10
|
||||
#define SCE_4GL_COMMENT2 11
|
||||
#define SCE_4GL_COMMENT3 12
|
||||
#define SCE_4GL_COMMENT4 13
|
||||
#define SCE_4GL_COMMENT5 14
|
||||
#define SCE_4GL_COMMENT6 15
|
||||
#define SCE_4GL_DEFAULT_ 16
|
||||
#define SCE_4GL_NUMBER_ 17
|
||||
#define SCE_4GL_WORD_ 18
|
||||
#define SCE_4GL_STRING_ 19
|
||||
#define SCE_4GL_CHARACTER_ 20
|
||||
#define SCE_4GL_PREPROCESSOR_ 21
|
||||
#define SCE_4GL_OPERATOR_ 22
|
||||
#define SCE_4GL_IDENTIFIER_ 23
|
||||
#define SCE_4GL_BLOCK_ 24
|
||||
#define SCE_4GL_END_ 25
|
||||
#define SCE_4GL_COMMENT1_ 26
|
||||
#define SCE_4GL_COMMENT2_ 27
|
||||
#define SCE_4GL_COMMENT3_ 28
|
||||
#define SCE_4GL_COMMENT4_ 29
|
||||
#define SCE_4GL_COMMENT5_ 30
|
||||
#define SCE_4GL_COMMENT6_ 31
|
||||
#define SCE_ABAQUS_DEFAULT 0
|
||||
#define SCE_ABAQUS_COMMENT 1
|
||||
#define SCE_ABAQUS_COMMENTBLOCK 2
|
||||
#define SCE_ABAQUS_NUMBER 3
|
||||
#define SCE_ABAQUS_STRING 4
|
||||
#define SCE_ABAQUS_OPERATOR 5
|
||||
#define SCE_ABAQUS_WORD 6
|
||||
#define SCE_ABAQUS_PROCESSOR 7
|
||||
#define SCE_ABAQUS_COMMAND 8
|
||||
#define SCE_ABAQUS_SLASHCOMMAND 9
|
||||
#define SCE_ABAQUS_STARCOMMAND 10
|
||||
#define SCE_ABAQUS_ARGUMENT 11
|
||||
#define SCE_ABAQUS_FUNCTION 12
|
||||
#define SCE_ASY_DEFAULT 0
|
||||
#define SCE_ASY_COMMENT 1
|
||||
#define SCE_ASY_COMMENTLINE 2
|
||||
#define SCE_ASY_NUMBER 3
|
||||
#define SCE_ASY_WORD 4
|
||||
#define SCE_ASY_STRING 5
|
||||
#define SCE_ASY_CHARACTER 6
|
||||
#define SCE_ASY_OPERATOR 7
|
||||
#define SCE_ASY_IDENTIFIER 8
|
||||
#define SCE_ASY_STRINGEOL 9
|
||||
#define SCE_ASY_COMMENTLINEDOC 10
|
||||
#define SCE_ASY_WORD2 11
|
||||
#define SCE_R_DEFAULT 0
|
||||
#define SCE_R_COMMENT 1
|
||||
#define SCE_R_KWORD 2
|
||||
#define SCE_R_BASEKWORD 3
|
||||
#define SCE_R_OTHERKWORD 4
|
||||
#define SCE_R_NUMBER 5
|
||||
#define SCE_R_STRING 6
|
||||
#define SCE_R_STRING2 7
|
||||
#define SCE_R_OPERATOR 8
|
||||
#define SCE_R_IDENTIFIER 9
|
||||
#define SCE_R_INFIX 10
|
||||
#define SCE_R_INFIXEOL 11
|
||||
#define SCLEX_ASP 29
|
||||
#define SCLEX_PHP 30
|
||||
//--Autogenerated -- end of section automatically generated from Scintilla.iface
|
||||
|
@ -159,7 +159,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define STYLE_INDENTGUIDE 37
|
||||
#define STYLE_CALLTIP 38
|
||||
#define STYLE_LASTPREDEFINED 39
|
||||
#define STYLE_MAX 127
|
||||
#define STYLE_MAX 255
|
||||
#define SC_CHARSET_ANSI 0
|
||||
#define SC_CHARSET_DEFAULT 1
|
||||
#define SC_CHARSET_BALTIC 186
|
||||
@ -194,6 +194,19 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SC_CASE_MIXED 0
|
||||
#define SC_CASE_UPPER 1
|
||||
#define SC_CASE_LOWER 2
|
||||
#define SCI_STYLEGETFORE 2481
|
||||
#define SCI_STYLEGETBACK 2482
|
||||
#define SCI_STYLEGETBOLD 2483
|
||||
#define SCI_STYLEGETITALIC 2484
|
||||
#define SCI_STYLEGETSIZE 2485
|
||||
#define SCI_STYLEGETFONT 2486
|
||||
#define SCI_STYLEGETEOLFILLED 2487
|
||||
#define SCI_STYLEGETUNDERLINE 2488
|
||||
#define SCI_STYLEGETCASE 2489
|
||||
#define SCI_STYLEGETCHARACTERSET 2490
|
||||
#define SCI_STYLEGETVISIBLE 2491
|
||||
#define SCI_STYLEGETCHANGEABLE 2492
|
||||
#define SCI_STYLEGETHOTSPOT 2493
|
||||
#define SCI_STYLESETCASE 2060
|
||||
#define SCI_STYLESETCHARACTERSET 2066
|
||||
#define SCI_STYLESETHOTSPOT 2409
|
||||
@ -201,6 +214,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_SETSELBACK 2068
|
||||
#define SCI_GETSELALPHA 2477
|
||||
#define SCI_SETSELALPHA 2478
|
||||
#define SCI_GETSELEOLFILLED 2479
|
||||
#define SCI_SETSELEOLFILLED 2480
|
||||
#define SCI_SETCARETFORE 2069
|
||||
#define SCI_ASSIGNCMDKEY 2070
|
||||
#define SCI_CLEARCMDKEY 2071
|
||||
@ -212,7 +227,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_SETWORDCHARS 2077
|
||||
#define SCI_BEGINUNDOACTION 2078
|
||||
#define SCI_ENDUNDOACTION 2079
|
||||
#define INDIC_MAX 7
|
||||
#define INDIC_PLAIN 0
|
||||
#define INDIC_SQUIGGLE 1
|
||||
#define INDIC_TT 2
|
||||
@ -221,6 +235,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define INDIC_HIDDEN 5
|
||||
#define INDIC_BOX 6
|
||||
#define INDIC_ROUNDBOX 7
|
||||
#define INDIC_MAX 31
|
||||
#define INDIC_CONTAINER 8
|
||||
#define INDIC0_MASK 0x20
|
||||
#define INDIC1_MASK 0x40
|
||||
#define INDIC2_MASK 0x80
|
||||
@ -229,6 +245,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_INDICGETSTYLE 2081
|
||||
#define SCI_INDICSETFORE 2082
|
||||
#define SCI_INDICGETFORE 2083
|
||||
#define SCI_INDICSETUNDER 2510
|
||||
#define SCI_INDICGETUNDER 2511
|
||||
#define SCI_SETWHITESPACEFORE 2084
|
||||
#define SCI_SETWHITESPACEBACK 2085
|
||||
#define SCI_SETSTYLEBITS 2090
|
||||
@ -280,6 +298,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETCOLUMN 2129
|
||||
#define SCI_SETHSCROLLBAR 2130
|
||||
#define SCI_GETHSCROLLBAR 2131
|
||||
#define SC_IV_NONE 0
|
||||
#define SC_IV_REAL 1
|
||||
#define SC_IV_LOOKFORWARD 2
|
||||
#define SC_IV_LOOKBOTH 3
|
||||
#define SCI_SETINDENTATIONGUIDES 2132
|
||||
#define SCI_GETINDENTATIONGUIDES 2133
|
||||
#define SCI_SETHIGHLIGHTGUIDE 2134
|
||||
@ -430,6 +452,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETLAYOUTCACHE 2273
|
||||
#define SCI_SETSCROLLWIDTH 2274
|
||||
#define SCI_GETSCROLLWIDTH 2275
|
||||
#define SCI_SETSCROLLWIDTHTRACKING 2516
|
||||
#define SCI_GETSCROLLWIDTHTRACKING 2517
|
||||
#define SCI_TEXTWIDTH 2276
|
||||
#define SCI_SETENDATLASTLINE 2277
|
||||
#define SCI_GETENDATLASTLINE 2278
|
||||
@ -481,6 +505,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_ZOOMOUT 2334
|
||||
#define SCI_DELWORDLEFT 2335
|
||||
#define SCI_DELWORDRIGHT 2336
|
||||
#define SCI_DELWORDRIGHTEND 2518
|
||||
#define SCI_LINECUT 2337
|
||||
#define SCI_LINEDELETE 2338
|
||||
#define SCI_LINETRANSPOSE 2339
|
||||
@ -566,9 +591,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_SETPRINTWRAPMODE 2406
|
||||
#define SCI_GETPRINTWRAPMODE 2407
|
||||
#define SCI_SETHOTSPOTACTIVEFORE 2410
|
||||
#define SCI_GETHOTSPOTACTIVEFORE 2494
|
||||
#define SCI_SETHOTSPOTACTIVEBACK 2411
|
||||
#define SCI_GETHOTSPOTACTIVEBACK 2495
|
||||
#define SCI_SETHOTSPOTACTIVEUNDERLINE 2412
|
||||
#define SCI_GETHOTSPOTACTIVEUNDERLINE 2496
|
||||
#define SCI_SETHOTSPOTSINGLELINE 2421
|
||||
#define SCI_GETHOTSPOTSINGLELINE 2497
|
||||
#define SCI_PARADOWN 2413
|
||||
#define SCI_PARADOWNEXTEND 2414
|
||||
#define SCI_PARAUP 2415
|
||||
@ -620,6 +649,23 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SC_ALPHA_NOALPHA 256
|
||||
#define SCI_SETCARETLINEBACKALPHA 2470
|
||||
#define SCI_GETCARETLINEBACKALPHA 2471
|
||||
#define CARETSTYLE_INVISIBLE 0
|
||||
#define CARETSTYLE_LINE 1
|
||||
#define CARETSTYLE_BLOCK 2
|
||||
#define SCI_SETCARETSTYLE 2512
|
||||
#define SCI_GETCARETSTYLE 2513
|
||||
#define SCI_SETINDICATORCURRENT 2500
|
||||
#define SCI_GETINDICATORCURRENT 2501
|
||||
#define SCI_SETINDICATORVALUE 2502
|
||||
#define SCI_GETINDICATORVALUE 2503
|
||||
#define SCI_INDICATORFILLRANGE 2504
|
||||
#define SCI_INDICATORCLEARRANGE 2505
|
||||
#define SCI_INDICATORALLONFOR 2506
|
||||
#define SCI_INDICATORVALUEAT 2507
|
||||
#define SCI_INDICATORSTART 2508
|
||||
#define SCI_INDICATOREND 2509
|
||||
#define SCI_SETPOSITIONCACHE 2514
|
||||
#define SCI_GETPOSITIONCACHE 2515
|
||||
#define SCI_STARTRECORD 3001
|
||||
#define SCI_STOPRECORD 3002
|
||||
#define SCI_SETLEXER 4001
|
||||
@ -647,7 +693,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SC_MOD_BEFOREINSERT 0x400
|
||||
#define SC_MOD_BEFOREDELETE 0x800
|
||||
#define SC_MULTILINEUNDOREDO 0x1000
|
||||
#define SC_MODEVENTMASKALL 0x1FFF
|
||||
#define SC_STARTACTION 0x2000
|
||||
#define SC_MOD_CHANGEINDICATOR 0x4000
|
||||
#define SC_MOD_CHANGELINESTATE 0x8000
|
||||
#define SC_MODEVENTMASKALL 0xFFFF
|
||||
#define SCEN_CHANGE 768
|
||||
#define SCEN_SETFOCUS 512
|
||||
#define SCEN_KILLFOCUS 256
|
||||
@ -668,6 +717,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCK_ADD 310
|
||||
#define SCK_SUBTRACT 311
|
||||
#define SCK_DIVIDE 312
|
||||
#define SCK_WIN 313
|
||||
#define SCK_RWIN 314
|
||||
#define SCK_MENU 315
|
||||
#define SCMOD_NORM 0
|
||||
#define SCMOD_SHIFT 1
|
||||
#define SCMOD_CTRL 2
|
||||
@ -694,12 +746,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCN_HOTSPOTDOUBLECLICK 2020
|
||||
#define SCN_CALLTIPCLICK 2021
|
||||
#define SCN_AUTOCSELECTION 2022
|
||||
#define SCN_INDICATORCLICK 2023
|
||||
#define SCN_INDICATORRELEASE 2024
|
||||
//--Autogenerated -- end of section automatically generated from Scintilla.iface
|
||||
|
||||
// These structures are defined to be exactly the same shape as the Win32
|
||||
// CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
|
||||
// So older code that treats Scintilla as a RichEdit will work.
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
struct CharacterRange {
|
||||
long cpMin;
|
||||
long cpMax;
|
||||
@ -761,6 +819,10 @@ struct SCNotification {
|
||||
int y; // SCN_DWELLSTART, SCN_DWELLEND
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
// Deprecation section listing all API features that are deprecated and will
|
||||
// will be removed completely in a future version.
|
||||
// To enable these features define INCLUDE_DEPRECATED_FEATURES
|
||||
|
@ -360,7 +360,7 @@ val STYLE_CONTROLCHAR=36
|
||||
val STYLE_INDENTGUIDE=37
|
||||
val STYLE_CALLTIP=38
|
||||
val STYLE_LASTPREDEFINED=39
|
||||
val STYLE_MAX=127
|
||||
val STYLE_MAX=255
|
||||
|
||||
# Character set identifiers are used in StyleSetCharacterSet.
|
||||
# The values are the same as the Windows *_CHARSET values.
|
||||
@ -421,6 +421,48 @@ enu CaseVisible=SC_CASE_
|
||||
val SC_CASE_MIXED=0
|
||||
val SC_CASE_UPPER=1
|
||||
val SC_CASE_LOWER=2
|
||||
|
||||
# Get the foreground colour of a style.
|
||||
get colour StyleGetFore=2481(int style,)
|
||||
|
||||
# Get the background colour of a style.
|
||||
get colour StyleGetBack=2482(int style,)
|
||||
|
||||
# Get is a style bold or not.
|
||||
get bool StyleGetBold=2483(int style,)
|
||||
|
||||
# Get is a style italic or not.
|
||||
get bool StyleGetItalic=2484(int style,)
|
||||
|
||||
# Get the size of characters of a style.
|
||||
get int StyleGetSize=2485(int style,)
|
||||
|
||||
# Get the font of a style.
|
||||
# Returns the length of the fontName
|
||||
fun int StyleGetFont=2486(int style, stringresult fontName)
|
||||
|
||||
# Get is a style to have its end of line filled or not.
|
||||
get bool StyleGetEOLFilled=2487(int style,)
|
||||
|
||||
# Get is a style underlined or not.
|
||||
get bool StyleGetUnderline=2488(int style,)
|
||||
|
||||
# Get is a style mixed case, or to force upper or lower case.
|
||||
get int StyleGetCase=2489(int style,)
|
||||
|
||||
# Get the character set of the font in a style.
|
||||
get int StyleGetCharacterSet=2490(int style,)
|
||||
|
||||
# Get is a style visible or not.
|
||||
get bool StyleGetVisible=2491(int style,)
|
||||
|
||||
# Get is a style changeable or not (read only).
|
||||
# Experimental feature, currently buggy.
|
||||
get bool StyleGetChangeable=2492(int style,)
|
||||
|
||||
# Get is a style a hotspot or not.
|
||||
get bool StyleGetHotSpot=2493(int style,)
|
||||
|
||||
# Set a style to be mixed case, or to force upper or lower case.
|
||||
set void StyleSetCase=2060(int style, int caseForce)
|
||||
|
||||
@ -442,6 +484,12 @@ get int GetSelAlpha=2477(,)
|
||||
# Set the alpha of the selection.
|
||||
set void SetSelAlpha=2478(int alpha,)
|
||||
|
||||
# Is the selection end of line filled?
|
||||
get bool GetSelEOLFilled=2479(,)
|
||||
|
||||
# Set the selection to have its end of line filled or not.
|
||||
set void SetSelEOLFilled=2480(bool filled,)
|
||||
|
||||
# Set the foreground colour of the caret.
|
||||
set void SetCaretFore=2069(colour fore,)
|
||||
|
||||
@ -477,8 +525,8 @@ fun void BeginUndoAction=2078(,)
|
||||
# End a sequence of actions that is undone and redone as a unit.
|
||||
fun void EndUndoAction=2079(,)
|
||||
|
||||
# Indicator style enumeration and some constants
|
||||
enu IndicatorStyle=INDIC_
|
||||
val INDIC_MAX=7
|
||||
val INDIC_PLAIN=0
|
||||
val INDIC_SQUIGGLE=1
|
||||
val INDIC_TT=2
|
||||
@ -487,6 +535,8 @@ val INDIC_STRIKE=4
|
||||
val INDIC_HIDDEN=5
|
||||
val INDIC_BOX=6
|
||||
val INDIC_ROUNDBOX=7
|
||||
val INDIC_MAX=31
|
||||
val INDIC_CONTAINER=8
|
||||
val INDIC0_MASK=0x20
|
||||
val INDIC1_MASK=0x40
|
||||
val INDIC2_MASK=0x80
|
||||
@ -504,6 +554,12 @@ set void IndicSetFore=2082(int indic, colour fore)
|
||||
# Retrieve the foreground colour of an indicator.
|
||||
get colour IndicGetFore=2083(int indic,)
|
||||
|
||||
# Set an indicator to draw under text or over(default).
|
||||
set void IndicSetUnder=2510(int indic, bool under)
|
||||
|
||||
# Retrieve whether indicator drawn under or over text.
|
||||
get bool IndicGetUnder=2511(int indic,)
|
||||
|
||||
# Set the foreground colour of all whitespace and whether to use this setting.
|
||||
fun void SetWhitespaceFore=2084(bool useSetting, colour fore)
|
||||
|
||||
@ -671,11 +727,17 @@ set void SetHScrollBar=2130(bool show,)
|
||||
# Is the horizontal scroll bar visible?
|
||||
get bool GetHScrollBar=2131(,)
|
||||
|
||||
enu IndentView=SC_IV_
|
||||
val SC_IV_NONE=0
|
||||
val SC_IV_REAL=1
|
||||
val SC_IV_LOOKFORWARD=2
|
||||
val SC_IV_LOOKBOTH=3
|
||||
|
||||
# Show or hide indentation guides.
|
||||
set void SetIndentationGuides=2132(bool show,)
|
||||
set void SetIndentationGuides=2132(int indentView,)
|
||||
|
||||
# Are the indentation guides visible?
|
||||
get bool GetIndentationGuides=2133(,)
|
||||
get int GetIndentationGuides=2133(,)
|
||||
|
||||
# Set the highlighted indentation guide column.
|
||||
# 0 = no highlighted guide.
|
||||
@ -1087,6 +1149,12 @@ set void SetScrollWidth=2274(int pixelWidth,)
|
||||
# Retrieve the document width assumed for scrolling.
|
||||
get int GetScrollWidth=2275(,)
|
||||
|
||||
# Sets whether the maximum width line displayed is used to set scroll width.
|
||||
set void SetScrollWidthTracking=2516(bool tracking,)
|
||||
|
||||
# Retrieve whether the scroll width tracks wide lines.
|
||||
get bool GetScrollWidthTracking=2517(,)
|
||||
|
||||
# Measure the pixel width of some text in a particular style.
|
||||
# NUL terminated text argument.
|
||||
# Does not handle tab or control characters.
|
||||
@ -1250,6 +1318,9 @@ fun void DelWordLeft=2335(,)
|
||||
# Delete the word to the right of the caret.
|
||||
fun void DelWordRight=2336(,)
|
||||
|
||||
# Delete the word to the right of the caret, but not the trailing non-word characters.
|
||||
fun void DelWordRightEnd=2518(,)
|
||||
|
||||
# Cut the line containing the caret.
|
||||
fun void LineCut=2337(,)
|
||||
|
||||
@ -1505,15 +1576,27 @@ get int GetPrintWrapMode=2407(,)
|
||||
# Set a fore colour for active hotspots.
|
||||
set void SetHotspotActiveFore=2410(bool useSetting, colour fore)
|
||||
|
||||
# Get the fore colour for active hotspots.
|
||||
get colour GetHotspotActiveFore=2494(,)
|
||||
|
||||
# Set a back colour for active hotspots.
|
||||
set void SetHotspotActiveBack=2411(bool useSetting, colour back)
|
||||
|
||||
# Get the back colour for active hotspots.
|
||||
get colour GetHotspotActiveBack=2495(,)
|
||||
|
||||
# Enable / Disable underlining active hotspots.
|
||||
set void SetHotspotActiveUnderline=2412(bool underline,)
|
||||
|
||||
# Get whether underlining for active hotspots.
|
||||
get bool GetHotspotActiveUnderline=2496(,)
|
||||
|
||||
# Limit hotspots to single line so hotspots on two lines don't merge.
|
||||
set void SetHotspotSingleLine=2421(bool singleLine,)
|
||||
|
||||
# Get the HotspotSingleLine property
|
||||
get bool GetHotspotSingleLine=2497(,)
|
||||
|
||||
# Move caret between paragraphs (delimited by empty lines).
|
||||
fun void ParaDown=2413(,)
|
||||
fun void ParaDownExtend=2414(,)
|
||||
@ -1534,7 +1617,7 @@ fun void CopyRange=2419(position start, position end)
|
||||
# Copy argument text to the clipboard.
|
||||
fun void CopyText=2420(int length, string text)
|
||||
|
||||
# Selection modes
|
||||
# Selection Modes
|
||||
enu SelectionMode=SC_SEL_
|
||||
val SC_SEL_STREAM=0
|
||||
val SC_SEL_RECTANGLE=1
|
||||
@ -1667,6 +1750,54 @@ set void SetCaretLineBackAlpha=2470(int alpha,)
|
||||
# Get the background alpha of the caret line.
|
||||
get int GetCaretLineBackAlpha=2471(,)
|
||||
|
||||
# Caret Styles
|
||||
enu CaretStyle=CARETSTYLE_
|
||||
val CARETSTYLE_INVISIBLE=0
|
||||
val CARETSTYLE_LINE=1
|
||||
val CARETSTYLE_BLOCK=2
|
||||
|
||||
# Set the style of the caret to be drawn.
|
||||
set void SetCaretStyle=2512(int caretStyle,)
|
||||
|
||||
# Returns the current style of the caret.
|
||||
get int GetCaretStyle=2513(,)
|
||||
|
||||
# Set the indicator used for IndicatorFillRange and IndicatorClearRange
|
||||
set void SetIndicatorCurrent=2500(int indicator,)
|
||||
|
||||
# Get the current indicator
|
||||
get int GetIndicatorCurrent=2501(,)
|
||||
|
||||
# Set the value used for IndicatorFillRange
|
||||
set void SetIndicatorValue=2502(int value,)
|
||||
|
||||
# Get the current indicator vaue
|
||||
get int GetIndicatorValue=2503(,)
|
||||
|
||||
# Turn a indicator on over a range.
|
||||
fun void IndicatorFillRange=2504(int position, int fillLength)
|
||||
|
||||
# Turn a indicator off over a range.
|
||||
fun void IndicatorClearRange=2505(int position, int clearLength)
|
||||
|
||||
# Are any indicators present at position?
|
||||
fun int IndicatorAllOnFor=2506(int position,)
|
||||
|
||||
# What value does a particular indicator have at at a position?
|
||||
fun int IndicatorValueAt=2507(int indicator, int position)
|
||||
|
||||
# Where does a particular indicator start?
|
||||
fun int IndicatorStart=2508(int indicator, int position)
|
||||
|
||||
# Where does a particular indicator end?
|
||||
fun int IndicatorEnd=2509(int indicator, int position)
|
||||
|
||||
# Set number of entries in position cache
|
||||
set void SetPositionCache=2514(int size,)
|
||||
|
||||
# How many entries are allocated to the position cache?
|
||||
get int GetPositionCache=2515(,)
|
||||
|
||||
# Start notifying the container of all key presses and commands.
|
||||
fun void StartRecord=3001(,)
|
||||
|
||||
@ -1729,7 +1860,10 @@ val SC_MOD_CHANGEMARKER=0x200
|
||||
val SC_MOD_BEFOREINSERT=0x400
|
||||
val SC_MOD_BEFOREDELETE=0x800
|
||||
val SC_MULTILINEUNDOREDO=0x1000
|
||||
val SC_MODEVENTMASKALL=0x1FFF
|
||||
val SC_STARTACTION=0x2000
|
||||
val SC_MOD_CHANGEINDICATOR=0x4000
|
||||
val SC_MOD_CHANGELINESTATE=0x8000
|
||||
val SC_MODEVENTMASKALL=0xFFFF
|
||||
|
||||
# For compatibility, these go through the COMMAND notification rather than NOTIFY
|
||||
# and should have had exactly the same values as the EN_* constants.
|
||||
@ -1761,6 +1895,9 @@ val SCK_RETURN=13
|
||||
val SCK_ADD=310
|
||||
val SCK_SUBTRACT=311
|
||||
val SCK_DIVIDE=312
|
||||
val SCK_WIN=313
|
||||
val SCK_RWIN=314
|
||||
val SCK_MENU=315
|
||||
|
||||
enu KeyMod=SCMOD_
|
||||
val SCMOD_NORM=0
|
||||
@ -1848,6 +1985,14 @@ val SCLEX_FREEBASIC=75
|
||||
val SCLEX_INNOSETUP=76
|
||||
val SCLEX_OPAL=77
|
||||
val SCLEX_SPICE=78
|
||||
val SCLEX_D=79
|
||||
val SCLEX_CMAKE=80
|
||||
val SCLEX_GAP=81
|
||||
val SCLEX_PLM=82
|
||||
val SCLEX_PROGRESS=83
|
||||
val SCLEX_ABAQUS=84
|
||||
val SCLEX_ASYMPTOTE=85
|
||||
val SCLEX_R=86
|
||||
|
||||
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||
@ -1894,6 +2039,26 @@ val SCE_C_WORD2=16
|
||||
val SCE_C_COMMENTDOCKEYWORD=17
|
||||
val SCE_C_COMMENTDOCKEYWORDERROR=18
|
||||
val SCE_C_GLOBALCLASS=19
|
||||
# Lexical states for SCLEX_D
|
||||
lex D=SCLEX_D SCE_D_
|
||||
val SCE_D_DEFAULT=0
|
||||
val SCE_D_COMMENT=1
|
||||
val SCE_D_COMMENTLINE=2
|
||||
val SCE_D_COMMENTDOC=3
|
||||
val SCE_D_COMMENTNESTED=4
|
||||
val SCE_D_NUMBER=5
|
||||
val SCE_D_WORD=6
|
||||
val SCE_D_WORD2=7
|
||||
val SCE_D_WORD3=8
|
||||
val SCE_D_TYPEDEF=9
|
||||
val SCE_D_STRING=10
|
||||
val SCE_D_STRINGEOL=11
|
||||
val SCE_D_CHARACTER=12
|
||||
val SCE_D_OPERATOR=13
|
||||
val SCE_D_IDENTIFIER=14
|
||||
val SCE_D_COMMENTLINEDOC=15
|
||||
val SCE_D_COMMENTDOCKEYWORD=16
|
||||
val SCE_D_COMMENTDOCKEYWORDERROR=17
|
||||
# Lexical states for SCLEX_TCL
|
||||
lex TCL=SCLEX_TCL SCE_TCL_
|
||||
val SCE_TCL_DEFAULT=0
|
||||
@ -2080,6 +2245,9 @@ val SCE_PL_STRING_QX=28
|
||||
val SCE_PL_STRING_QR=29
|
||||
val SCE_PL_STRING_QW=30
|
||||
val SCE_PL_POD_VERB=31
|
||||
val SCE_PL_SUB_PROTOTYPE=40
|
||||
val SCE_PL_FORMAT_IDENT=41
|
||||
val SCE_PL_FORMAT=42
|
||||
# Lexical states for SCLEX_RUBY
|
||||
lex Ruby=SCLEX_RUBY SCE_RB_
|
||||
val SCE_RB_DEFAULT=0
|
||||
@ -2199,6 +2367,7 @@ val SCE_ERR_IFORT=17
|
||||
val SCE_ERR_ABSF=18
|
||||
val SCE_ERR_TIDY=19
|
||||
val SCE_ERR_JAVA_STACK=20
|
||||
val SCE_ERR_VALUE=21
|
||||
# Lexical states for SCLEX_BATCH
|
||||
lex Batch=SCLEX_BATCH SCE_BAT_
|
||||
val SCE_BAT_DEFAULT=0
|
||||
@ -2564,6 +2733,7 @@ val SCE_YAML_REFERENCE=5
|
||||
val SCE_YAML_DOCUMENT=6
|
||||
val SCE_YAML_TEXT=7
|
||||
val SCE_YAML_ERROR=8
|
||||
val SCE_YAML_OPERATOR=9
|
||||
# Lexical states for SCLEX_TEX
|
||||
lex TeX=SCLEX_TEX SCE_TEX_
|
||||
val SCE_TEX_DEFAULT=0
|
||||
@ -2813,6 +2983,7 @@ val SCE_T3_HTML_STRING=16
|
||||
val SCE_T3_USER1=17
|
||||
val SCE_T3_USER2=18
|
||||
val SCE_T3_USER3=19
|
||||
val SCE_T3_BRACE=20
|
||||
# Lexical states for SCLEX_REBOL
|
||||
lex Rebol=SCLEX_REBOL SCE_REBOL_
|
||||
val SCE_REBOL_DEFAULT=0
|
||||
@ -2969,6 +3140,124 @@ val SCE_SPICE_NUMBER=5
|
||||
val SCE_SPICE_DELIMITER=6
|
||||
val SCE_SPICE_VALUE=7
|
||||
val SCE_SPICE_COMMENTLINE=8
|
||||
# Lexical states for SCLEX_CMAKE
|
||||
lex CMAKE=SCLEX_CMAKE SCE_CMAKE_
|
||||
val SCE_CMAKE_DEFAULT=0
|
||||
val SCE_CMAKE_COMMENT=1
|
||||
val SCE_CMAKE_STRINGDQ=2
|
||||
val SCE_CMAKE_STRINGLQ=3
|
||||
val SCE_CMAKE_STRINGRQ=4
|
||||
val SCE_CMAKE_COMMANDS=5
|
||||
val SCE_CMAKE_PARAMETERS=6
|
||||
val SCE_CMAKE_VARIABLE=7
|
||||
val SCE_CMAKE_USERDEFINED=8
|
||||
val SCE_CMAKE_WHILEDEF=9
|
||||
val SCE_CMAKE_FOREACHDEF=10
|
||||
val SCE_CMAKE_IFDEFINEDEF=11
|
||||
val SCE_CMAKE_MACRODEF=12
|
||||
val SCE_CMAKE_STRINGVAR=13
|
||||
val SCE_CMAKE_NUMBER=14
|
||||
# Lexical states for SCLEX_GAP
|
||||
lex Gap=SCLEX_GAP SCE_GAP_
|
||||
val SCE_GAP_DEFAULT=0
|
||||
val SCE_GAP_IDENTIFIER=1
|
||||
val SCE_GAP_KEYWORD=2
|
||||
val SCE_GAP_KEYWORD2=3
|
||||
val SCE_GAP_KEYWORD3=4
|
||||
val SCE_GAP_KEYWORD4=5
|
||||
val SCE_GAP_STRING=6
|
||||
val SCE_GAP_CHAR=7
|
||||
val SCE_GAP_OPERATOR=8
|
||||
val SCE_GAP_COMMENT=9
|
||||
val SCE_GAP_NUMBER=10
|
||||
val SCE_GAP_STRINGEOL=11
|
||||
# Lexical state for SCLEX_PLM
|
||||
lex PLM=SCLEX_PLM SCE_PLM_
|
||||
val SCE_PLM_DEFAULT=0
|
||||
val SCE_PLM_COMMENT=1
|
||||
val SCE_PLM_STRING=2
|
||||
val SCE_PLM_NUMBER=3
|
||||
val SCE_PLM_IDENTIFIER=4
|
||||
val SCE_PLM_OPERATOR=5
|
||||
val SCE_PLM_CONTROL=6
|
||||
val SCE_PLM_KEYWORD=7
|
||||
# Lexical state for SCLEX_PROGRESS
|
||||
lex Progress=SCLEX_PROGRESS SCE_4GL_
|
||||
val SCE_4GL_DEFAULT=0
|
||||
val SCE_4GL_NUMBER=1
|
||||
val SCE_4GL_WORD=2
|
||||
val SCE_4GL_STRING=3
|
||||
val SCE_4GL_CHARACTER=4
|
||||
val SCE_4GL_PREPROCESSOR=5
|
||||
val SCE_4GL_OPERATOR=6
|
||||
val SCE_4GL_IDENTIFIER=7
|
||||
val SCE_4GL_BLOCK=8
|
||||
val SCE_4GL_END=9
|
||||
val SCE_4GL_COMMENT1=10
|
||||
val SCE_4GL_COMMENT2=11
|
||||
val SCE_4GL_COMMENT3=12
|
||||
val SCE_4GL_COMMENT4=13
|
||||
val SCE_4GL_COMMENT5=14
|
||||
val SCE_4GL_COMMENT6=15
|
||||
val SCE_4GL_DEFAULT_=16
|
||||
val SCE_4GL_NUMBER_=17
|
||||
val SCE_4GL_WORD_=18
|
||||
val SCE_4GL_STRING_=19
|
||||
val SCE_4GL_CHARACTER_=20
|
||||
val SCE_4GL_PREPROCESSOR_=21
|
||||
val SCE_4GL_OPERATOR_=22
|
||||
val SCE_4GL_IDENTIFIER_=23
|
||||
val SCE_4GL_BLOCK_=24
|
||||
val SCE_4GL_END_=25
|
||||
val SCE_4GL_COMMENT1_=26
|
||||
val SCE_4GL_COMMENT2_=27
|
||||
val SCE_4GL_COMMENT3_=28
|
||||
val SCE_4GL_COMMENT4_=29
|
||||
val SCE_4GL_COMMENT5_=30
|
||||
val SCE_4GL_COMMENT6_=31
|
||||
# Lexical states for SCLEX_ABAQUS
|
||||
lex ABAQUS=SCLEX_ABAQUS SCE_ABAQUS_
|
||||
val SCE_ABAQUS_DEFAULT=0
|
||||
val SCE_ABAQUS_COMMENT=1
|
||||
val SCE_ABAQUS_COMMENTBLOCK=2
|
||||
val SCE_ABAQUS_NUMBER=3
|
||||
val SCE_ABAQUS_STRING=4
|
||||
val SCE_ABAQUS_OPERATOR=5
|
||||
val SCE_ABAQUS_WORD=6
|
||||
val SCE_ABAQUS_PROCESSOR=7
|
||||
val SCE_ABAQUS_COMMAND=8
|
||||
val SCE_ABAQUS_SLASHCOMMAND=9
|
||||
val SCE_ABAQUS_STARCOMMAND=10
|
||||
val SCE_ABAQUS_ARGUMENT=11
|
||||
val SCE_ABAQUS_FUNCTION=12
|
||||
# Lexical states for SCLEX_ASYMPTOTE
|
||||
lex Asymptote=SCLEX_ASYMPTOTE SCE_ASY_
|
||||
val SCE_ASY_DEFAULT=0
|
||||
val SCE_ASY_COMMENT=1
|
||||
val SCE_ASY_COMMENTLINE=2
|
||||
val SCE_ASY_NUMBER=3
|
||||
val SCE_ASY_WORD=4
|
||||
val SCE_ASY_STRING=5
|
||||
val SCE_ASY_CHARACTER=6
|
||||
val SCE_ASY_OPERATOR=7
|
||||
val SCE_ASY_IDENTIFIER=8
|
||||
val SCE_ASY_STRINGEOL=9
|
||||
val SCE_ASY_COMMENTLINEDOC=10
|
||||
val SCE_ASY_WORD2=11
|
||||
# Lexical states for SCLEX_R
|
||||
lex R=SCLEX_R SCE_R_
|
||||
val SCE_R_DEFAULT=0
|
||||
val SCE_R_COMMENT=1
|
||||
val SCE_R_KWORD=2
|
||||
val SCE_R_BASEKWORD=3
|
||||
val SCE_R_OTHERKWORD=4
|
||||
val SCE_R_NUMBER=5
|
||||
val SCE_R_STRING=6
|
||||
val SCE_R_STRING2=7
|
||||
val SCE_R_OPERATOR=8
|
||||
val SCE_R_IDENTIFIER=9
|
||||
val SCE_R_INFIX=10
|
||||
val SCE_R_INFIXEOL=11
|
||||
|
||||
# Events
|
||||
|
||||
@ -2995,6 +3284,8 @@ evt void HotSpotClick=2019(int modifiers, int position)
|
||||
evt void HotSpotDoubleClick=2020(int modifiers, int position)
|
||||
evt void CallTipClick=2021(int position)
|
||||
evt void AutoCSelection=2022(string text)
|
||||
evt void IndicatorClick=2023(int modifiers, int position)
|
||||
evt void IndicatorRelease=2024(int modifiers, int position)
|
||||
|
||||
cat Deprecated
|
||||
|
||||
|
@ -6,6 +6,10 @@
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*/
|
||||
class WindowAccessor : public Accessor {
|
||||
@ -48,10 +52,15 @@ public:
|
||||
}
|
||||
|
||||
void StartAt(unsigned int start, char chMask=31);
|
||||
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }
|
||||
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };
|
||||
unsigned int GetStartSegment() { return startSeg; }
|
||||
void StartSegment(unsigned int pos);
|
||||
void ColourTo(unsigned int pos, int chAttr);
|
||||
void SetLevel(int line, int level);
|
||||
int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
|
||||
void IndicatorFill(int start, int end, int indicator, int value);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
@ -14,6 +14,10 @@
|
||||
#include "PropSet.h"
|
||||
#include "AutoComplete.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
AutoComplete::AutoComplete() :
|
||||
active(false),
|
||||
separator(' '),
|
||||
|
@ -8,6 +8,10 @@
|
||||
#ifndef AUTOCOMPLETE_H
|
||||
#define AUTOCOMPLETE_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*/
|
||||
class AutoComplete {
|
||||
@ -67,4 +71,8 @@ public:
|
||||
void Select(const char *word);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,11 @@
|
||||
|
||||
#include "Scintilla.h"
|
||||
#include "CallTip.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static const int insetX = 5; // text inset in x from calltip border
|
||||
static const int widthArrow = 14;
|
||||
@ -29,8 +34,14 @@ CallTip::CallTip() {
|
||||
tabSize = 0;
|
||||
useStyleCallTip = false; // for backwards compatibility
|
||||
|
||||
#ifdef __APPLE__
|
||||
// proper apple colours for the default
|
||||
colourBG.desired = ColourDesired(0xff, 0xff, 0xc6);
|
||||
colourUnSel.desired = ColourDesired(0, 0, 0);
|
||||
#else
|
||||
colourBG.desired = ColourDesired(0xff, 0xff, 0xff);
|
||||
colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80);
|
||||
#endif
|
||||
colourSel.desired = ColourDesired(0, 0, 0x80);
|
||||
colourShade.desired = ColourDesired(0, 0, 0);
|
||||
colourLight.desired = ColourDesired(0xc0, 0xc0, 0xc0);
|
||||
@ -170,6 +181,7 @@ int CallTip::PaintContents(Surface *surfaceWindow, bool draw) {
|
||||
char *chunkVal = val;
|
||||
bool moreChunks = true;
|
||||
int maxWidth = 0;
|
||||
|
||||
while (moreChunks) {
|
||||
char *chunkEnd = strchr(chunkVal, '\n');
|
||||
if (chunkEnd == NULL) {
|
||||
@ -217,6 +229,8 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
|
||||
offsetMain = insetX; // initial alignment assuming no arrows
|
||||
PaintContents(surfaceWindow, true);
|
||||
|
||||
#ifndef __APPLE__
|
||||
// OSX doesn't put borders on "help tags"
|
||||
// Draw a raised border around the edges of the window
|
||||
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);
|
||||
surfaceWindow->PenColour(colourShade.allocated);
|
||||
@ -225,6 +239,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
|
||||
surfaceWindow->PenColour(colourLight.allocated);
|
||||
surfaceWindow->LineTo(0, 0);
|
||||
surfaceWindow->LineTo(0, rcClientSize.bottom - 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CallTip::MouseClick(Point pt) {
|
||||
|
@ -8,6 +8,10 @@
|
||||
#ifndef CALLTIP_H
|
||||
#define CALLTIP_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*/
|
||||
class CallTip {
|
||||
@ -76,4 +80,8 @@ public:
|
||||
void SetForeBack(const ColourPair &fore, const ColourPair &back);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -13,9 +13,14 @@
|
||||
#include "Platform.h"
|
||||
|
||||
#include "Scintilla.h"
|
||||
#include "SVector.h"
|
||||
#include "SplitVector.h"
|
||||
#include "Partitioning.h"
|
||||
#include "CellBuffer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
MarkerHandleSet::MarkerHandleSet() {
|
||||
root = 0;
|
||||
}
|
||||
@ -30,7 +35,7 @@ MarkerHandleSet::~MarkerHandleSet() {
|
||||
root = 0;
|
||||
}
|
||||
|
||||
int MarkerHandleSet::Length() {
|
||||
int MarkerHandleSet::Length() const {
|
||||
int c = 0;
|
||||
MarkerHandleNumber *mhn = root;
|
||||
while (mhn) {
|
||||
@ -40,7 +45,7 @@ int MarkerHandleSet::Length() {
|
||||
return c;
|
||||
}
|
||||
|
||||
int MarkerHandleSet::NumberFromHandle(int handle) {
|
||||
int MarkerHandleSet::NumberFromHandle(int handle) const {
|
||||
MarkerHandleNumber *mhn = root;
|
||||
while (mhn) {
|
||||
if (mhn->handle == handle) {
|
||||
@ -51,7 +56,7 @@ int MarkerHandleSet::NumberFromHandle(int handle) {
|
||||
return - 1;
|
||||
}
|
||||
|
||||
int MarkerHandleSet::MarkValue() {
|
||||
int MarkerHandleSet::MarkValue() const {
|
||||
unsigned int m = 0;
|
||||
MarkerHandleNumber *mhn = root;
|
||||
while (mhn) {
|
||||
@ -61,7 +66,7 @@ int MarkerHandleSet::MarkValue() {
|
||||
return m;
|
||||
}
|
||||
|
||||
bool MarkerHandleSet::Contains(int handle) {
|
||||
bool MarkerHandleSet::Contains(int handle) const {
|
||||
MarkerHandleNumber *mhn = root;
|
||||
while (mhn) {
|
||||
if (mhn->handle == handle) {
|
||||
@ -90,7 +95,7 @@ void MarkerHandleSet::RemoveHandle(int handle) {
|
||||
if (mhn->handle == handle) {
|
||||
*pmhn = mhn->next;
|
||||
delete mhn;
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
pmhn = &((*pmhn)->next);
|
||||
}
|
||||
@ -121,210 +126,154 @@ void MarkerHandleSet::CombineWith(MarkerHandleSet *other) {
|
||||
other->root = 0;
|
||||
}
|
||||
|
||||
LineVector::LineVector() {
|
||||
linesData = 0;
|
||||
lines = 0;
|
||||
size = 0;
|
||||
levels = 0;
|
||||
sizeLevels = 0;
|
||||
LineVector::LineVector() : starts(256) {
|
||||
handleCurrent = 1;
|
||||
growSize = 1000;
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
LineVector::~LineVector() {
|
||||
for (int line = 0; line < lines; line++) {
|
||||
delete linesData[line].handleSet;
|
||||
linesData[line].handleSet = 0;
|
||||
starts.DeleteAll();
|
||||
for (int line = 0; line < markers.Length(); line++) {
|
||||
delete markers[line];
|
||||
markers[line] = 0;
|
||||
}
|
||||
delete []linesData;
|
||||
linesData = 0;
|
||||
delete []levels;
|
||||
levels = 0;
|
||||
markers.DeleteAll();
|
||||
levels.DeleteAll();
|
||||
}
|
||||
|
||||
void LineVector::Init() {
|
||||
for (int line = 0; line < lines; line++) {
|
||||
delete linesData[line].handleSet;
|
||||
linesData[line].handleSet = 0;
|
||||
starts.DeleteAll();
|
||||
for (int line = 0; line < markers.Length(); line++) {
|
||||
delete markers[line];
|
||||
markers[line] = 0;
|
||||
}
|
||||
delete []linesData;
|
||||
linesData = new LineData[static_cast<int>(growSize)];
|
||||
size = growSize;
|
||||
lines = 1;
|
||||
delete []levels;
|
||||
levels = 0;
|
||||
sizeLevels = 0;
|
||||
}
|
||||
|
||||
void LineVector::Expand(int sizeNew) {
|
||||
LineData *linesDataNew = new LineData[sizeNew];
|
||||
if (linesDataNew) {
|
||||
for (int i = 0; i < size; i++)
|
||||
linesDataNew[i] = linesData[i];
|
||||
// Do not delete handleSets here as they are transferred to new linesData
|
||||
delete []linesData;
|
||||
linesData = linesDataNew;
|
||||
size = sizeNew;
|
||||
} else {
|
||||
Platform::DebugPrintf("No memory available\n");
|
||||
// TODO: Blow up
|
||||
}
|
||||
|
||||
markers.DeleteAll();
|
||||
levels.DeleteAll();
|
||||
}
|
||||
|
||||
void LineVector::ExpandLevels(int sizeNew) {
|
||||
if (sizeNew == -1)
|
||||
sizeNew = size;
|
||||
int *levelsNew = new int[sizeNew];
|
||||
if (levelsNew) {
|
||||
int i = 0;
|
||||
for (; i < sizeLevels; i++)
|
||||
levelsNew[i] = levels[i];
|
||||
for (; i < sizeNew; i++)
|
||||
levelsNew[i] = SC_FOLDLEVELBASE;
|
||||
delete []levels;
|
||||
levels = levelsNew;
|
||||
sizeLevels = sizeNew;
|
||||
} else {
|
||||
Platform::DebugPrintf("No memory available\n");
|
||||
// TODO: Blow up
|
||||
}
|
||||
|
||||
levels.InsertValue(levels.Length(), sizeNew - levels.Length(), SC_FOLDLEVELBASE);
|
||||
}
|
||||
|
||||
void LineVector::ClearLevels() {
|
||||
delete []levels;
|
||||
levels = 0;
|
||||
sizeLevels = 0;
|
||||
levels.DeleteAll();
|
||||
}
|
||||
|
||||
void LineVector::InsertValue(int pos, int value) {
|
||||
//Platform::DebugPrintf("InsertValue[%d] = %d\n", pos, value);
|
||||
if ((lines + 2) >= size) {
|
||||
if (growSize * 6 < size)
|
||||
growSize *= 2;
|
||||
Expand(size + growSize);
|
||||
if (levels) {
|
||||
ExpandLevels(size + growSize);
|
||||
int LineVector::SetLevel(int line, int level) {
|
||||
int prev = 0;
|
||||
if ((line >= 0) && (line < Lines())) {
|
||||
if (!levels.Length()) {
|
||||
ExpandLevels(Lines() + 1);
|
||||
}
|
||||
prev = levels[line];
|
||||
if (prev != level) {
|
||||
levels[line] = level;
|
||||
}
|
||||
}
|
||||
lines++;
|
||||
for (int i = lines; i > pos; i--) {
|
||||
linesData[i] = linesData[i - 1];
|
||||
}
|
||||
linesData[pos].startPosition = value;
|
||||
linesData[pos].handleSet = 0;
|
||||
if (levels) {
|
||||
for (int j = lines; j > pos; j--) {
|
||||
levels[j] = levels[j - 1];
|
||||
}
|
||||
if (pos == 0) {
|
||||
levels[pos] = SC_FOLDLEVELBASE;
|
||||
} else if (pos == (lines - 1)) { // Last line will not be a folder
|
||||
levels[pos] = SC_FOLDLEVELBASE;
|
||||
} else {
|
||||
levels[pos] = levels[pos - 1];
|
||||
}
|
||||
return prev;
|
||||
}
|
||||
|
||||
int LineVector::GetLevel(int line) {
|
||||
if (levels.Length() && (line >= 0) && (line < Lines())) {
|
||||
return levels[line];
|
||||
} else {
|
||||
return SC_FOLDLEVELBASE;
|
||||
}
|
||||
}
|
||||
|
||||
void LineVector::SetValue(int pos, int value) {
|
||||
//Platform::DebugPrintf("SetValue[%d] = %d\n", pos, value);
|
||||
if ((pos + 2) >= size) {
|
||||
//Platform::DebugPrintf("Resize %d %d\n", size,pos);
|
||||
Expand(pos + growSize);
|
||||
//Platform::DebugPrintf("end Resize %d %d\n", size,pos);
|
||||
lines = pos;
|
||||
if (levels) {
|
||||
ExpandLevels(pos + growSize);
|
||||
}
|
||||
}
|
||||
linesData[pos].startPosition = value;
|
||||
void LineVector::InsertText(int line, int delta) {
|
||||
starts.InsertText(line, delta);
|
||||
}
|
||||
|
||||
void LineVector::Remove(int pos) {
|
||||
//Platform::DebugPrintf("Remove %d\n", pos);
|
||||
void LineVector::InsertLine(int line, int position) {
|
||||
starts.InsertPartition(line, position);
|
||||
if (markers.Length()) {
|
||||
markers.Insert(line, 0);
|
||||
}
|
||||
if (levels.Length()) {
|
||||
int level = SC_FOLDLEVELBASE;
|
||||
if ((line > 0) && (line < Lines())) {
|
||||
level = levels[line-1] & ~SC_FOLDLEVELWHITEFLAG;
|
||||
}
|
||||
levels.InsertValue(line, 1, level);
|
||||
}
|
||||
}
|
||||
|
||||
void LineVector::SetLineStart(int line, int position) {
|
||||
starts.SetPartitionStartPosition(line, position);
|
||||
}
|
||||
|
||||
void LineVector::RemoveLine(int line) {
|
||||
starts.RemovePartition(line);
|
||||
// Retain the markers from the deleted line by oring them into the previous line
|
||||
if (pos > 0) {
|
||||
MergeMarkers(pos - 1);
|
||||
if (markers.Length()) {
|
||||
if (line > 0) {
|
||||
MergeMarkers(line - 1);
|
||||
}
|
||||
markers.Delete(line);
|
||||
}
|
||||
for (int i = pos; i < lines; i++) {
|
||||
linesData[i] = linesData[i + 1];
|
||||
}
|
||||
if (levels) {
|
||||
if (levels.Length()) {
|
||||
// Move up following lines but merge header flag from this line
|
||||
// to line before to avoid a temporary disappearence causing expansion.
|
||||
int firstHeader = levels[pos] & SC_FOLDLEVELHEADERFLAG;
|
||||
for (int j = pos; j < lines; j++) {
|
||||
levels[j] = levels[j + 1];
|
||||
}
|
||||
if (pos > 0)
|
||||
levels[pos-1] |= firstHeader;
|
||||
int firstHeader = levels[line] & SC_FOLDLEVELHEADERFLAG;
|
||||
levels.Delete(line);
|
||||
if (line > 0)
|
||||
levels[line-1] |= firstHeader;
|
||||
}
|
||||
lines--;
|
||||
}
|
||||
|
||||
int LineVector::LineFromPosition(int pos) {
|
||||
//Platform::DebugPrintf("LineFromPostion %d lines=%d end = %d\n", pos, lines, linesData[lines].startPosition);
|
||||
if (lines == 0)
|
||||
return starts.PartitionFromPosition(pos);
|
||||
}
|
||||
|
||||
int LineVector::MarkValue(int line) {
|
||||
if (markers.Length() && markers[line])
|
||||
return markers[line]->MarkValue();
|
||||
else
|
||||
return 0;
|
||||
//Platform::DebugPrintf("LineFromPosition %d\n", pos);
|
||||
if (pos >= linesData[lines].startPosition)
|
||||
return lines - 1;
|
||||
int lower = 0;
|
||||
int upper = lines;
|
||||
do {
|
||||
int middle = (upper + lower + 1) / 2; // Round high
|
||||
if (pos < linesData[middle].startPosition) {
|
||||
upper = middle - 1;
|
||||
} else {
|
||||
lower = middle;
|
||||
}
|
||||
} while (lower < upper);
|
||||
//Platform::DebugPrintf("LineFromPostion %d %d %d\n", pos, lower, linesData[lower].startPosition, linesData[lower > 1 ? lower - 1 : 0].startPosition);
|
||||
return lower;
|
||||
}
|
||||
|
||||
int LineVector::AddMark(int line, int markerNum) {
|
||||
handleCurrent++;
|
||||
if (!linesData[line].handleSet) {
|
||||
if (!markers.Length()) {
|
||||
// No existing markers so allocate one element per line
|
||||
markers.InsertValue(0, Lines(), 0);
|
||||
}
|
||||
if (!markers[line]) {
|
||||
// Need new structure to hold marker handle
|
||||
linesData[line].handleSet = new MarkerHandleSet;
|
||||
if (!linesData[line].handleSet)
|
||||
markers[line] = new MarkerHandleSet();
|
||||
if (!markers[line])
|
||||
return - 1;
|
||||
}
|
||||
linesData[line].handleSet->InsertHandle(handleCurrent, markerNum);
|
||||
markers[line]->InsertHandle(handleCurrent, markerNum);
|
||||
|
||||
return handleCurrent;
|
||||
}
|
||||
|
||||
void LineVector::MergeMarkers(int pos) {
|
||||
if (linesData[pos + 1].handleSet != NULL) {
|
||||
if (linesData[pos].handleSet == NULL )
|
||||
linesData[pos].handleSet = new MarkerHandleSet;
|
||||
linesData[pos].handleSet->CombineWith(linesData[pos + 1].handleSet);
|
||||
delete linesData[pos + 1].handleSet;
|
||||
linesData[pos + 1].handleSet = NULL;
|
||||
if (markers[pos + 1] != NULL) {
|
||||
if (markers[pos] == NULL)
|
||||
markers[pos] = new MarkerHandleSet;
|
||||
markers[pos]->CombineWith(markers[pos + 1]);
|
||||
delete markers[pos + 1];
|
||||
markers[pos + 1] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void LineVector::DeleteMark(int line, int markerNum, bool all) {
|
||||
if (linesData[line].handleSet) {
|
||||
if (markers.Length() && markers[line]) {
|
||||
if (markerNum == -1) {
|
||||
delete linesData[line].handleSet;
|
||||
linesData[line].handleSet = 0;
|
||||
delete markers[line];
|
||||
markers[line] = NULL;
|
||||
} else {
|
||||
bool performedDeletion =
|
||||
linesData[line].handleSet->RemoveNumber(markerNum);
|
||||
bool performedDeletion = markers[line]->RemoveNumber(markerNum);
|
||||
while (all && performedDeletion) {
|
||||
performedDeletion =
|
||||
linesData[line].handleSet->RemoveNumber(markerNum);
|
||||
performedDeletion = markers[line]->RemoveNumber(markerNum);
|
||||
}
|
||||
if (linesData[line].handleSet->Length() == 0) {
|
||||
delete linesData[line].handleSet;
|
||||
linesData[line].handleSet = 0;
|
||||
if (markers[line]->Length() == 0) {
|
||||
delete markers[line];
|
||||
markers[line] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -333,23 +282,25 @@ void LineVector::DeleteMark(int line, int markerNum, bool all) {
|
||||
void LineVector::DeleteMarkFromHandle(int markerHandle) {
|
||||
int line = LineFromHandle(markerHandle);
|
||||
if (line >= 0) {
|
||||
linesData[line].handleSet->RemoveHandle(markerHandle);
|
||||
if (linesData[line].handleSet->Length() == 0) {
|
||||
delete linesData[line].handleSet;
|
||||
linesData[line].handleSet = 0;
|
||||
markers[line]->RemoveHandle(markerHandle);
|
||||
if (markers[line]->Length() == 0) {
|
||||
delete markers[line];
|
||||
markers[line] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int LineVector::LineFromHandle(int markerHandle) {
|
||||
for (int line = 0; line < lines; line++) {
|
||||
if (linesData[line].handleSet) {
|
||||
if (linesData[line].handleSet->Contains(markerHandle)) {
|
||||
return line;
|
||||
if (markers.Length()) {
|
||||
for (int line = 0; line < Lines(); line++) {
|
||||
if (markers[line]) {
|
||||
if (markers[line]->Contains(markerHandle)) {
|
||||
return line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Action::Action() {
|
||||
@ -437,7 +388,7 @@ void UndoHistory::EnsureUndoRoom() {
|
||||
int lenActionsNew = lenActions * 2;
|
||||
Action *actionsNew = new Action[lenActionsNew];
|
||||
if (!actionsNew)
|
||||
return ;
|
||||
return;
|
||||
for (int act = 0; act <= currentAction; act++)
|
||||
actionsNew[act].Grab(&actions[act]);
|
||||
delete []actions;
|
||||
@ -446,7 +397,8 @@ void UndoHistory::EnsureUndoRoom() {
|
||||
}
|
||||
}
|
||||
|
||||
void UndoHistory::AppendAction(actionType at, int position, char *data, int lengthData) {
|
||||
void UndoHistory::AppendAction(actionType at, int position, char *data, int lengthData,
|
||||
bool &startSequence) {
|
||||
EnsureUndoRoom();
|
||||
//Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction);
|
||||
//Platform::DebugPrintf("^ %d action %d %d\n", actions[currentAction - 1].at,
|
||||
@ -454,6 +406,7 @@ void UndoHistory::AppendAction(actionType at, int position, char *data, int leng
|
||||
if (currentAction < savePoint) {
|
||||
savePoint = -1;
|
||||
}
|
||||
int oldCurrentAction = currentAction;
|
||||
if (currentAction >= 1) {
|
||||
if (0 == undoSequenceDepth) {
|
||||
// Top level actions may not always be coalesced
|
||||
@ -486,7 +439,7 @@ void UndoHistory::AppendAction(actionType at, int position, char *data, int leng
|
||||
currentAction++;
|
||||
}
|
||||
} else {
|
||||
//Platform::DebugPrintf("action coalesced\n");
|
||||
// Action coalesced.
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -497,6 +450,7 @@ void UndoHistory::AppendAction(actionType at, int position, char *data, int leng
|
||||
} else {
|
||||
currentAction++;
|
||||
}
|
||||
startSequence = oldCurrentAction != currentAction;
|
||||
actions[currentAction].Create(at, position, data, lengthData);
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
@ -517,6 +471,7 @@ void UndoHistory::BeginUndoAction() {
|
||||
}
|
||||
|
||||
void UndoHistory::EndUndoAction() {
|
||||
PLATFORM_ASSERT(undoSequenceDepth > 0);
|
||||
EnsureUndoRoom();
|
||||
undoSequenceDepth--;
|
||||
if (0 == undoSequenceDepth) {
|
||||
@ -600,132 +555,51 @@ void UndoHistory::CompletedRedoStep() {
|
||||
currentAction++;
|
||||
}
|
||||
|
||||
CellBuffer::CellBuffer(int initialLength) {
|
||||
body = new char[initialLength];
|
||||
size = initialLength;
|
||||
length = 0;
|
||||
part1len = 0;
|
||||
gaplen = initialLength;
|
||||
part2body = body + gaplen;
|
||||
CellBuffer::CellBuffer() {
|
||||
readOnly = false;
|
||||
collectingUndo = true;
|
||||
growSize = 4000;
|
||||
}
|
||||
|
||||
CellBuffer::~CellBuffer() {
|
||||
delete []body;
|
||||
body = 0;
|
||||
}
|
||||
|
||||
void CellBuffer::GapTo(int position) {
|
||||
if (position == part1len)
|
||||
return ;
|
||||
if (position < part1len) {
|
||||
int diff = part1len - position;
|
||||
//Platform::DebugPrintf("Move gap backwards to %d diff = %d part1len=%d length=%d \n", position,diff, part1len, length);
|
||||
for (int i = 0; i < diff; i++)
|
||||
body[part1len + gaplen - i - 1] = body[part1len - i - 1];
|
||||
} else { // position > part1len
|
||||
int diff = position - part1len;
|
||||
//Platform::DebugPrintf("Move gap forwards to %d diff =%d\n", position,diff);
|
||||
for (int i = 0; i < diff; i++)
|
||||
body[part1len + i] = body[part1len + gaplen + i];
|
||||
}
|
||||
part1len = position;
|
||||
part2body = body + gaplen;
|
||||
}
|
||||
|
||||
void CellBuffer::RoomFor(int insertionLength) {
|
||||
//Platform::DebugPrintf("need room %d %d\n", gaplen, insertionLength);
|
||||
if (gaplen <= insertionLength) {
|
||||
//Platform::DebugPrintf("need room %d %d\n", gaplen, insertionLength);
|
||||
if (growSize * 6 < size)
|
||||
growSize *= 2;
|
||||
int newSize = size + insertionLength + growSize;
|
||||
Allocate(newSize);
|
||||
}
|
||||
}
|
||||
|
||||
// To make it easier to write code that uses ByteAt, a position outside the range of the buffer
|
||||
// can be retrieved. All characters outside the range have the value '\0'.
|
||||
char CellBuffer::ByteAt(int position) {
|
||||
if (position < part1len) {
|
||||
if (position < 0) {
|
||||
return '\0';
|
||||
} else {
|
||||
return body[position];
|
||||
}
|
||||
} else {
|
||||
if (position >= length) {
|
||||
return '\0';
|
||||
} else {
|
||||
return part2body[position];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CellBuffer::SetByteAt(int position, char ch) {
|
||||
|
||||
if (position < 0) {
|
||||
//Platform::DebugPrintf("Bad position %d\n",position);
|
||||
return ;
|
||||
}
|
||||
if (position >= length + 11) {
|
||||
Platform::DebugPrintf("Very Bad position %d of %d\n", position, length);
|
||||
//exit(2);
|
||||
return ;
|
||||
}
|
||||
if (position >= length) {
|
||||
//Platform::DebugPrintf("Bad position %d of %d\n",position,length);
|
||||
return ;
|
||||
}
|
||||
|
||||
if (position < part1len) {
|
||||
body[position] = ch;
|
||||
} else {
|
||||
part2body[position] = ch;
|
||||
}
|
||||
}
|
||||
|
||||
char CellBuffer::CharAt(int position) {
|
||||
return ByteAt(position*2);
|
||||
char CellBuffer::CharAt(int position) const {
|
||||
return substance.ValueAt(position);
|
||||
}
|
||||
|
||||
void CellBuffer::GetCharRange(char *buffer, int position, int lengthRetrieve) {
|
||||
if (lengthRetrieve < 0)
|
||||
return ;
|
||||
return;
|
||||
if (position < 0)
|
||||
return ;
|
||||
int bytePos = position * 2;
|
||||
if ((bytePos + lengthRetrieve * 2) > length) {
|
||||
Platform::DebugPrintf("Bad GetCharRange %d for %d of %d\n", bytePos,
|
||||
lengthRetrieve, length);
|
||||
return ;
|
||||
return;
|
||||
if ((position + lengthRetrieve) > substance.Length()) {
|
||||
Platform::DebugPrintf("Bad GetCharRange %d for %d of %d\n", position,
|
||||
lengthRetrieve, substance.Length());
|
||||
return;
|
||||
}
|
||||
GapTo(0); // Move the buffer so its easy to subscript into it
|
||||
char *pb = part2body + bytePos;
|
||||
while (lengthRetrieve--) {
|
||||
*buffer++ = *pb;
|
||||
pb += 2;
|
||||
|
||||
for (int i=0; i<lengthRetrieve; i++) {
|
||||
*buffer++ = substance.ValueAt(position + i);
|
||||
}
|
||||
}
|
||||
|
||||
char CellBuffer::StyleAt(int position) {
|
||||
return ByteAt(position*2 + 1);
|
||||
return style.ValueAt(position);
|
||||
}
|
||||
|
||||
const char *CellBuffer::InsertString(int position, char *s, int insertLength) {
|
||||
// The char* returned is to an allocation owned by the undo history
|
||||
const char *CellBuffer::InsertString(int position, const char *s, int insertLength, bool &startSequence) {
|
||||
char *data = 0;
|
||||
// InsertString and DeleteChars are the bottleneck though which all changes occur
|
||||
if (!readOnly) {
|
||||
if (collectingUndo) {
|
||||
// Save into the undo/redo stack, but only the characters - not the formatting
|
||||
// This takes up about half load time
|
||||
data = new char[insertLength / 2];
|
||||
for (int i = 0; i < insertLength / 2; i++) {
|
||||
data[i] = s[i * 2];
|
||||
data = new char[insertLength];
|
||||
for (int i = 0; i < insertLength; i++) {
|
||||
data[i] = s[i];
|
||||
}
|
||||
uh.AppendAction(insertAction, position / 2, data, insertLength / 2);
|
||||
uh.AppendAction(insertAction, position, data, insertLength, startSequence);
|
||||
}
|
||||
|
||||
BasicInsertString(position, s, insertLength);
|
||||
@ -733,45 +607,45 @@ const char *CellBuffer::InsertString(int position, char *s, int insertLength) {
|
||||
return data;
|
||||
}
|
||||
|
||||
bool CellBuffer::SetStyleAt(int position, char style, char mask) {
|
||||
style &= mask;
|
||||
char curVal = ByteAt(position * 2 + 1);
|
||||
if ((curVal & mask) != style) {
|
||||
SetByteAt(position*2 + 1, static_cast<char>((curVal & ~mask) | style));
|
||||
bool CellBuffer::SetStyleAt(int position, char styleValue, char mask) {
|
||||
styleValue &= mask;
|
||||
char curVal = style.ValueAt(position);
|
||||
if ((curVal & mask) != styleValue) {
|
||||
style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mask) {
|
||||
int bytePos = position * 2 + 1;
|
||||
bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue, char mask) {
|
||||
bool changed = false;
|
||||
PLATFORM_ASSERT(lengthStyle == 0 ||
|
||||
(lengthStyle > 0 && lengthStyle + position < length));
|
||||
(lengthStyle > 0 && lengthStyle + position <= style.Length()));
|
||||
while (lengthStyle--) {
|
||||
char curVal = ByteAt(bytePos);
|
||||
if ((curVal & mask) != style) {
|
||||
SetByteAt(bytePos, static_cast<char>((curVal & ~mask) | style));
|
||||
char curVal = style.ValueAt(position);
|
||||
if ((curVal & mask) != styleValue) {
|
||||
style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue));
|
||||
changed = true;
|
||||
}
|
||||
bytePos += 2;
|
||||
position++;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
const char *CellBuffer::DeleteChars(int position, int deleteLength) {
|
||||
// The char* returned is to an allocation owned by the undo history
|
||||
const char *CellBuffer::DeleteChars(int position, int deleteLength, bool &startSequence) {
|
||||
// InsertString and DeleteChars are the bottleneck though which all changes occur
|
||||
PLATFORM_ASSERT(deleteLength > 0);
|
||||
char *data = 0;
|
||||
if (!readOnly) {
|
||||
if (collectingUndo) {
|
||||
// Save into the undo/redo stack, but only the characters - not the formatting
|
||||
data = new char[deleteLength / 2];
|
||||
for (int i = 0; i < deleteLength / 2; i++) {
|
||||
data[i] = ByteAt(position + i * 2);
|
||||
data = new char[deleteLength];
|
||||
for (int i = 0; i < deleteLength; i++) {
|
||||
data[i] = substance.ValueAt(position + i);
|
||||
}
|
||||
uh.AppendAction(removeAction, position / 2, data, deleteLength / 2);
|
||||
uh.AppendAction(removeAction, position, data, deleteLength, startSequence);
|
||||
}
|
||||
|
||||
BasicDeleteChars(position, deleteLength);
|
||||
@ -779,39 +653,26 @@ const char *CellBuffer::DeleteChars(int position, int deleteLength) {
|
||||
return data;
|
||||
}
|
||||
|
||||
int CellBuffer::ByteLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
int CellBuffer::Length() {
|
||||
return ByteLength() / 2;
|
||||
int CellBuffer::Length() const {
|
||||
return substance.Length();
|
||||
}
|
||||
|
||||
void CellBuffer::Allocate(int newSize) {
|
||||
if (newSize > length) {
|
||||
GapTo(length);
|
||||
char *newBody = new char[newSize];
|
||||
memcpy(newBody, body, length);
|
||||
delete []body;
|
||||
body = newBody;
|
||||
gaplen += newSize - size;
|
||||
part2body = body + gaplen;
|
||||
size = newSize;
|
||||
}
|
||||
substance.ReAllocate(newSize);
|
||||
style.ReAllocate(newSize);
|
||||
}
|
||||
|
||||
int CellBuffer::Lines() {
|
||||
//Platform::DebugPrintf("Lines = %d\n", lv.lines);
|
||||
return lv.lines;
|
||||
int CellBuffer::Lines() const {
|
||||
return lv.Lines();
|
||||
}
|
||||
|
||||
int CellBuffer::LineStart(int line) {
|
||||
int CellBuffer::LineStart(int line) const {
|
||||
if (line < 0)
|
||||
return 0;
|
||||
else if (line > lv.lines)
|
||||
else if (line >= Lines())
|
||||
return Length();
|
||||
else
|
||||
return lv.linesData[line].startPosition;
|
||||
return lv.LineStart(line);
|
||||
}
|
||||
|
||||
bool CellBuffer::IsReadOnly() {
|
||||
@ -831,14 +692,14 @@ bool CellBuffer::IsSavePoint() {
|
||||
}
|
||||
|
||||
int CellBuffer::AddMark(int line, int markerNum) {
|
||||
if ((line >= 0) && (line < lv.lines)) {
|
||||
if ((line >= 0) && (line < Lines())) {
|
||||
return lv.AddMark(line, markerNum);
|
||||
}
|
||||
return - 1;
|
||||
}
|
||||
|
||||
void CellBuffer::DeleteMark(int line, int markerNum) {
|
||||
if ((line >= 0) && (line < lv.lines)) {
|
||||
if ((line >= 0) && (line < Lines())) {
|
||||
lv.DeleteMark(line, markerNum, false);
|
||||
}
|
||||
}
|
||||
@ -848,13 +709,13 @@ void CellBuffer::DeleteMarkFromHandle(int markerHandle) {
|
||||
}
|
||||
|
||||
int CellBuffer::GetMark(int line) {
|
||||
if ((line >= 0) && (line < lv.lines) && (lv.linesData[line].handleSet))
|
||||
return lv.linesData[line].handleSet->MarkValue();
|
||||
if ((line >= 0) && (line < Lines()))
|
||||
return lv.MarkValue(line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CellBuffer::DeleteAllMarks(int markerNum) {
|
||||
for (int line = 0; line < lv.lines; line++) {
|
||||
for (int line = 0; line < Lines(); line++) {
|
||||
lv.DeleteMark(line, markerNum, true);
|
||||
}
|
||||
}
|
||||
@ -865,119 +726,101 @@ int CellBuffer::LineFromHandle(int markerHandle) {
|
||||
|
||||
// Without undo
|
||||
|
||||
void CellBuffer::BasicInsertString(int position, char *s, int insertLength) {
|
||||
//Platform::DebugPrintf("Inserting at %d for %d\n", position, insertLength);
|
||||
if (insertLength == 0)
|
||||
return ;
|
||||
PLATFORM_ASSERT(insertLength > 0);
|
||||
RoomFor(insertLength);
|
||||
GapTo(position);
|
||||
|
||||
memcpy(body + part1len, s, insertLength);
|
||||
length += insertLength;
|
||||
part1len += insertLength;
|
||||
gaplen -= insertLength;
|
||||
part2body = body + gaplen;
|
||||
|
||||
int lineInsert = lv.LineFromPosition(position / 2) + 1;
|
||||
// Point all the lines after the insertion point further along in the buffer
|
||||
for (int lineAfter = lineInsert; lineAfter <= lv.lines; lineAfter++) {
|
||||
lv.linesData[lineAfter].startPosition += insertLength / 2;
|
||||
void CellBuffer::InsertLine(int line, int position) {
|
||||
lv.InsertLine(line, position);
|
||||
if (lineStates.Length()) {
|
||||
lineStates.Insert(line, 0);
|
||||
}
|
||||
char chPrev = ' ';
|
||||
if ((position - 2) >= 0)
|
||||
chPrev = ByteAt(position - 2);
|
||||
char chAfter = ' ';
|
||||
if ((position + insertLength) < length)
|
||||
chAfter = ByteAt(position + insertLength);
|
||||
}
|
||||
|
||||
void CellBuffer::RemoveLine(int line) {
|
||||
lv.RemoveLine(line);
|
||||
if (lineStates.Length()) {
|
||||
lineStates.Delete(line);
|
||||
}
|
||||
}
|
||||
|
||||
void CellBuffer::BasicInsertString(int position, const char *s, int insertLength) {
|
||||
if (insertLength == 0)
|
||||
return;
|
||||
PLATFORM_ASSERT(insertLength > 0);
|
||||
|
||||
substance.InsertFromArray(position, s, 0, insertLength);
|
||||
style.InsertValue(position, insertLength, 0);
|
||||
|
||||
int lineInsert = lv.LineFromPosition(position) + 1;
|
||||
// Point all the lines after the insertion point further along in the buffer
|
||||
lv.InsertText(lineInsert-1, insertLength);
|
||||
char chPrev = substance.ValueAt(position - 1);
|
||||
char chAfter = substance.ValueAt(position + insertLength);
|
||||
if (chPrev == '\r' && chAfter == '\n') {
|
||||
//Platform::DebugPrintf("Splitting a crlf pair at %d\n", lineInsert);
|
||||
// Splitting up a crlf pair at position
|
||||
lv.InsertValue(lineInsert, position / 2);
|
||||
InsertLine(lineInsert, position);
|
||||
lineInsert++;
|
||||
}
|
||||
char ch = ' ';
|
||||
for (int i = 0; i < insertLength; i += 2) {
|
||||
for (int i = 0; i < insertLength; i++) {
|
||||
ch = s[i];
|
||||
if (ch == '\r') {
|
||||
//Platform::DebugPrintf("Inserting cr at %d\n", lineInsert);
|
||||
lv.InsertValue(lineInsert, (position + i) / 2 + 1);
|
||||
InsertLine(lineInsert, (position + i) + 1);
|
||||
lineInsert++;
|
||||
} else if (ch == '\n') {
|
||||
if (chPrev == '\r') {
|
||||
//Platform::DebugPrintf("Patching cr before lf at %d\n", lineInsert-1);
|
||||
// Patch up what was end of line
|
||||
lv.SetValue(lineInsert - 1, (position + i) / 2 + 1);
|
||||
lv.SetLineStart(lineInsert - 1, (position + i) + 1);
|
||||
} else {
|
||||
//Platform::DebugPrintf("Inserting lf at %d\n", lineInsert);
|
||||
lv.InsertValue(lineInsert, (position + i) / 2 + 1);
|
||||
InsertLine(lineInsert, (position + i) + 1);
|
||||
lineInsert++;
|
||||
}
|
||||
}
|
||||
chPrev = ch;
|
||||
}
|
||||
// Joining two lines where last insertion is cr and following text starts with lf
|
||||
// Joining two lines where last insertion is cr and following substance starts with lf
|
||||
if (chAfter == '\n') {
|
||||
if (ch == '\r') {
|
||||
//Platform::DebugPrintf("Joining cr before lf at %d\n", lineInsert-1);
|
||||
// End of line already in buffer so drop the newly created one
|
||||
lv.Remove(lineInsert - 1);
|
||||
RemoveLine(lineInsert - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CellBuffer::BasicDeleteChars(int position, int deleteLength) {
|
||||
//Platform::DebugPrintf("Deleting at %d for %d\n", position, deleteLength);
|
||||
if (deleteLength == 0)
|
||||
return ;
|
||||
return;
|
||||
|
||||
if ((position == 0) && (deleteLength == length)) {
|
||||
if ((position == 0) && (deleteLength == substance.Length())) {
|
||||
// If whole buffer is being deleted, faster to reinitialise lines data
|
||||
// than to delete each line.
|
||||
//printf("Whole buffer being deleted\n");
|
||||
lv.Init();
|
||||
} else {
|
||||
// Have to fix up line positions before doing deletion as looking at text in buffer
|
||||
// to work out which lines have been removed
|
||||
|
||||
int lineRemove = lv.LineFromPosition(position / 2) + 1;
|
||||
// Point all the lines after the insertion point further along in the buffer
|
||||
for (int lineAfter = lineRemove; lineAfter <= lv.lines; lineAfter++) {
|
||||
lv.linesData[lineAfter].startPosition -= deleteLength / 2;
|
||||
}
|
||||
char chPrev = ' ';
|
||||
if (position >= 2)
|
||||
chPrev = ByteAt(position - 2);
|
||||
int lineRemove = lv.LineFromPosition(position) + 1;
|
||||
lv.InsertText(lineRemove-1, - (deleteLength));
|
||||
char chPrev = substance.ValueAt(position - 1);
|
||||
char chBefore = chPrev;
|
||||
char chNext = ' ';
|
||||
if (position < length)
|
||||
chNext = ByteAt(position);
|
||||
char chNext = substance.ValueAt(position);
|
||||
bool ignoreNL = false;
|
||||
if (chPrev == '\r' && chNext == '\n') {
|
||||
//Platform::DebugPrintf("Deleting lf after cr, move line end to cr at %d\n", lineRemove);
|
||||
// Move back one
|
||||
lv.SetValue(lineRemove, position / 2);
|
||||
lv.SetLineStart(lineRemove, position);
|
||||
lineRemove++;
|
||||
ignoreNL = true; // First \n is not real deletion
|
||||
}
|
||||
|
||||
char ch = chNext;
|
||||
for (int i = 0; i < deleteLength; i += 2) {
|
||||
chNext = ' ';
|
||||
if ((position + i + 2) < length)
|
||||
chNext = ByteAt(position + i + 2);
|
||||
//Platform::DebugPrintf("Deleting %d %x\n", i, ch);
|
||||
for (int i = 0; i < deleteLength; i++) {
|
||||
chNext = substance.ValueAt(position + i + 1);
|
||||
if (ch == '\r') {
|
||||
if (chNext != '\n') {
|
||||
//Platform::DebugPrintf("Removing cr end of line\n");
|
||||
lv.Remove(lineRemove);
|
||||
RemoveLine(lineRemove);
|
||||
}
|
||||
} else if (ch == '\n') {
|
||||
if (ignoreNL) {
|
||||
ignoreNL = false; // Further \n are real deletions
|
||||
} else {
|
||||
//Platform::DebugPrintf("Removing lf end of line\n");
|
||||
lv.Remove(lineRemove);
|
||||
RemoveLine(lineRemove);
|
||||
}
|
||||
}
|
||||
|
||||
@ -985,20 +828,15 @@ void CellBuffer::BasicDeleteChars(int position, int deleteLength) {
|
||||
}
|
||||
// May have to fix up end if last deletion causes cr to be next to lf
|
||||
// or removes one of a crlf pair
|
||||
char chAfter = ' ';
|
||||
if ((position + deleteLength) < length)
|
||||
chAfter = ByteAt(position + deleteLength);
|
||||
char chAfter = substance.ValueAt(position + deleteLength);
|
||||
if (chBefore == '\r' && chAfter == '\n') {
|
||||
//d.printf("Joining cr before lf at %d\n", lineRemove);
|
||||
// Using lineRemove-1 as cr ended line before start of deletion
|
||||
lv.Remove(lineRemove - 1);
|
||||
lv.SetValue(lineRemove - 1, position / 2 + 1);
|
||||
RemoveLine(lineRemove - 1);
|
||||
lv.SetLineStart(lineRemove - 1, position + 1);
|
||||
}
|
||||
}
|
||||
GapTo(position);
|
||||
length -= deleteLength;
|
||||
gaplen += deleteLength;
|
||||
part2body = body + gaplen;
|
||||
substance.DeleteRange(position, deleteLength);
|
||||
style.DeleteRange(position, deleteLength);
|
||||
}
|
||||
|
||||
bool CellBuffer::SetUndoCollection(bool collectUndo) {
|
||||
@ -1038,15 +876,9 @@ const Action &CellBuffer::GetUndoStep() const {
|
||||
void CellBuffer::PerformUndoStep() {
|
||||
const Action &actionStep = uh.GetUndoStep();
|
||||
if (actionStep.at == insertAction) {
|
||||
BasicDeleteChars(actionStep.position*2, actionStep.lenData*2);
|
||||
BasicDeleteChars(actionStep.position, actionStep.lenData);
|
||||
} else if (actionStep.at == removeAction) {
|
||||
char *styledData = new char[actionStep.lenData * 2];
|
||||
for (int i = 0; i < actionStep.lenData; i++) {
|
||||
styledData[i*2] = actionStep.data[i];
|
||||
styledData[i*2 + 1] = 0;
|
||||
}
|
||||
BasicInsertString(actionStep.position*2, styledData, actionStep.lenData*2);
|
||||
delete []styledData;
|
||||
BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData);
|
||||
}
|
||||
uh.CompletedUndoStep();
|
||||
}
|
||||
@ -1066,26 +898,22 @@ const Action &CellBuffer::GetRedoStep() const {
|
||||
void CellBuffer::PerformRedoStep() {
|
||||
const Action &actionStep = uh.GetRedoStep();
|
||||
if (actionStep.at == insertAction) {
|
||||
char *styledData = new char[actionStep.lenData * 2];
|
||||
for (int i = 0; i < actionStep.lenData; i++) {
|
||||
styledData[i*2] = actionStep.data[i];
|
||||
styledData[i*2 + 1] = 0;
|
||||
}
|
||||
BasicInsertString(actionStep.position*2, styledData, actionStep.lenData*2);
|
||||
delete []styledData;
|
||||
BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData);
|
||||
} else if (actionStep.at == removeAction) {
|
||||
BasicDeleteChars(actionStep.position*2, actionStep.lenData*2);
|
||||
BasicDeleteChars(actionStep.position, actionStep.lenData);
|
||||
}
|
||||
uh.CompletedRedoStep();
|
||||
}
|
||||
|
||||
int CellBuffer::SetLineState(int line, int state) {
|
||||
lineStates.EnsureLength(line + 1);
|
||||
int stateOld = lineStates[line];
|
||||
lineStates[line] = state;
|
||||
return stateOld;
|
||||
}
|
||||
|
||||
int CellBuffer::GetLineState(int line) {
|
||||
lineStates.EnsureLength(line + 1);
|
||||
return lineStates[line];
|
||||
}
|
||||
|
||||
@ -1094,25 +922,11 @@ int CellBuffer::GetMaxLineState() {
|
||||
}
|
||||
|
||||
int CellBuffer::SetLevel(int line, int level) {
|
||||
int prev = 0;
|
||||
if ((line >= 0) && (line < lv.lines)) {
|
||||
if (!lv.levels) {
|
||||
lv.ExpandLevels();
|
||||
}
|
||||
prev = lv.levels[line];
|
||||
if (lv.levels[line] != level) {
|
||||
lv.levels[line] = level;
|
||||
}
|
||||
}
|
||||
return prev;
|
||||
return lv.SetLevel(line, level);
|
||||
}
|
||||
|
||||
int CellBuffer::GetLevel(int line) {
|
||||
if (lv.levels && (line >= 0) && (line < lv.lines)) {
|
||||
return lv.levels[line];
|
||||
} else {
|
||||
return SC_FOLDLEVELBASE;
|
||||
}
|
||||
return lv.GetLevel(line);
|
||||
}
|
||||
|
||||
void CellBuffer::ClearLevels() {
|
||||
|
@ -8,6 +8,10 @@
|
||||
#ifndef CELLBUFFER_H
|
||||
#define CELLBUFFER_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This holds the marker identifier and the marker type to display.
|
||||
* MarkerHandleNumbers are members of lists.
|
||||
@ -27,54 +31,51 @@ class MarkerHandleSet {
|
||||
public:
|
||||
MarkerHandleSet();
|
||||
~MarkerHandleSet();
|
||||
int Length();
|
||||
int NumberFromHandle(int handle);
|
||||
int MarkValue(); ///< Bit set of marker numbers.
|
||||
bool Contains(int handle);
|
||||
int Length() const;
|
||||
int NumberFromHandle(int handle) const;
|
||||
int MarkValue() const; ///< Bit set of marker numbers.
|
||||
bool Contains(int handle) const;
|
||||
bool InsertHandle(int handle, int markerNum);
|
||||
void RemoveHandle(int handle);
|
||||
bool RemoveNumber(int markerNum);
|
||||
void CombineWith(MarkerHandleSet *other);
|
||||
};
|
||||
|
||||
/**
|
||||
* Each line stores the starting position of the first character of the line in the cell buffer
|
||||
* and potentially a marker handle set. Often a line will not have any attached markers.
|
||||
*/
|
||||
struct LineData {
|
||||
int startPosition;
|
||||
MarkerHandleSet *handleSet;
|
||||
LineData() : startPosition(0), handleSet(0) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The line vector contains information about each of the lines in a cell buffer.
|
||||
*/
|
||||
class LineVector {
|
||||
public:
|
||||
int growSize;
|
||||
int lines;
|
||||
LineData *linesData;
|
||||
int size;
|
||||
int *levels;
|
||||
int sizeLevels;
|
||||
|
||||
Partitioning starts;
|
||||
SplitVector<MarkerHandleSet *> markers;
|
||||
SplitVector<int> levels;
|
||||
/// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
|
||||
int handleCurrent;
|
||||
|
||||
public:
|
||||
|
||||
LineVector();
|
||||
~LineVector();
|
||||
void Init();
|
||||
|
||||
void Expand(int sizeNew);
|
||||
void ExpandLevels(int sizeNew=-1);
|
||||
void ClearLevels();
|
||||
void InsertValue(int pos, int value);
|
||||
void SetValue(int pos, int value);
|
||||
void Remove(int pos);
|
||||
int LineFromPosition(int pos);
|
||||
int SetLevel(int line, int level);
|
||||
int GetLevel(int line);
|
||||
|
||||
void InsertText(int line, int delta);
|
||||
void InsertLine(int line, int position);
|
||||
void SetLineStart(int line, int position);
|
||||
void RemoveLine(int line);
|
||||
int Lines() const {
|
||||
return starts.Partitions();
|
||||
}
|
||||
int LineFromPosition(int pos);
|
||||
int LineStart(int line) const {
|
||||
return starts.PositionFromPartition(line);
|
||||
}
|
||||
|
||||
int MarkValue(int line);
|
||||
int AddMark(int line, int marker);
|
||||
void MergeMarkers(int pos);
|
||||
void DeleteMark(int line, int markerNum, bool all);
|
||||
@ -119,7 +120,7 @@ public:
|
||||
UndoHistory();
|
||||
~UndoHistory();
|
||||
|
||||
void AppendAction(actionType at, int position, char *data, int length);
|
||||
void AppendAction(actionType at, int position, char *data, int length, bool &startSequence);
|
||||
|
||||
void BeginUndoAction();
|
||||
void EndUndoAction();
|
||||
@ -150,54 +151,42 @@ public:
|
||||
*/
|
||||
class CellBuffer {
|
||||
private:
|
||||
char *body; ///< The cell buffer itself.
|
||||
int size; ///< Allocated size of the buffer.
|
||||
int length; ///< Total length of the data.
|
||||
int part1len; ///< Length of the first part.
|
||||
int gaplen; ///< Length of the gap between the two parts.
|
||||
char *part2body; ///< The second part of the cell buffer.
|
||||
///< Doesn't point after the gap but set so that
|
||||
///< part2body[position] is consistent with body[position].
|
||||
SplitVector<char> substance;
|
||||
SplitVector<char> style;
|
||||
bool readOnly;
|
||||
int growSize;
|
||||
|
||||
bool collectingUndo;
|
||||
UndoHistory uh;
|
||||
|
||||
LineVector lv;
|
||||
|
||||
SVector lineStates;
|
||||
|
||||
void GapTo(int position);
|
||||
void RoomFor(int insertionLength);
|
||||
|
||||
inline char ByteAt(int position);
|
||||
void SetByteAt(int position, char ch);
|
||||
SplitVector<int> lineStates;
|
||||
|
||||
public:
|
||||
|
||||
CellBuffer(int initialLength = 4000);
|
||||
CellBuffer();
|
||||
~CellBuffer();
|
||||
|
||||
/// Retrieving positions outside the range of the buffer works and returns 0
|
||||
char CharAt(int position);
|
||||
char CharAt(int position) const;
|
||||
void GetCharRange(char *buffer, int position, int lengthRetrieve);
|
||||
char StyleAt(int position);
|
||||
|
||||
int ByteLength();
|
||||
int Length();
|
||||
int Length() const;
|
||||
void Allocate(int newSize);
|
||||
int Lines();
|
||||
int LineStart(int line);
|
||||
int Lines() const;
|
||||
int LineStart(int line) const;
|
||||
int LineFromPosition(int pos) { return lv.LineFromPosition(pos); }
|
||||
const char *InsertString(int position, char *s, int insertLength);
|
||||
void InsertLine(int line, int position);
|
||||
void RemoveLine(int line);
|
||||
const char *InsertString(int position, const char *s, int insertLength, bool &startSequence);
|
||||
|
||||
/// Setting styles for positions outside the range of the buffer is safe and has no effect.
|
||||
/// @return true if the style of a character is changed.
|
||||
bool SetStyleAt(int position, char style, char mask='\377');
|
||||
bool SetStyleFor(int position, int length, char style, char mask);
|
||||
bool SetStyleAt(int position, char styleValue, char mask='\377');
|
||||
bool SetStyleFor(int position, int length, char styleValue, char mask);
|
||||
|
||||
const char *DeleteChars(int position, int deleteLength);
|
||||
const char *DeleteChars(int position, int deleteLength, bool &startSequence);
|
||||
|
||||
bool IsReadOnly();
|
||||
void SetReadOnly(bool set);
|
||||
@ -216,7 +205,7 @@ public:
|
||||
int LineFromHandle(int markerHandle);
|
||||
|
||||
/// Actions without undo
|
||||
void BasicInsertString(int position, char *s, int insertLength);
|
||||
void BasicInsertString(int position, const char *s, int insertLength);
|
||||
void BasicDeleteChars(int position, int deleteLength);
|
||||
|
||||
bool SetUndoCollection(bool collectUndo);
|
||||
@ -245,6 +234,8 @@ public:
|
||||
void ClearLevels();
|
||||
};
|
||||
|
||||
#define CELL_SIZE 2
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
58
src/stc/scintilla/src/CharacterSet.h
Normal file
58
src/stc/scintilla/src/CharacterSet.h
Normal file
@ -0,0 +1,58 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file CharacterSet.h
|
||||
** Encapsulates a set of characters. Used to test if a character is within a set.
|
||||
**/
|
||||
// Copyright 2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
class CharacterSet {
|
||||
int size;
|
||||
bool valueAfter;
|
||||
bool *bset;
|
||||
public:
|
||||
enum setBase {
|
||||
setNone=0,
|
||||
setLower=1,
|
||||
setUpper=2,
|
||||
setDigits=4,
|
||||
setAlpha=setLower|setUpper,
|
||||
setAlphaNum=setAlpha|setDigits
|
||||
};
|
||||
CharacterSet(setBase base=setNone, const char *initialSet="", int size_=0x80, bool valueAfter_=false) {
|
||||
size = size_;
|
||||
valueAfter = valueAfter_;
|
||||
bset = new bool[size];
|
||||
for (int i=0; i < size; i++) {
|
||||
bset[i] = false;
|
||||
}
|
||||
AddString(initialSet);
|
||||
if (base & setLower)
|
||||
AddString("abcdefghijklmnopqrstuvwxyz");
|
||||
if (base & setUpper)
|
||||
AddString("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
if (base & setDigits)
|
||||
AddString("0123456789");
|
||||
}
|
||||
~CharacterSet() {
|
||||
delete []bset;
|
||||
bset = 0;
|
||||
size = 0;
|
||||
}
|
||||
void Add(int val) {
|
||||
PLATFORM_ASSERT(val >= 0);
|
||||
PLATFORM_ASSERT(val < size);
|
||||
bset[val] = true;
|
||||
}
|
||||
void AddString(const char *CharacterSet) {
|
||||
for (const char *cp=CharacterSet; *cp; cp++) {
|
||||
int val = static_cast<unsigned char>(*cp);
|
||||
PLATFORM_ASSERT(val >= 0);
|
||||
PLATFORM_ASSERT(val < size);
|
||||
bset[val] = true;
|
||||
}
|
||||
}
|
||||
bool Contains(int val) const {
|
||||
PLATFORM_ASSERT(val >= 0);
|
||||
return (val < size) ? bset[val] : valueAfter;
|
||||
}
|
||||
};
|
@ -1,289 +1,251 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file ContractionState.cxx
|
||||
** Manages visibility of lines for folding.
|
||||
** Manages visibility of lines for folding and wrapping.
|
||||
**/
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "SplitVector.h"
|
||||
#include "Partitioning.h"
|
||||
#include "RunStyles.h"
|
||||
#include "ContractionState.h"
|
||||
|
||||
OneLine::OneLine() {
|
||||
displayLine = 0;
|
||||
//docLine = 0;
|
||||
visible = true;
|
||||
height = 1;
|
||||
expanded = true;
|
||||
}
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
ContractionState::ContractionState() {
|
||||
lines = 0;
|
||||
size = 0;
|
||||
linesInDoc = 1;
|
||||
linesInDisplay = 1;
|
||||
valid = false;
|
||||
docLines = 0;
|
||||
sizeDocLines = 0;
|
||||
ContractionState::ContractionState() : visible(0), expanded(0), heights(0), displayLines(0), linesInDocument(1) {
|
||||
//InsertLine(0);
|
||||
}
|
||||
|
||||
ContractionState::~ContractionState() {
|
||||
Clear();
|
||||
}
|
||||
|
||||
void ContractionState::MakeValid() const {
|
||||
if (!valid) {
|
||||
// Could be cleverer by keeping the index of the last still valid entry
|
||||
// rather than invalidating all.
|
||||
linesInDisplay = 0;
|
||||
for (int lineInDoc=0; lineInDoc<linesInDoc; lineInDoc++) {
|
||||
lines[lineInDoc].displayLine = linesInDisplay;
|
||||
if (lines[lineInDoc].visible) {
|
||||
linesInDisplay += lines[lineInDoc].height;
|
||||
}
|
||||
}
|
||||
if (sizeDocLines < linesInDisplay) {
|
||||
delete []docLines;
|
||||
int *docLinesNew = new int[linesInDisplay + growSize];
|
||||
if (!docLinesNew) {
|
||||
docLines = 0;
|
||||
sizeDocLines = 0;
|
||||
return;
|
||||
}
|
||||
docLines = docLinesNew;
|
||||
sizeDocLines = linesInDisplay + growSize;
|
||||
}
|
||||
|
||||
int lineInDisplay=0;
|
||||
for (int line=0; line<linesInDoc; line++) {
|
||||
if (lines[line].visible) {
|
||||
for (int linePiece=0; linePiece<lines[line].height; linePiece++) {
|
||||
docLines[lineInDisplay] = line;
|
||||
lineInDisplay++;
|
||||
}
|
||||
}
|
||||
}
|
||||
valid = true;
|
||||
void ContractionState::EnsureData() {
|
||||
if (OneToOne()) {
|
||||
visible = new RunStyles();
|
||||
expanded = new RunStyles();
|
||||
heights = new RunStyles();
|
||||
displayLines = new Partitioning(4);
|
||||
InsertLines(0, linesInDocument);
|
||||
}
|
||||
}
|
||||
|
||||
void ContractionState::Clear() {
|
||||
delete []lines;
|
||||
lines = 0;
|
||||
size = 0;
|
||||
linesInDoc = 1;
|
||||
linesInDisplay = 1;
|
||||
delete []docLines;
|
||||
docLines = 0;
|
||||
sizeDocLines = 0;
|
||||
delete visible;
|
||||
visible = 0;
|
||||
delete expanded;
|
||||
expanded = 0;
|
||||
delete heights;
|
||||
heights = 0;
|
||||
delete displayLines;
|
||||
displayLines = 0;
|
||||
linesInDocument = 1;
|
||||
}
|
||||
|
||||
int ContractionState::LinesInDoc() const {
|
||||
return linesInDoc;
|
||||
if (OneToOne()) {
|
||||
return linesInDocument;
|
||||
} else {
|
||||
return displayLines->Partitions() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
int ContractionState::LinesDisplayed() const {
|
||||
if (size != 0) {
|
||||
MakeValid();
|
||||
if (OneToOne()) {
|
||||
return linesInDocument;
|
||||
} else {
|
||||
return displayLines->PositionFromPartition(LinesInDoc());
|
||||
}
|
||||
return linesInDisplay;
|
||||
}
|
||||
|
||||
int ContractionState::DisplayFromDoc(int lineDoc) const {
|
||||
if (size == 0) {
|
||||
if (OneToOne()) {
|
||||
return lineDoc;
|
||||
} else {
|
||||
if (lineDoc > displayLines->Partitions())
|
||||
lineDoc = displayLines->Partitions();
|
||||
return displayLines->PositionFromPartition(lineDoc);
|
||||
}
|
||||
MakeValid();
|
||||
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
|
||||
return lines[lineDoc].displayLine;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ContractionState::DocFromDisplay(int lineDisplay) const {
|
||||
if (lineDisplay <= 0)
|
||||
return 0;
|
||||
if (lineDisplay >= linesInDisplay)
|
||||
return linesInDoc;
|
||||
if (size == 0)
|
||||
if (OneToOne()) {
|
||||
return lineDisplay;
|
||||
MakeValid();
|
||||
if (docLines) { // Valid allocation
|
||||
return docLines[lineDisplay];
|
||||
} else {
|
||||
return 0;
|
||||
if (lineDisplay <= 0) {
|
||||
return 0;
|
||||
}
|
||||
if (lineDisplay > LinesDisplayed()) {
|
||||
return displayLines->PartitionFromPosition(LinesDisplayed());
|
||||
}
|
||||
int lineDoc = displayLines->PartitionFromPosition(lineDisplay);
|
||||
PLATFORM_ASSERT(GetVisible(lineDoc));
|
||||
return lineDoc;
|
||||
}
|
||||
}
|
||||
|
||||
void ContractionState::Grow(int sizeNew) {
|
||||
OneLine *linesNew = new OneLine[sizeNew];
|
||||
if (linesNew) {
|
||||
int i = 0;
|
||||
for (; i < size; i++) {
|
||||
linesNew[i] = lines[i];
|
||||
}
|
||||
for (; i < sizeNew; i++) {
|
||||
linesNew[i].displayLine = i;
|
||||
}
|
||||
delete []lines;
|
||||
lines = linesNew;
|
||||
size = sizeNew;
|
||||
valid = false;
|
||||
void ContractionState::InsertLine(int lineDoc) {
|
||||
if (OneToOne()) {
|
||||
linesInDocument++;
|
||||
} else {
|
||||
Platform::DebugPrintf("No memory available\n");
|
||||
// TODO: Blow up
|
||||
visible->InsertSpace(lineDoc, 1);
|
||||
visible->SetValueAt(lineDoc, 1);
|
||||
expanded->InsertSpace(lineDoc, 1);
|
||||
expanded->SetValueAt(lineDoc, 1);
|
||||
heights->InsertSpace(lineDoc, 1);
|
||||
heights->SetValueAt(lineDoc, 1);
|
||||
int lineDisplay = DisplayFromDoc(lineDoc);
|
||||
displayLines->InsertPartition(lineDoc, lineDisplay);
|
||||
displayLines->InsertText(lineDoc, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void ContractionState::InsertLines(int lineDoc, int lineCount) {
|
||||
if (size == 0) {
|
||||
linesInDoc += lineCount;
|
||||
linesInDisplay += lineCount;
|
||||
return;
|
||||
for (int l = 0; l < lineCount; l++) {
|
||||
InsertLine(lineDoc + l);
|
||||
}
|
||||
//Platform::DebugPrintf("InsertLine[%d] = %d\n", lineDoc);
|
||||
if ((linesInDoc + lineCount + 2) >= size) {
|
||||
Grow(linesInDoc + lineCount + growSize);
|
||||
Check();
|
||||
}
|
||||
|
||||
void ContractionState::DeleteLine(int lineDoc) {
|
||||
if (OneToOne()) {
|
||||
linesInDocument--;
|
||||
} else {
|
||||
if (GetVisible(lineDoc)) {
|
||||
displayLines->InsertText(lineDoc, -heights->ValueAt(lineDoc));
|
||||
}
|
||||
displayLines->RemovePartition(lineDoc);
|
||||
visible->DeleteRange(lineDoc, 1);
|
||||
expanded->DeleteRange(lineDoc, 1);
|
||||
heights->DeleteRange(lineDoc, 1);
|
||||
}
|
||||
linesInDoc += lineCount;
|
||||
for (int i = linesInDoc; i >= lineDoc + lineCount; i--) {
|
||||
lines[i].visible = lines[i - lineCount].visible;
|
||||
lines[i].height = lines[i - lineCount].height;
|
||||
linesInDisplay += lines[i].height;
|
||||
lines[i].expanded = lines[i - lineCount].expanded;
|
||||
}
|
||||
for (int d=0;d<lineCount;d++) {
|
||||
lines[lineDoc+d].visible = true; // Should inherit visibility from context ?
|
||||
lines[lineDoc+d].height = 1;
|
||||
lines[lineDoc+d].expanded = true;
|
||||
}
|
||||
valid = false;
|
||||
}
|
||||
|
||||
void ContractionState::DeleteLines(int lineDoc, int lineCount) {
|
||||
if (size == 0) {
|
||||
linesInDoc -= lineCount;
|
||||
linesInDisplay -= lineCount;
|
||||
return;
|
||||
for (int l = 0; l < lineCount; l++) {
|
||||
DeleteLine(lineDoc);
|
||||
}
|
||||
int deltaDisplayed = 0;
|
||||
for (int d=0;d<lineCount;d++) {
|
||||
if (lines[lineDoc+d].visible)
|
||||
deltaDisplayed -= lines[lineDoc+d].height;
|
||||
}
|
||||
for (int i = lineDoc; i < linesInDoc-lineCount; i++) {
|
||||
if (i != 0) // Line zero is always visible
|
||||
lines[i].visible = lines[i + lineCount].visible;
|
||||
lines[i].expanded = lines[i + lineCount].expanded;
|
||||
lines[i].height = lines[i + lineCount].height;
|
||||
}
|
||||
linesInDoc -= lineCount;
|
||||
linesInDisplay += deltaDisplayed;
|
||||
valid = false;
|
||||
Check();
|
||||
}
|
||||
|
||||
bool ContractionState::GetVisible(int lineDoc) const {
|
||||
if (size == 0)
|
||||
if (OneToOne()) {
|
||||
return true;
|
||||
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
|
||||
return lines[lineDoc].visible;
|
||||
} else {
|
||||
return false;
|
||||
if (lineDoc >= visible->Length())
|
||||
return true;
|
||||
return visible->ValueAt(lineDoc) == 1;
|
||||
}
|
||||
}
|
||||
|
||||
bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible) {
|
||||
if (lineDocStart == 0)
|
||||
lineDocStart++;
|
||||
if (lineDocStart > lineDocEnd)
|
||||
bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible_) {
|
||||
if (OneToOne() && visible_) {
|
||||
return false;
|
||||
if (size == 0) {
|
||||
Grow(linesInDoc + growSize);
|
||||
}
|
||||
// TODO: modify docLine members to mirror displayLine
|
||||
int delta = 0;
|
||||
// Change lineDocs
|
||||
if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < linesInDoc)) {
|
||||
for (int line=lineDocStart; line <= lineDocEnd; line++) {
|
||||
if (lines[line].visible != visible) {
|
||||
delta += visible ? lines[line].height : -lines[line].height;
|
||||
lines[line].visible = visible;
|
||||
} else {
|
||||
EnsureData();
|
||||
int delta = 0;
|
||||
Check();
|
||||
if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < LinesInDoc())) {
|
||||
for (int line = lineDocStart; line <= lineDocEnd; line++) {
|
||||
if (GetVisible(line) != visible_) {
|
||||
int difference = visible_ ? heights->ValueAt(line) : -heights->ValueAt(line);
|
||||
visible->SetValueAt(line, visible_ ? 1 : 0);
|
||||
displayLines->InsertText(line, difference);
|
||||
delta += difference;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
Check();
|
||||
return delta != 0;
|
||||
}
|
||||
linesInDisplay += delta;
|
||||
valid = false;
|
||||
return delta != 0;
|
||||
}
|
||||
|
||||
bool ContractionState::GetExpanded(int lineDoc) const {
|
||||
if (size == 0)
|
||||
if (OneToOne()) {
|
||||
return true;
|
||||
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
|
||||
return lines[lineDoc].expanded;
|
||||
} else {
|
||||
return false;
|
||||
Check();
|
||||
return expanded->ValueAt(lineDoc) == 1;
|
||||
}
|
||||
}
|
||||
|
||||
bool ContractionState::SetExpanded(int lineDoc, bool expanded) {
|
||||
if (size == 0) {
|
||||
if (expanded) {
|
||||
// If in completely expanded state then setting
|
||||
// one line to expanded has no effect.
|
||||
bool ContractionState::SetExpanded(int lineDoc, bool expanded_) {
|
||||
if (OneToOne() && expanded_) {
|
||||
return false;
|
||||
} else {
|
||||
EnsureData();
|
||||
if (expanded_ != (expanded->ValueAt(lineDoc) == 1)) {
|
||||
expanded->SetValueAt(lineDoc, expanded_ ? 1 : 0);
|
||||
Check();
|
||||
return true;
|
||||
} else {
|
||||
Check();
|
||||
return false;
|
||||
}
|
||||
Grow(linesInDoc + growSize);
|
||||
}
|
||||
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
|
||||
if (lines[lineDoc].expanded != expanded) {
|
||||
lines[lineDoc].expanded = expanded;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int ContractionState::GetHeight(int lineDoc) const {
|
||||
if (size == 0)
|
||||
if (OneToOne()) {
|
||||
return 1;
|
||||
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
|
||||
return lines[lineDoc].height;
|
||||
} else {
|
||||
return 1;
|
||||
return heights->ValueAt(lineDoc);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the number of display lines needed for this line.
|
||||
// Return true if this is a change.
|
||||
bool ContractionState::SetHeight(int lineDoc, int height) {
|
||||
if (lineDoc > linesInDoc)
|
||||
if (OneToOne() && (height == 1)) {
|
||||
return false;
|
||||
if (size == 0) {
|
||||
if (height == 1) {
|
||||
// If in completely expanded state then all lines
|
||||
// assumed to have height of one so no effect here.
|
||||
} else {
|
||||
EnsureData();
|
||||
if (GetHeight(lineDoc) != height) {
|
||||
if (GetVisible(lineDoc)) {
|
||||
displayLines->InsertText(lineDoc, height - GetHeight(lineDoc));
|
||||
}
|
||||
heights->SetValueAt(lineDoc, height);
|
||||
Check();
|
||||
return true;
|
||||
} else {
|
||||
Check();
|
||||
return false;
|
||||
}
|
||||
Grow(linesInDoc + growSize);
|
||||
}
|
||||
if (lines[lineDoc].height != height) {
|
||||
lines[lineDoc].height = height;
|
||||
valid = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ContractionState::ShowAll() {
|
||||
delete []lines;
|
||||
lines = 0;
|
||||
size = 0;
|
||||
|
||||
delete []docLines;
|
||||
docLines = 0;
|
||||
sizeDocLines = 0;
|
||||
|
||||
linesInDisplay = linesInDoc;
|
||||
int lines = LinesInDoc();
|
||||
Clear();
|
||||
linesInDocument = lines;
|
||||
}
|
||||
|
||||
// Debugging checks
|
||||
|
||||
void ContractionState::Check() const {
|
||||
#ifdef CHECK_CORRECTNESS
|
||||
for (int vline = 0;vline < LinesDisplayed(); vline++) {
|
||||
const int lineDoc = DocFromDisplay(vline);
|
||||
PLATFORM_ASSERT(GetVisible(lineDoc));
|
||||
}
|
||||
for (int lineDoc = 0;lineDoc < LinesInDoc(); lineDoc++) {
|
||||
const int displayThis = DisplayFromDoc(lineDoc);
|
||||
const int displayNext = DisplayFromDoc(lineDoc + 1);
|
||||
const int height = displayNext - displayThis;
|
||||
PLATFORM_ASSERT(height >= 0);
|
||||
if (GetVisible(lineDoc)) {
|
||||
PLATFORM_ASSERT(GetHeight(lineDoc) == height);
|
||||
} else {
|
||||
PLATFORM_ASSERT(0 == height);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1,40 +1,34 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file ContractionState.h
|
||||
** Manages visibility of lines for folding.
|
||||
** Manages visibility of lines for folding and wrapping.
|
||||
**/
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef CONTRACTIONSTATE_H
|
||||
#define CONTRACTIONSTATE_H
|
||||
|
||||
/**
|
||||
*/
|
||||
class OneLine {
|
||||
public:
|
||||
int displayLine; ///< Position within set of visible lines
|
||||
//int docLine; ///< Inverse of @a displayLine
|
||||
int height; ///< Number of display lines needed to show all of the line
|
||||
bool visible;
|
||||
bool expanded;
|
||||
|
||||
OneLine();
|
||||
virtual ~OneLine() {}
|
||||
};
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*/
|
||||
class ContractionState {
|
||||
void Grow(int sizeNew);
|
||||
enum { growSize = 4000 };
|
||||
int linesInDoc;
|
||||
mutable int linesInDisplay;
|
||||
mutable OneLine *lines;
|
||||
int size;
|
||||
mutable int *docLines;
|
||||
mutable int sizeDocLines;
|
||||
mutable bool valid;
|
||||
void MakeValid() const;
|
||||
// These contain 1 element for every document line.
|
||||
RunStyles *visible;
|
||||
RunStyles *expanded;
|
||||
RunStyles *heights;
|
||||
Partitioning *displayLines;
|
||||
int linesInDocument;
|
||||
|
||||
void EnsureData();
|
||||
|
||||
bool OneToOne() const {
|
||||
// True when each document line is exactly one display line so need for
|
||||
// complex data structures.
|
||||
return visible == 0;
|
||||
}
|
||||
|
||||
public:
|
||||
ContractionState();
|
||||
@ -47,7 +41,9 @@ public:
|
||||
int DisplayFromDoc(int lineDoc) const;
|
||||
int DocFromDisplay(int lineDisplay) const;
|
||||
|
||||
void InsertLine(int lineDoc);
|
||||
void InsertLines(int lineDoc, int lineCount);
|
||||
void DeleteLine(int lineDoc);
|
||||
void DeleteLines(int lineDoc, int lineCount);
|
||||
|
||||
bool GetVisible(int lineDoc) const;
|
||||
@ -60,6 +56,11 @@ public:
|
||||
bool SetHeight(int lineDoc, int height);
|
||||
|
||||
void ShowAll();
|
||||
void Check() const;
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
188
src/stc/scintilla/src/Decoration.cxx
Normal file
188
src/stc/scintilla/src/Decoration.cxx
Normal file
@ -0,0 +1,188 @@
|
||||
/** @file Decoration.cxx
|
||||
** Visual elements added over text.
|
||||
**/
|
||||
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "Scintilla.h"
|
||||
#include "SplitVector.h"
|
||||
#include "Partitioning.h"
|
||||
#include "RunStyles.h"
|
||||
#include "Decoration.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
Decoration::Decoration(int indicator_) : next(0), indicator(indicator_) {
|
||||
}
|
||||
|
||||
Decoration::~Decoration() {
|
||||
}
|
||||
|
||||
bool Decoration::Empty() {
|
||||
return rs.starts->Partitions() == 1;
|
||||
}
|
||||
|
||||
DecorationList::DecorationList() : currentIndicator(0), currentValue(1), current(0),
|
||||
lengthDocument(0), root(0), clickNotified(false) {
|
||||
}
|
||||
|
||||
DecorationList::~DecorationList() {
|
||||
Decoration *deco = root;
|
||||
while (deco) {
|
||||
Decoration *decoNext = deco->next;
|
||||
delete deco;
|
||||
deco = decoNext;
|
||||
}
|
||||
root = 0;
|
||||
current = 0;
|
||||
}
|
||||
|
||||
Decoration *DecorationList::DecorationFromIndicator(int indicator) {
|
||||
for (Decoration *deco=root; deco; deco = deco->next) {
|
||||
if (deco->indicator == indicator) {
|
||||
return deco;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Decoration *DecorationList::Create(int indicator, int length) {
|
||||
currentIndicator = indicator;
|
||||
Decoration *decoNew = new Decoration(indicator);
|
||||
decoNew->rs.InsertSpace(0, length);
|
||||
|
||||
Decoration *decoPrev = 0;
|
||||
Decoration *deco = root;
|
||||
|
||||
while (deco && (deco->indicator < indicator)) {
|
||||
decoPrev = deco;
|
||||
deco = deco->next;
|
||||
}
|
||||
if (decoPrev == 0) {
|
||||
decoNew->next = root;
|
||||
root = decoNew;
|
||||
} else {
|
||||
decoNew->next = deco;
|
||||
decoPrev->next = decoNew;
|
||||
}
|
||||
return decoNew;
|
||||
}
|
||||
|
||||
void DecorationList::Delete(int indicator) {
|
||||
Decoration *decoToDelete = 0;
|
||||
if (root) {
|
||||
if (root->indicator == indicator) {
|
||||
decoToDelete = root;
|
||||
root = root->next;
|
||||
} else {
|
||||
Decoration *deco=root;
|
||||
while (deco->next && !decoToDelete) {
|
||||
if (deco->next && deco->next->indicator == indicator) {
|
||||
decoToDelete = deco->next;
|
||||
deco->next = decoToDelete->next;
|
||||
} else {
|
||||
deco = deco->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (decoToDelete) {
|
||||
delete decoToDelete;
|
||||
current = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void DecorationList::SetCurrentIndicator(int indicator) {
|
||||
currentIndicator = indicator;
|
||||
current = DecorationFromIndicator(indicator);
|
||||
currentValue = 1;
|
||||
}
|
||||
|
||||
void DecorationList::SetCurrentValue(int value) {
|
||||
currentValue = value ? value : 1;
|
||||
}
|
||||
|
||||
bool DecorationList::FillRange(int &position, int value, int &fillLength) {
|
||||
if (!current) {
|
||||
current = DecorationFromIndicator(currentIndicator);
|
||||
if (!current) {
|
||||
current = Create(currentIndicator, lengthDocument);
|
||||
}
|
||||
}
|
||||
bool changed = current->rs.FillRange(position, value, fillLength);
|
||||
if (current->Empty()) {
|
||||
Delete(currentIndicator);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
void DecorationList::InsertSpace(int position, int insertLength) {
|
||||
lengthDocument += insertLength;
|
||||
for (Decoration *deco=root; deco; deco = deco->next) {
|
||||
deco->rs.InsertSpace(position, insertLength);
|
||||
}
|
||||
}
|
||||
|
||||
void DecorationList::DeleteRange(int position, int deleteLength) {
|
||||
lengthDocument -= deleteLength;
|
||||
Decoration *deco;
|
||||
for (deco=root; deco; deco = deco->next) {
|
||||
deco->rs.DeleteRange(position, deleteLength);
|
||||
}
|
||||
DeleteAnyEmpty();
|
||||
}
|
||||
|
||||
void DecorationList::DeleteAnyEmpty() {
|
||||
Decoration *deco = root;
|
||||
while (deco) {
|
||||
if (deco->Empty()) {
|
||||
Delete(deco->indicator);
|
||||
deco = root;
|
||||
} else {
|
||||
deco = deco->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int DecorationList::AllOnFor(int position) {
|
||||
int mask = 0;
|
||||
for (Decoration *deco=root; deco; deco = deco->next) {
|
||||
if (deco->rs.ValueAt(position)) {
|
||||
mask |= 1 << deco->indicator;
|
||||
}
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
|
||||
int DecorationList::ValueAt(int indicator, int position) {
|
||||
Decoration *deco = DecorationFromIndicator(indicator);
|
||||
if (deco) {
|
||||
return deco->rs.ValueAt(position);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DecorationList::Start(int indicator, int position) {
|
||||
Decoration *deco = DecorationFromIndicator(indicator);
|
||||
if (deco) {
|
||||
return deco->rs.StartRun(position);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DecorationList::End(int indicator, int position) {
|
||||
Decoration *deco = DecorationFromIndicator(indicator);
|
||||
if (deco) {
|
||||
return deco->rs.EndRun(position);
|
||||
}
|
||||
return 0;
|
||||
}
|
64
src/stc/scintilla/src/Decoration.h
Normal file
64
src/stc/scintilla/src/Decoration.h
Normal file
@ -0,0 +1,64 @@
|
||||
/** @file Decoration.h
|
||||
** Visual elements added over text.
|
||||
**/
|
||||
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef DECORATION_H
|
||||
#define DECORATION_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
class Decoration {
|
||||
public:
|
||||
Decoration *next;
|
||||
RunStyles rs;
|
||||
int indicator;
|
||||
|
||||
Decoration(int indicator_);
|
||||
~Decoration();
|
||||
|
||||
bool Empty();
|
||||
};
|
||||
|
||||
class DecorationList {
|
||||
int currentIndicator;
|
||||
int currentValue;
|
||||
Decoration *current;
|
||||
int lengthDocument;
|
||||
Decoration *DecorationFromIndicator(int indicator);
|
||||
Decoration *Create(int indicator, int length);
|
||||
void Delete(int indicator);
|
||||
void DeleteAnyEmpty();
|
||||
public:
|
||||
Decoration *root;
|
||||
bool clickNotified;
|
||||
|
||||
DecorationList();
|
||||
~DecorationList();
|
||||
|
||||
void SetCurrentIndicator(int indicator);
|
||||
int GetCurrentIndicator() { return currentIndicator; }
|
||||
|
||||
void SetCurrentValue(int value);
|
||||
int GetCurrentValue() { return currentValue; }
|
||||
|
||||
// Returns true if some values may have changed
|
||||
bool FillRange(int &position, int value, int &fillLength);
|
||||
|
||||
void InsertSpace(int position, int insertLength);
|
||||
void DeleteRange(int position, int deleteLength);
|
||||
|
||||
int AllOnFor(int position);
|
||||
int ValueAt(int indicator, int position);
|
||||
int Start(int indicator, int position);
|
||||
int End(int indicator, int position);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -13,12 +13,19 @@
|
||||
#include "Platform.h"
|
||||
|
||||
#include "Scintilla.h"
|
||||
#include "SVector.h"
|
||||
#include "SplitVector.h"
|
||||
#include "Partitioning.h"
|
||||
#include "RunStyles.h"
|
||||
#include "CellBuffer.h"
|
||||
#include "CharClassify.h"
|
||||
#include "Decoration.h"
|
||||
#include "Document.h"
|
||||
#include "RESearch.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
// This is ASCII specific but is safe with chars >= 0x80
|
||||
static inline bool isspacechar(unsigned char ch) {
|
||||
return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
|
||||
@ -53,7 +60,8 @@ Document::Document() {
|
||||
stylingMask = 0;
|
||||
endStyled = 0;
|
||||
styleClock = 0;
|
||||
enteredCount = 0;
|
||||
enteredModification = 0;
|
||||
enteredStyling = 0;
|
||||
enteredReadOnlyCount = 0;
|
||||
tabInChars = 8;
|
||||
indentInChars = 0;
|
||||
@ -104,7 +112,6 @@ void Document::SetSavePoint() {
|
||||
int Document::AddMark(int line, int markerNum) {
|
||||
int prev = cb.AddMark(line, markerNum);
|
||||
DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
|
||||
mh.line = line;
|
||||
NotifyModified(mh);
|
||||
return prev;
|
||||
}
|
||||
@ -115,14 +122,12 @@ void Document::AddMarkSet(int line, int valueSet) {
|
||||
if (m & 1)
|
||||
cb.AddMark(line, i);
|
||||
DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
|
||||
mh.line = line;
|
||||
NotifyModified(mh);
|
||||
}
|
||||
|
||||
void Document::DeleteMark(int line, int markerNum) {
|
||||
cb.DeleteMark(line, markerNum);
|
||||
DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
|
||||
mh.line = line;
|
||||
NotifyModified(mh);
|
||||
}
|
||||
|
||||
@ -140,11 +145,11 @@ void Document::DeleteAllMarks(int markerNum) {
|
||||
NotifyModified(mh);
|
||||
}
|
||||
|
||||
int Document::LineStart(int line) {
|
||||
int Document::LineStart(int line) const {
|
||||
return cb.LineStart(line);
|
||||
}
|
||||
|
||||
int Document::LineEnd(int line) {
|
||||
int Document::LineEnd(int line) const {
|
||||
if (line == LinesTotal() - 1) {
|
||||
return LineStart(line + 1);
|
||||
} else {
|
||||
@ -182,8 +187,7 @@ int Document::SetLevel(int line, int level) {
|
||||
int prev = cb.SetLevel(line, level);
|
||||
if (prev != level) {
|
||||
DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER,
|
||||
LineStart(line), 0, 0, 0);
|
||||
mh.line = line;
|
||||
LineStart(line), 0, 0, 0, line);
|
||||
mh.foldLevelNow = level;
|
||||
mh.foldLevelPrev = prev;
|
||||
NotifyModified(mh);
|
||||
@ -261,7 +265,9 @@ int Document::LenChar(int pos) {
|
||||
if (ch < 0x80)
|
||||
return 1;
|
||||
int len = 2;
|
||||
if (ch >= (0x80 + 0x40 + 0x20))
|
||||
if (ch >= (0x80 + 0x40 + 0x20 + 0x10))
|
||||
len = 4;
|
||||
else if (ch >= (0x80 + 0x40 + 0x20))
|
||||
len = 3;
|
||||
int lengthDoc = Length();
|
||||
if ((pos + len) > lengthDoc)
|
||||
@ -281,6 +287,55 @@ int Document::LenChar(int pos) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsTrailByte(int ch) {
|
||||
return (ch >= 0x80) && (ch < (0x80 + 0x40));
|
||||
}
|
||||
|
||||
static int BytesFromLead(int leadByte) {
|
||||
if (leadByte > 0xF4) {
|
||||
// Characters longer than 4 bytes not possible in current UTF-8
|
||||
return 0;
|
||||
} else if (leadByte >= 0xF0) {
|
||||
return 4;
|
||||
} else if (leadByte >= 0xE0) {
|
||||
return 3;
|
||||
} else if (leadByte >= 0xC2) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Document::InGoodUTF8(int pos, int &start, int &end) {
|
||||
int lead = pos;
|
||||
while ((lead>0) && (pos-lead < 4) && IsTrailByte(static_cast<unsigned char>(cb.CharAt(lead-1))))
|
||||
lead--;
|
||||
start = 0;
|
||||
if (lead > 0) {
|
||||
start = lead-1;
|
||||
}
|
||||
int leadByte = static_cast<unsigned char>(cb.CharAt(start));
|
||||
int bytes = BytesFromLead(leadByte);
|
||||
if (bytes == 0) {
|
||||
return false;
|
||||
} else {
|
||||
int trailBytes = bytes - 1;
|
||||
int len = pos - lead + 1;
|
||||
if (len > trailBytes)
|
||||
// pos too far from lead
|
||||
return false;
|
||||
// Check that there are enough trails for this lead
|
||||
int trail = pos + 1;
|
||||
while ((trail-lead<trailBytes) && (trail < Length())) {
|
||||
if (!IsTrailByte(static_cast<unsigned char>(cb.CharAt(trail)))) {
|
||||
return false;
|
||||
}
|
||||
trail++;
|
||||
}
|
||||
end = start + bytes;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Normalise a position so that it is not halfway through a two byte character.
|
||||
// This can occur in two situations -
|
||||
// When lines are terminated with \r\n pairs which should be treated as one character.
|
||||
@ -307,13 +362,14 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
|
||||
if (dbcsCodePage) {
|
||||
if (SC_CP_UTF8 == dbcsCodePage) {
|
||||
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
while ((pos > 0) && (pos < Length()) && (ch >= 0x80) && (ch < (0x80 + 0x40))) {
|
||||
// ch is a trail byte
|
||||
int startUTF = pos;
|
||||
int endUTF = pos;
|
||||
if (IsTrailByte(ch) && InGoodUTF8(pos, startUTF, endUTF)) {
|
||||
// ch is a trail byte within a UTF-8 character
|
||||
if (moveDir > 0)
|
||||
pos++;
|
||||
pos = endUTF;
|
||||
else
|
||||
pos--;
|
||||
ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
pos = startUTF;
|
||||
}
|
||||
} else {
|
||||
// Anchor DBCS calculations at start of line because start of line can
|
||||
@ -358,20 +414,19 @@ void Document::CheckReadOnly() {
|
||||
}
|
||||
}
|
||||
|
||||
// Document only modified by gateways DeleteChars, InsertStyledString, Undo, Redo, and SetStyleAt.
|
||||
// Document only modified by gateways DeleteChars, InsertString, Undo, Redo, and SetStyleAt.
|
||||
// SetStyleAt does not change the persistent state of a document
|
||||
|
||||
// Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number
|
||||
bool Document::DeleteChars(int pos, int len) {
|
||||
if (len == 0)
|
||||
return false;
|
||||
if ((pos + len) > Length())
|
||||
return false;
|
||||
CheckReadOnly();
|
||||
if (enteredCount != 0) {
|
||||
if (enteredModification != 0) {
|
||||
return false;
|
||||
} else {
|
||||
enteredCount++;
|
||||
enteredModification++;
|
||||
if (!cb.IsReadOnly()) {
|
||||
NotifyModified(
|
||||
DocModification(
|
||||
@ -380,7 +435,8 @@ bool Document::DeleteChars(int pos, int len) {
|
||||
0, 0));
|
||||
int prevLinesTotal = LinesTotal();
|
||||
bool startSavePoint = cb.IsSavePoint();
|
||||
const char *text = cb.DeleteChars(pos * 2, len * 2);
|
||||
bool startSequence = false;
|
||||
const char *text = cb.DeleteChars(pos, len, startSequence);
|
||||
if (startSavePoint && cb.IsCollectingUndo())
|
||||
NotifySavePoint(!startSavePoint);
|
||||
if ((pos < Length()) || (pos == 0))
|
||||
@ -389,43 +445,47 @@ bool Document::DeleteChars(int pos, int len) {
|
||||
ModifiedAt(pos-1);
|
||||
NotifyModified(
|
||||
DocModification(
|
||||
SC_MOD_DELETETEXT | SC_PERFORMED_USER,
|
||||
SC_MOD_DELETETEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0),
|
||||
pos, len,
|
||||
LinesTotal() - prevLinesTotal, text));
|
||||
}
|
||||
enteredCount--;
|
||||
enteredModification--;
|
||||
}
|
||||
return !cb.IsReadOnly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a styled string (char/style pairs) with a length.
|
||||
* Insert a string with a length.
|
||||
*/
|
||||
bool Document::InsertStyledString(int position, char *s, int insertLength) {
|
||||
bool Document::InsertString(int position, const char *s, int insertLength) {
|
||||
if (insertLength <= 0) {
|
||||
return false;
|
||||
}
|
||||
CheckReadOnly();
|
||||
if (enteredCount != 0) {
|
||||
if (enteredModification != 0) {
|
||||
return false;
|
||||
} else {
|
||||
enteredCount++;
|
||||
enteredModification++;
|
||||
if (!cb.IsReadOnly()) {
|
||||
NotifyModified(
|
||||
DocModification(
|
||||
SC_MOD_BEFOREINSERT | SC_PERFORMED_USER,
|
||||
position / 2, insertLength / 2,
|
||||
position, insertLength,
|
||||
0, s));
|
||||
int prevLinesTotal = LinesTotal();
|
||||
bool startSavePoint = cb.IsSavePoint();
|
||||
const char *text = cb.InsertString(position, s, insertLength);
|
||||
bool startSequence = false;
|
||||
const char *text = cb.InsertString(position, s, insertLength, startSequence);
|
||||
if (startSavePoint && cb.IsCollectingUndo())
|
||||
NotifySavePoint(!startSavePoint);
|
||||
ModifiedAt(position / 2);
|
||||
ModifiedAt(position);
|
||||
NotifyModified(
|
||||
DocModification(
|
||||
SC_MOD_INSERTTEXT | SC_PERFORMED_USER,
|
||||
position / 2, insertLength / 2,
|
||||
SC_MOD_INSERTTEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0),
|
||||
position, insertLength,
|
||||
LinesTotal() - prevLinesTotal, text));
|
||||
}
|
||||
enteredCount--;
|
||||
enteredModification--;
|
||||
}
|
||||
return !cb.IsReadOnly();
|
||||
}
|
||||
@ -433,8 +493,8 @@ bool Document::InsertStyledString(int position, char *s, int insertLength) {
|
||||
int Document::Undo() {
|
||||
int newPos = -1;
|
||||
CheckReadOnly();
|
||||
if (enteredCount == 0) {
|
||||
enteredCount++;
|
||||
if (enteredModification == 0) {
|
||||
enteredModification++;
|
||||
if (!cb.IsReadOnly()) {
|
||||
bool startSavePoint = cb.IsSavePoint();
|
||||
bool multiLine = false;
|
||||
@ -481,7 +541,7 @@ int Document::Undo() {
|
||||
if (startSavePoint != endSavePoint)
|
||||
NotifySavePoint(endSavePoint);
|
||||
}
|
||||
enteredCount--;
|
||||
enteredModification--;
|
||||
}
|
||||
return newPos;
|
||||
}
|
||||
@ -489,8 +549,8 @@ int Document::Undo() {
|
||||
int Document::Redo() {
|
||||
int newPos = -1;
|
||||
CheckReadOnly();
|
||||
if (enteredCount == 0) {
|
||||
enteredCount++;
|
||||
if (enteredModification == 0) {
|
||||
enteredModification++;
|
||||
if (!cb.IsReadOnly()) {
|
||||
bool startSavePoint = cb.IsSavePoint();
|
||||
bool multiLine = false;
|
||||
@ -535,7 +595,7 @@ int Document::Redo() {
|
||||
if (startSavePoint != endSavePoint)
|
||||
NotifySavePoint(endSavePoint);
|
||||
}
|
||||
enteredCount--;
|
||||
enteredModification--;
|
||||
}
|
||||
return newPos;
|
||||
}
|
||||
@ -544,39 +604,18 @@ int Document::Redo() {
|
||||
* Insert a single character.
|
||||
*/
|
||||
bool Document::InsertChar(int pos, char ch) {
|
||||
char chs[2];
|
||||
char chs[1];
|
||||
chs[0] = ch;
|
||||
chs[1] = 0;
|
||||
return InsertStyledString(pos*2, chs, 2);
|
||||
return InsertString(pos, chs, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a null terminated string.
|
||||
*/
|
||||
bool Document::InsertString(int position, const char *s) {
|
||||
bool Document::InsertCString(int position, const char *s) {
|
||||
return InsertString(position, s, strlen(s));
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a string with a length.
|
||||
*/
|
||||
bool Document::InsertString(int position, const char *s, size_t insertLength) {
|
||||
bool changed = false;
|
||||
if (insertLength > 0) {
|
||||
char *sWithStyle = new char[insertLength * 2];
|
||||
if (sWithStyle) {
|
||||
for (size_t i = 0; i < insertLength; i++) {
|
||||
sWithStyle[i*2] = s[i];
|
||||
sWithStyle[i*2 + 1] = 0;
|
||||
}
|
||||
changed = InsertStyledString(position*2, sWithStyle,
|
||||
static_cast<int>(insertLength*2));
|
||||
delete []sWithStyle;
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
void Document::ChangeChar(int pos, char ch) {
|
||||
DeleteChars(pos, 1);
|
||||
InsertChar(pos, ch);
|
||||
@ -653,12 +692,12 @@ void Document::SetLineIndentation(int line, int indent) {
|
||||
int indentPos = GetLineIndentPosition(line);
|
||||
BeginUndoAction();
|
||||
DeleteChars(thisLineStart, indentPos - thisLineStart);
|
||||
InsertString(thisLineStart, linebuf);
|
||||
InsertCString(thisLineStart, linebuf);
|
||||
EndUndoAction();
|
||||
}
|
||||
}
|
||||
|
||||
int Document::GetLineIndentPosition(int line) {
|
||||
int Document::GetLineIndentPosition(int line) const {
|
||||
if (line < 0)
|
||||
return 0;
|
||||
int pos = LineStart(line);
|
||||
@ -682,9 +721,11 @@ int Document::GetColumn(int pos) {
|
||||
return column;
|
||||
} else if (ch == '\n') {
|
||||
return column;
|
||||
} else if (i >= Length()) {
|
||||
return column;
|
||||
} else {
|
||||
column++;
|
||||
i = MovePositionOutsideChar(i + 1, 1);
|
||||
i = MovePositionOutsideChar(i + 1, 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -706,7 +747,7 @@ int Document::FindColumn(int line, int column) {
|
||||
return position;
|
||||
} else {
|
||||
columnCurrent++;
|
||||
position = MovePositionOutsideChar(position + 1, 1);
|
||||
position = MovePositionOutsideChar(position + 1, 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -797,7 +838,7 @@ void Document::ConvertLineEnds(int eolModeSet) {
|
||||
EndUndoAction();
|
||||
}
|
||||
|
||||
bool Document::IsWhiteLine(int line) {
|
||||
bool Document::IsWhiteLine(int line) const {
|
||||
int currentChar = LineStart(line);
|
||||
int endLine = LineEnd(line);
|
||||
while (currentChar < endLine) {
|
||||
@ -854,7 +895,7 @@ int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) {
|
||||
while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart))
|
||||
pos--;
|
||||
} else {
|
||||
if (!onlyWordCharacters)
|
||||
if (!onlyWordCharacters && pos < Length())
|
||||
ccStart = WordCharClass(cb.CharAt(pos));
|
||||
while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart))
|
||||
pos++;
|
||||
@ -1242,7 +1283,7 @@ const char *Document::SubstituteByPosition(const char *text, int *length) {
|
||||
return substituted;
|
||||
}
|
||||
|
||||
int Document::LinesTotal() {
|
||||
int Document::LinesTotal() const {
|
||||
return cb.Lines();
|
||||
}
|
||||
|
||||
@ -1275,11 +1316,7 @@ void Document::SetCharClasses(const unsigned char *chars, CharClassify::cc newCh
|
||||
|
||||
void Document::SetStylingBits(int bits) {
|
||||
stylingBits = bits;
|
||||
stylingBitsMask = 0;
|
||||
for (int bit = 0; bit < stylingBits; bit++) {
|
||||
stylingBitsMask <<= 1;
|
||||
stylingBitsMask |= 1;
|
||||
}
|
||||
stylingBitsMask = (1 << stylingBits) - 1;
|
||||
}
|
||||
|
||||
void Document::StartStyling(int position, char mask) {
|
||||
@ -1288,10 +1325,10 @@ void Document::StartStyling(int position, char mask) {
|
||||
}
|
||||
|
||||
bool Document::SetStyleFor(int length, char style) {
|
||||
if (enteredCount != 0) {
|
||||
if (enteredStyling != 0) {
|
||||
return false;
|
||||
} else {
|
||||
enteredCount++;
|
||||
enteredStyling++;
|
||||
style &= stylingMask;
|
||||
int prevEndStyled = endStyled;
|
||||
if (cb.SetStyleFor(endStyled, length, style, stylingMask)) {
|
||||
@ -1300,16 +1337,16 @@ bool Document::SetStyleFor(int length, char style) {
|
||||
NotifyModified(mh);
|
||||
}
|
||||
endStyled += length;
|
||||
enteredCount--;
|
||||
enteredStyling--;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Document::SetStyles(int length, char *styles) {
|
||||
if (enteredCount != 0) {
|
||||
if (enteredStyling != 0) {
|
||||
return false;
|
||||
} else {
|
||||
enteredCount++;
|
||||
enteredStyling++;
|
||||
bool didChange = false;
|
||||
int startMod = 0;
|
||||
int endMod = 0;
|
||||
@ -1328,26 +1365,39 @@ bool Document::SetStyles(int length, char *styles) {
|
||||
startMod, endMod - startMod + 1);
|
||||
NotifyModified(mh);
|
||||
}
|
||||
enteredCount--;
|
||||
enteredStyling--;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Document::EnsureStyledTo(int pos) {
|
||||
if (pos > GetEndStyled()) {
|
||||
void Document::EnsureStyledTo(int pos) {
|
||||
if ((enteredStyling == 0) && (pos > GetEndStyled())) {
|
||||
IncrementStyleClock();
|
||||
// Ask the watchers to style, and stop as soon as one responds.
|
||||
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) {
|
||||
watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos);
|
||||
}
|
||||
}
|
||||
return pos <= GetEndStyled();
|
||||
}
|
||||
|
||||
int Document::SetLineState(int line, int state) {
|
||||
int statePrevious = cb.SetLineState(line, state);
|
||||
if (state != statePrevious) {
|
||||
DocModification mh(SC_MOD_CHANGELINESTATE, 0, 0, 0, 0, line);
|
||||
NotifyModified(mh);
|
||||
}
|
||||
return statePrevious;
|
||||
}
|
||||
|
||||
void Document::IncrementStyleClock() {
|
||||
styleClock++;
|
||||
if (styleClock > 0x100000) {
|
||||
styleClock = 0;
|
||||
styleClock = (styleClock + 1) % 0x100000;
|
||||
}
|
||||
|
||||
void Document::DecorationFillRange(int position, int value, int fillLength) {
|
||||
if (decorations.FillRange(position, value, fillLength)) {
|
||||
DocModification mh(SC_MOD_CHANGEINDICATOR | SC_PERFORMED_USER,
|
||||
position, fillLength);
|
||||
NotifyModified(mh);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1408,6 +1458,11 @@ void Document::NotifySavePoint(bool atSavePoint) {
|
||||
}
|
||||
|
||||
void Document::NotifyModified(DocModification mh) {
|
||||
if (mh.modificationType & SC_MOD_INSERTTEXT) {
|
||||
decorations.InsertSpace(mh.position, mh.length);
|
||||
} else if (mh.modificationType & SC_MOD_DELETETEXT) {
|
||||
decorations.DeleteRange(mh.position, mh.length);
|
||||
}
|
||||
for (int i = 0; i < lenWatchers; i++) {
|
||||
watchers[i].watcher->NotifyModified(this, mh, watchers[i].userData);
|
||||
}
|
||||
|
@ -8,6 +8,10 @@
|
||||
#ifndef DOCUMENT_H
|
||||
#define DOCUMENT_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A Position is a position within a document between two characters or at the beginning or end.
|
||||
* Sometimes used as a character index where it identifies the character after the position.
|
||||
@ -28,10 +32,10 @@ public:
|
||||
|
||||
Range(Position pos=0) :
|
||||
start(pos), end(pos) {
|
||||
}
|
||||
};
|
||||
Range(Position start_, Position end_) :
|
||||
start(start_), end(end_) {
|
||||
}
|
||||
};
|
||||
|
||||
bool Valid() const {
|
||||
return (start != invalidPosition) && (end != invalidPosition);
|
||||
@ -97,7 +101,8 @@ private:
|
||||
char stylingMask;
|
||||
int endStyled;
|
||||
int styleClock;
|
||||
int enteredCount;
|
||||
int enteredModification;
|
||||
int enteredStyling;
|
||||
int enteredReadOnlyCount;
|
||||
|
||||
WatcherWithUserData *watchers;
|
||||
@ -121,6 +126,8 @@ public:
|
||||
bool tabIndents;
|
||||
bool backspaceUnindents;
|
||||
|
||||
DecorationList decorations;
|
||||
|
||||
Document();
|
||||
virtual ~Document();
|
||||
|
||||
@ -131,12 +138,14 @@ public:
|
||||
int ClampPositionIntoDocument(int pos);
|
||||
bool IsCrLf(int pos);
|
||||
int LenChar(int pos);
|
||||
bool InGoodUTF8(int pos, int &start, int &end);
|
||||
int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true);
|
||||
|
||||
// Gateways to modifying document
|
||||
void ModifiedAt(int pos);
|
||||
void CheckReadOnly();
|
||||
bool DeleteChars(int pos, int len);
|
||||
bool InsertStyledString(int position, char *s, int insertLength);
|
||||
bool InsertString(int position, const char *s, int insertLength);
|
||||
int Undo();
|
||||
int Redo();
|
||||
bool CanUndo() { return cb.CanUndo(); }
|
||||
@ -153,7 +162,7 @@ public:
|
||||
|
||||
int GetLineIndentation(int line);
|
||||
void SetLineIndentation(int line, int indent);
|
||||
int GetLineIndentPosition(int line);
|
||||
int GetLineIndentPosition(int line) const;
|
||||
int GetColumn(int position);
|
||||
int FindColumn(int line, int column);
|
||||
void Indent(bool forwards, int lineBottom, int lineTop);
|
||||
@ -163,8 +172,7 @@ public:
|
||||
bool IsReadOnly() { return cb.IsReadOnly(); }
|
||||
|
||||
bool InsertChar(int pos, char ch);
|
||||
bool InsertString(int position, const char *s);
|
||||
bool InsertString(int position, const char *s, size_t insertLength);
|
||||
bool InsertCString(int position, const char *s);
|
||||
void ChangeChar(int pos, char ch);
|
||||
void DelChar(int pos);
|
||||
void DelCharBack(int pos);
|
||||
@ -181,8 +189,8 @@ public:
|
||||
void DeleteMarkFromHandle(int markerHandle);
|
||||
void DeleteAllMarks(int markerNum);
|
||||
int LineFromHandle(int markerHandle) { return cb.LineFromHandle(markerHandle); }
|
||||
int LineStart(int line);
|
||||
int LineEnd(int line);
|
||||
int LineStart(int line) const;
|
||||
int LineEnd(int line) const;
|
||||
int LineEndPosition(int position);
|
||||
int VCHomePosition(int position);
|
||||
|
||||
@ -196,13 +204,13 @@ public:
|
||||
int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false);
|
||||
int NextWordStart(int pos, int delta);
|
||||
int NextWordEnd(int pos, int delta);
|
||||
int Length() { return cb.Length(); }
|
||||
void Allocate(int newSize) { cb.Allocate(newSize*2); }
|
||||
int Length() const { return cb.Length(); }
|
||||
void Allocate(int newSize) { cb.Allocate(newSize); }
|
||||
long FindText(int minPos, int maxPos, const char *s,
|
||||
bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix, int *length);
|
||||
long FindText(int iMessage, unsigned long wParam, long lParam);
|
||||
const char *SubstituteByPosition(const char *text, int *length);
|
||||
int LinesTotal();
|
||||
int LinesTotal() const;
|
||||
|
||||
void ChangeCase(Range r, bool makeUpperCase);
|
||||
|
||||
@ -213,11 +221,12 @@ public:
|
||||
bool SetStyleFor(int length, char style);
|
||||
bool SetStyles(int length, char *styles);
|
||||
int GetEndStyled() { return endStyled; }
|
||||
bool EnsureStyledTo(int pos);
|
||||
void EnsureStyledTo(int pos);
|
||||
int GetStyleClock() { return styleClock; }
|
||||
void IncrementStyleClock();
|
||||
void DecorationFillRange(int position, int value, int fillLength);
|
||||
|
||||
int SetLineState(int line, int state) { return cb.SetLineState(line, state); }
|
||||
int SetLineState(int line, int state);
|
||||
int GetLineState(int line) { return cb.GetLineState(line); }
|
||||
int GetMaxLineState() { return cb.GetMaxLineState(); }
|
||||
|
||||
@ -230,15 +239,13 @@ public:
|
||||
int WordPartLeft(int pos);
|
||||
int WordPartRight(int pos);
|
||||
int ExtendStyleRange(int pos, int delta, bool singleLine = false);
|
||||
bool IsWhiteLine(int line);
|
||||
bool IsWhiteLine(int line) const;
|
||||
int ParaUp(int pos);
|
||||
int ParaDown(int pos);
|
||||
int IndentSize() { return actualIndentInChars; }
|
||||
int BraceMatch(int position, int maxReStyle);
|
||||
|
||||
private:
|
||||
void CheckReadOnly();
|
||||
|
||||
CharClassify::cc WordCharClass(unsigned char ch);
|
||||
bool IsWordStartAt(int pos);
|
||||
bool IsWordEndAt(int pos);
|
||||
@ -302,4 +309,8 @@ public:
|
||||
virtual void NotifyStyleNeeded(Document *doc, void *userData, int endPos) = 0;
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -13,14 +13,21 @@
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "SVector.h"
|
||||
#include "Accessor.h"
|
||||
#include "DocumentAccessor.h"
|
||||
#include "SplitVector.h"
|
||||
#include "Partitioning.h"
|
||||
#include "RunStyles.h"
|
||||
#include "CellBuffer.h"
|
||||
#include "Scintilla.h"
|
||||
#include "CharClassify.h"
|
||||
#include "Decoration.h"
|
||||
#include "Document.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
DocumentAccessor::~DocumentAccessor() {
|
||||
}
|
||||
|
||||
@ -103,8 +110,9 @@ void DocumentAccessor::StartSegment(unsigned int pos) {
|
||||
void DocumentAccessor::ColourTo(unsigned int pos, int chAttr) {
|
||||
// Only perform styling if non empty range
|
||||
if (pos != startSeg - 1) {
|
||||
PLATFORM_ASSERT(pos >= startSeg);
|
||||
if (pos < startSeg) {
|
||||
Platform::DebugPrintf("Bad colour positions %d - %d\n", startSeg, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
if (validLen + (pos - startSeg + 1) >= bufferSize)
|
||||
@ -185,3 +193,7 @@ int DocumentAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnI
|
||||
return indent;
|
||||
}
|
||||
|
||||
void DocumentAccessor::IndicatorFill(int start, int end, int indicator, int value) {
|
||||
pdoc->decorations.SetCurrentIndicator(indicator);
|
||||
pdoc->DecorationFillRange(start, value, end - start);
|
||||
}
|
||||
|
@ -6,6 +6,10 @@
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
class Document;
|
||||
|
||||
/**
|
||||
@ -58,10 +62,15 @@ public:
|
||||
WindowID GetWindow() { return id; }
|
||||
|
||||
void StartAt(unsigned int start, char chMask=31);
|
||||
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }
|
||||
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };
|
||||
unsigned int GetStartSegment() { return startSeg; }
|
||||
void StartSegment(unsigned int pos);
|
||||
void ColourTo(unsigned int pos, int chAttr);
|
||||
void SetLevel(int line, int level);
|
||||
int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
|
||||
void IndicatorFill(int start, int end, int indicator, int value);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,10 @@
|
||||
#ifndef EDITOR_H
|
||||
#define EDITOR_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*/
|
||||
class Caret {
|
||||
@ -41,92 +45,6 @@ public:
|
||||
Idler();
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
class LineLayout {
|
||||
private:
|
||||
friend class LineLayoutCache;
|
||||
int *lineStarts;
|
||||
int lenLineStarts;
|
||||
/// Drawing is only performed for @a maxLineLength characters on each line.
|
||||
int lineNumber;
|
||||
bool inCache;
|
||||
public:
|
||||
enum { wrapWidthInfinite = 0x7ffffff };
|
||||
int maxLineLength;
|
||||
int numCharsInLine;
|
||||
enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity;
|
||||
int xHighlightGuide;
|
||||
bool highlightColumn;
|
||||
int selStart;
|
||||
int selEnd;
|
||||
bool containsCaret;
|
||||
int edgeColumn;
|
||||
char *chars;
|
||||
unsigned char *styles;
|
||||
int styleBitsSet;
|
||||
char *indicators;
|
||||
int *positions;
|
||||
char bracePreviousStyles[2];
|
||||
|
||||
// Hotspot support
|
||||
int hsStart;
|
||||
int hsEnd;
|
||||
|
||||
// Wrapped line support
|
||||
int widthLine;
|
||||
int lines;
|
||||
|
||||
LineLayout(int maxLineLength_);
|
||||
virtual ~LineLayout();
|
||||
void Resize(int maxLineLength_);
|
||||
void Free();
|
||||
void Invalidate(validLevel validity_);
|
||||
int LineStart(int line) {
|
||||
if (line <= 0) {
|
||||
return 0;
|
||||
} else if ((line >= lines) || !lineStarts) {
|
||||
return numCharsInLine;
|
||||
} else {
|
||||
return lineStarts[line];
|
||||
}
|
||||
}
|
||||
void SetLineStart(int line, int start);
|
||||
void SetBracesHighlight(Range rangeLine, Position braces[],
|
||||
char bracesMatchStyle, int xHighlight);
|
||||
void RestoreBracesHighlight(Range rangeLine, Position braces[]);
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
class LineLayoutCache {
|
||||
int level;
|
||||
int length;
|
||||
int size;
|
||||
LineLayout **cache;
|
||||
bool allInvalidated;
|
||||
int styleClock;
|
||||
int useCount;
|
||||
void Allocate(int length_);
|
||||
void AllocateForLevel(int linesOnScreen, int linesInDoc);
|
||||
public:
|
||||
LineLayoutCache();
|
||||
virtual ~LineLayoutCache();
|
||||
void Deallocate();
|
||||
enum {
|
||||
llcNone=SC_CACHE_NONE,
|
||||
llcCaret=SC_CACHE_CARET,
|
||||
llcPage=SC_CACHE_PAGE,
|
||||
llcDocument=SC_CACHE_DOCUMENT
|
||||
};
|
||||
void Invalidate(LineLayout::validLevel validity_);
|
||||
void SetLevel(int level_);
|
||||
int GetLevel() { return level; }
|
||||
LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
|
||||
int linesOnScreen, int linesInDoc);
|
||||
void Dispose(LineLayout *ll);
|
||||
};
|
||||
|
||||
/**
|
||||
* Hold a piece of text selected for copying or dragging.
|
||||
* The text is expected to hold a terminating '\0' and this is counted in len.
|
||||
@ -218,6 +136,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret
|
||||
bool horizontalScrollBarVisible;
|
||||
int scrollWidth;
|
||||
bool trackLineWidth;
|
||||
int lineWidthMaxSeen;
|
||||
bool verticalScrollBarVisible;
|
||||
bool endAtLastLine;
|
||||
bool caretSticky;
|
||||
@ -229,6 +149,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
Surface *pixmapIndentGuideHighlight;
|
||||
|
||||
LineLayoutCache llc;
|
||||
PositionCache posCache;
|
||||
|
||||
KeyMap kmap;
|
||||
|
||||
@ -246,7 +167,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
bool dwelling;
|
||||
enum { selChar, selWord, selLine } selectionType;
|
||||
Point ptMouseLast;
|
||||
bool inDragDrop;
|
||||
enum { ddNone, ddInitial, ddDragging } inDragDrop;
|
||||
bool dropWentOutside;
|
||||
int posDrag;
|
||||
int posDrop;
|
||||
@ -378,6 +299,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
virtual void UpdateSystemCaret();
|
||||
|
||||
void NeedWrapping(int docLineStart = 0, int docLineEnd = wrapLineLarge);
|
||||
bool WrapOneLine(Surface *surface, int lineToWrap);
|
||||
bool WrapLines(bool fullWrap, int priorityWrapLineStart);
|
||||
void LinesJoin();
|
||||
void LinesSplit(int pixelWidth);
|
||||
@ -395,8 +317,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
int line, int lineEnd, int xStart, int subLine, int subLineStart,
|
||||
bool overrideBackground, ColourAllocated background,
|
||||
bool drawWrapMark, ColourAllocated wrapColour);
|
||||
void DrawIndicators(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
|
||||
PRectangle rcLine, LineLayout *ll, int subLine, int lineEnd, bool under);
|
||||
void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
|
||||
PRectangle rcLine, LineLayout *ll, int subLine=0);
|
||||
void DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine, int xStart, int offset, int posCaret, PRectangle rcCaret);
|
||||
void RefreshPixMaps(Surface *surfaceWindow);
|
||||
void Paint(Surface *surfaceWindow, PRectangle rcArea);
|
||||
long FormatRange(bool draw, RangeToFormat *pfr);
|
||||
@ -413,7 +338,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
|
||||
void ClearSelection();
|
||||
void ClearAll();
|
||||
void ClearDocumentStyle();
|
||||
void ClearDocumentStyle();
|
||||
void Cut();
|
||||
void PasteRectangular(int pos, const char *ptr, int len);
|
||||
virtual void Copy() = 0;
|
||||
@ -436,11 +361,12 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
void NotifyMove(int position);
|
||||
void NotifySavePoint(bool isSavePoint);
|
||||
void NotifyModifyAttempt();
|
||||
virtual void NotifyDoubleClick(Point pt, bool shift);
|
||||
virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);
|
||||
void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt);
|
||||
void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt);
|
||||
void NotifyUpdateUI();
|
||||
void NotifyPainted();
|
||||
void NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt);
|
||||
bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
|
||||
void NotifyNeedShown(int pos, int len);
|
||||
void NotifyDwelling(Point pt, bool state);
|
||||
@ -486,6 +412,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
void CopyText(int length, const char *text);
|
||||
void SetDragPosition(int newPos);
|
||||
virtual void DisplayCursor(Window::Cursor c);
|
||||
virtual bool DragThreshold(Point ptStart, Point ptNow);
|
||||
virtual void StartDrag();
|
||||
void DropAt(int position, const char *value, bool moving, bool rectangular);
|
||||
/** PositionInSelection returns 0 if position in selection, -1 if position before selection, and 1 if after.
|
||||
@ -527,8 +454,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
int CodePage() const;
|
||||
virtual bool ValidCodePage(int /* codePage */) const { return true; }
|
||||
int WrapCount(int line);
|
||||
void AddStyledText(char *buffer, int appendLength);
|
||||
|
||||
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;
|
||||
void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
||||
sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
||||
|
||||
public:
|
||||
// Public so the COM thunks can access it.
|
||||
@ -579,4 +509,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "KeyWords.h"
|
||||
#include "ExternalLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
LexerManager *LexerManager::theInstance = NULL;
|
||||
|
||||
//------------------------------------------
|
||||
|
@ -11,7 +11,11 @@
|
||||
#if PLAT_WIN
|
||||
#define EXT_LEXER_DECL __stdcall
|
||||
#else
|
||||
#define EXT_LEXER_DECL
|
||||
#define EXT_LEXER_DECL
|
||||
#endif
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
// External Lexer function definitions...
|
||||
@ -37,7 +41,7 @@ public:
|
||||
const char *languageName_=0, LexerFunction fnFolder_=0) : LexerModule(language_, fnLexer_, 0, fnFolder_){
|
||||
strncpy(name, languageName_, sizeof(name));
|
||||
languageName = name;
|
||||
}
|
||||
};
|
||||
virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle,
|
||||
WordList *keywordlists[], Accessor &styler) const;
|
||||
virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle,
|
||||
@ -92,4 +96,8 @@ public:
|
||||
~LMMinder();
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -10,6 +10,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "Indicator.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) {
|
||||
surface->PenColour(fore.allocated);
|
||||
int ymid = (rc.bottom + rc.top) / 2;
|
||||
|
@ -8,15 +8,24 @@
|
||||
#ifndef INDICATOR_H
|
||||
#define INDICATOR_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*/
|
||||
class Indicator {
|
||||
public:
|
||||
int style;
|
||||
bool under;
|
||||
ColourPair fore;
|
||||
Indicator() : style(INDIC_PLAIN), fore(ColourDesired(0,0,0)) {
|
||||
Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)) {
|
||||
}
|
||||
void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -11,6 +11,10 @@
|
||||
|
||||
#include "KeyMap.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
KeyMap::KeyMap() : kmap(0), len(0), alloc(0) {
|
||||
for (int i = 0; MapDefault[i].key; i++) {
|
||||
AssignCmdKey(MapDefault[i].key,
|
||||
|
@ -8,6 +8,10 @@
|
||||
#ifndef KEYTOCOMMAND_H
|
||||
#define KEYTOCOMMAND_H
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
#define SCI_NORM 0
|
||||
#define SCI_SHIFT SCMOD_SHIFT
|
||||
#define SCI_CTRL SCMOD_CTRL
|
||||
@ -40,4 +44,8 @@ public:
|
||||
unsigned int Find(int key, int modifiers); // 0 returned on failure
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -19,6 +19,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
const LexerModule *LexerModule::base = 0;
|
||||
int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1;
|
||||
|
||||
@ -137,11 +141,13 @@ int Scintilla_LinkLexers() {
|
||||
|
||||
//++Autogenerated -- run src/LexGen.py to regenerate
|
||||
//**\(\tLINK_LEXER(\*);\n\)
|
||||
LINK_LEXER(lmAbaqus);
|
||||
LINK_LEXER(lmAda);
|
||||
LINK_LEXER(lmAns1);
|
||||
LINK_LEXER(lmAPDL);
|
||||
LINK_LEXER(lmAsm);
|
||||
LINK_LEXER(lmASP);
|
||||
LINK_LEXER(lmASY);
|
||||
LINK_LEXER(lmAU3);
|
||||
LINK_LEXER(lmAVE);
|
||||
LINK_LEXER(lmBaan);
|
||||
@ -152,11 +158,13 @@ int Scintilla_LinkLexers() {
|
||||
LINK_LEXER(lmCaml);
|
||||
LINK_LEXER(lmClw);
|
||||
LINK_LEXER(lmClwNoCase);
|
||||
LINK_LEXER(lmCmake);
|
||||
LINK_LEXER(lmConf);
|
||||
LINK_LEXER(lmCPP);
|
||||
LINK_LEXER(lmCPPNoCase);
|
||||
LINK_LEXER(lmCsound);
|
||||
LINK_LEXER(lmCss);
|
||||
LINK_LEXER(lmD);
|
||||
LINK_LEXER(lmDiff);
|
||||
LINK_LEXER(lmEiffel);
|
||||
LINK_LEXER(lmEiffelkw);
|
||||
@ -168,6 +176,7 @@ int Scintilla_LinkLexers() {
|
||||
LINK_LEXER(lmForth);
|
||||
LINK_LEXER(lmFortran);
|
||||
LINK_LEXER(lmFreeBasic);
|
||||
LINK_LEXER(lmGAP);
|
||||
LINK_LEXER(lmGui4Cli);
|
||||
LINK_LEXER(lmHaskell);
|
||||
LINK_LEXER(lmHTML);
|
||||
@ -193,11 +202,14 @@ int Scintilla_LinkLexers() {
|
||||
LINK_LEXER(lmPerl);
|
||||
LINK_LEXER(lmPHP);
|
||||
LINK_LEXER(lmPHPSCRIPT);
|
||||
LINK_LEXER(lmPLM);
|
||||
LINK_LEXER(lmPOV);
|
||||
LINK_LEXER(lmProgress);
|
||||
LINK_LEXER(lmProps);
|
||||
LINK_LEXER(lmPS);
|
||||
LINK_LEXER(lmPureBasic);
|
||||
LINK_LEXER(lmPython);
|
||||
LINK_LEXER(lmR);
|
||||
LINK_LEXER(lmREBOL);
|
||||
LINK_LEXER(lmRuby);
|
||||
LINK_LEXER(lmScriptol);
|
||||
|
@ -21,6 +21,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80 && (isalnum(ch) || ch == '_'));
|
||||
@ -123,6 +126,123 @@ static void ColouriseAPDLDoc(unsigned int startPos, int length, int initStyle, W
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 06-27-07 Sergio Lucato
|
||||
// - Included code folding for Ansys APDL lexer
|
||||
// - Copyied from LexBasic.cxx and modified for APDL
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/* Bits:
|
||||
* 1 - whitespace
|
||||
* 2 - operator
|
||||
* 4 - identifier
|
||||
* 8 - decimal digit
|
||||
* 16 - hex digit
|
||||
* 32 - bin digit
|
||||
*/
|
||||
static int character_classification[128] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
|
||||
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, 6, 2, 2, 2, 10, 6,
|
||||
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
|
||||
};
|
||||
|
||||
static bool IsSpace(int c) {
|
||||
return c < 128 && (character_classification[c] & 1);
|
||||
}
|
||||
|
||||
static bool IsIdentifier(int c) {
|
||||
return c < 128 && (character_classification[c] & 4);
|
||||
}
|
||||
|
||||
static int LowerCase(int c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return 'a' + c - 'A';
|
||||
return c;
|
||||
}
|
||||
|
||||
static int CheckAPDLFoldPoint(char const *token, int &level) {
|
||||
if (!strcmp(token, "*if") ||
|
||||
!strcmp(token, "*do") ||
|
||||
!strcmp(token, "*dowhile") ) {
|
||||
level |= SC_FOLDLEVELHEADERFLAG;
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp(token, "*endif") ||
|
||||
!strcmp(token, "*enddo") ) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void FoldAPDLDoc(unsigned int startPos, int length, int,
|
||||
WordList *[], Accessor &styler) {
|
||||
|
||||
int line = styler.GetLine(startPos);
|
||||
int level = styler.LevelAt(line);
|
||||
int go = 0, done = 0;
|
||||
int endPos = startPos + length;
|
||||
char word[256];
|
||||
int wordlen = 0;
|
||||
int i;
|
||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
// Scan for tokens at the start of the line (they may include
|
||||
// whitespace, for tokens like "End Function"
|
||||
for (i = startPos; i < endPos; i++) {
|
||||
int c = styler.SafeGetCharAt(i);
|
||||
if (!done && !go) {
|
||||
if (wordlen) { // are we scanning a token already?
|
||||
word[wordlen] = static_cast<char>(LowerCase(c));
|
||||
if (!IsIdentifier(c)) { // done with token
|
||||
word[wordlen] = '\0';
|
||||
go = CheckAPDLFoldPoint(word, level);
|
||||
if (!go) {
|
||||
// Treat any whitespace as single blank, for
|
||||
// things like "End Function".
|
||||
if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) {
|
||||
word[wordlen] = ' ';
|
||||
if (wordlen < 255)
|
||||
wordlen++;
|
||||
}
|
||||
else // done with this line
|
||||
done = 1;
|
||||
}
|
||||
} else if (wordlen < 255) {
|
||||
wordlen++;
|
||||
}
|
||||
} else { // start scanning at first non-whitespace character
|
||||
if (!IsSpace(c)) {
|
||||
if (IsIdentifier(c)) {
|
||||
word[0] = static_cast<char>(LowerCase(c));
|
||||
wordlen = 1;
|
||||
} else // done with this line
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c == '\n') { // line end
|
||||
if (!done && wordlen == 0 && foldCompact) // line was only space
|
||||
level |= SC_FOLDLEVELWHITEFLAG;
|
||||
if (level != styler.LevelAt(line))
|
||||
styler.SetLevel(line, level);
|
||||
level += go;
|
||||
line++;
|
||||
// reset state
|
||||
wordlen = 0;
|
||||
level &= ~SC_FOLDLEVELHEADERFLAG;
|
||||
level &= ~SC_FOLDLEVELWHITEFLAG;
|
||||
go = 0;
|
||||
done = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const char * const apdlWordListDesc[] = {
|
||||
"processors",
|
||||
"commands",
|
||||
@ -133,4 +253,4 @@ static const char * const apdlWordListDesc[] = {
|
||||
0
|
||||
};
|
||||
|
||||
LexerModule lmAPDL(SCLEX_APDL, ColouriseAPDLDoc, "apdl", 0, apdlWordListDesc);
|
||||
LexerModule lmAPDL(SCLEX_APDL, ColouriseAPDLDoc, "apdl", FoldAPDLDoc, apdlWordListDesc);
|
||||
|
270
src/stc/scintilla/src/LexASY.cxx
Normal file
270
src/stc/scintilla/src/LexASY.cxx
Normal file
@ -0,0 +1,270 @@
|
||||
// Scintilla source code edit control
|
||||
//Author: instanton (email: soft_share<at>126<dot>com)
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "StyleContext.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
#include "CharacterSet.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static void ColouriseAsyDoc(unsigned int startPos, int length, int initStyle,
|
||||
WordList *keywordlists[], Accessor &styler) {
|
||||
|
||||
WordList &keywords = *keywordlists[0];
|
||||
WordList &keywords2 = *keywordlists[1];
|
||||
|
||||
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
|
||||
CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
|
||||
|
||||
int visibleChars = 0;
|
||||
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
if (sc.atLineStart) {
|
||||
if (sc.state == SCE_ASY_STRING) {
|
||||
sc.SetState(SCE_ASY_STRING);
|
||||
}
|
||||
visibleChars = 0;
|
||||
}
|
||||
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\n' || sc.chNext == '\r') {
|
||||
sc.Forward();
|
||||
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||
sc.Forward();
|
||||
}
|
||||
// continuationLine = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if the current state should terminate.
|
||||
switch (sc.state) {
|
||||
case SCE_ASY_OPERATOR:
|
||||
sc.SetState(SCE_ASY_DEFAULT);
|
||||
break;
|
||||
case SCE_ASY_NUMBER:
|
||||
if (!setWord.Contains(sc.ch)) {
|
||||
sc.SetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_ASY_IDENTIFIER:
|
||||
if (!setWord.Contains(sc.ch) || (sc.ch == '.')) {
|
||||
char s[1000];
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
if (keywords.InList(s)) {
|
||||
sc.ChangeState(SCE_ASY_WORD);
|
||||
} else if (keywords2.InList(s)) {
|
||||
sc.ChangeState(SCE_ASY_WORD2);
|
||||
}
|
||||
sc.SetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_ASY_COMMENT:
|
||||
if (sc.Match('*', '/')) {
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_ASY_COMMENTLINE:
|
||||
if (sc.atLineStart) {
|
||||
sc.SetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_ASY_STRING:
|
||||
if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_ASY_STRINGEOL);
|
||||
} else if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_ASY_CHARACTER:
|
||||
if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_ASY_STRINGEOL);
|
||||
} else if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
if (sc.state == SCE_ASY_DEFAULT) {
|
||||
if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) {
|
||||
sc.SetState(SCE_ASY_IDENTIFIER);
|
||||
} else if (sc.Match('/', '*')) {
|
||||
sc.SetState(SCE_ASY_COMMENT);
|
||||
sc.Forward(); //
|
||||
} else if (sc.Match('/', '/')) {
|
||||
sc.SetState(SCE_ASY_COMMENTLINE);
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_ASY_STRING);
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.SetState(SCE_ASY_CHARACTER);
|
||||
} else if (sc.ch == '#' && visibleChars == 0) {
|
||||
do {
|
||||
sc.Forward();
|
||||
} while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
|
||||
if (sc.atLineEnd) {
|
||||
sc.SetState(SCE_ASY_DEFAULT);
|
||||
}
|
||||
} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||
sc.SetState(SCE_ASY_OPERATOR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
static bool IsAsyCommentStyle(int style) {
|
||||
return style == SCE_ASY_COMMENT;
|
||||
}
|
||||
|
||||
|
||||
static inline bool isASYidentifier(int ch) {
|
||||
return
|
||||
((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ;
|
||||
}
|
||||
|
||||
static int ParseASYWord(unsigned int pos, Accessor &styler, char *word)
|
||||
{
|
||||
int length=0;
|
||||
char ch=styler.SafeGetCharAt(pos);
|
||||
*word=0;
|
||||
|
||||
while(isASYidentifier(ch) && length<100){
|
||||
word[length]=ch;
|
||||
length++;
|
||||
ch=styler.SafeGetCharAt(pos+length);
|
||||
}
|
||||
word[length]=0;
|
||||
return length;
|
||||
}
|
||||
|
||||
static bool IsASYDrawingLine(int line, Accessor &styler) {
|
||||
int pos = styler.LineStart(line);
|
||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
||||
|
||||
int startpos = pos;
|
||||
char buffer[100]="";
|
||||
|
||||
while (startpos<eol_pos){
|
||||
char ch = styler[startpos];
|
||||
ParseASYWord(startpos,styler,buffer);
|
||||
bool drawcommands = strncmp(buffer,"draw",4)==0||
|
||||
strncmp(buffer,"pair",4)==0||strncmp(buffer,"label",5)==0;
|
||||
if (!drawcommands && ch!=' ') return false;
|
||||
else if (drawcommands) return true;
|
||||
startpos++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void FoldAsyDoc(unsigned int startPos, int length, int initStyle,
|
||||
WordList *[], Accessor &styler) {
|
||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
|
||||
unsigned int endPos = startPos + length;
|
||||
int visibleChars = 0;
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
int levelCurrent = SC_FOLDLEVELBASE;
|
||||
if (lineCurrent > 0)
|
||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||
int levelMinCurrent = levelCurrent;
|
||||
int levelNext = levelCurrent;
|
||||
char chNext = styler[startPos];
|
||||
int styleNext = styler.StyleAt(startPos);
|
||||
int style = initStyle;
|
||||
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 && IsAsyCommentStyle(style)) {
|
||||
if (!IsAsyCommentStyle(stylePrev) && (stylePrev != SCE_ASY_COMMENTLINEDOC)) {
|
||||
levelNext++;
|
||||
} else if (!IsAsyCommentStyle(styleNext) && (styleNext != SCE_ASY_COMMENTLINEDOC) && !atEOL) {
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
if (style == SCE_ASY_OPERATOR) {
|
||||
if (ch == '{') {
|
||||
if (levelMinCurrent > levelNext) {
|
||||
levelMinCurrent = levelNext;
|
||||
}
|
||||
levelNext++;
|
||||
} else if (ch == '}') {
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
|
||||
if (atEOL && IsASYDrawingLine(lineCurrent, styler)){
|
||||
if (lineCurrent==0 && IsASYDrawingLine(lineCurrent + 1, styler))
|
||||
levelNext++;
|
||||
else if (lineCurrent!=0 && !IsASYDrawingLine(lineCurrent - 1, styler)
|
||||
&& IsASYDrawingLine(lineCurrent + 1, styler)
|
||||
)
|
||||
levelNext++;
|
||||
else if (lineCurrent!=0 && IsASYDrawingLine(lineCurrent - 1, styler) &&
|
||||
!IsASYDrawingLine(lineCurrent+1, styler))
|
||||
levelNext--;
|
||||
}
|
||||
|
||||
if (atEOL) {
|
||||
int levelUse = levelCurrent;
|
||||
if (foldAtElse) {
|
||||
levelUse = levelMinCurrent;
|
||||
}
|
||||
int lev = levelUse | levelNext << 16;
|
||||
if (visibleChars == 0 && foldCompact)
|
||||
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||
if (levelUse < levelNext)
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent)) {
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
}
|
||||
lineCurrent++;
|
||||
levelCurrent = levelNext;
|
||||
levelMinCurrent = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
if (!IsASpace(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
|
||||
static const char * const asyWordLists[] = {
|
||||
"Primary keywords and identifiers",
|
||||
"Secondary keywords and identifiers",
|
||||
0,
|
||||
};
|
||||
|
||||
LexerModule lmASY(SCLEX_ASYMPTOTE, ColouriseAsyDoc, "asy", FoldAsyDoc, asyWordLists);
|
@ -42,6 +42,9 @@
|
||||
// Sep 27, 2005 - Fixed the SentKey lexing logic in case of multiple sentkeys.
|
||||
// Mar 12, 2006 - Fixed issue with <> coloring as String in stead of Operator in rare occasions.
|
||||
// Apr 8, 2006 - Added support for AutoIt3 Standard UDF library (SCE_AU3_UDF)
|
||||
// Mar 9, 2007 - Fixed bug with + following a String getting the wrong Color.
|
||||
// Jun 20, 2007 - Fixed Commentblock issue when LF's are used as EOL.
|
||||
// Jul 26, 2007 - Fixed #endregion undetected bug.
|
||||
//
|
||||
// Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
@ -62,6 +65,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsTypeCharacter(const int ch)
|
||||
{
|
||||
return ch == '$';
|
||||
@ -246,7 +253,12 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
||||
//Reset at line end
|
||||
if (sc.atLineEnd) {
|
||||
ci=0;
|
||||
sc.SetState(SCE_AU3_COMMENTBLOCK);
|
||||
if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0))
|
||||
if (sc.atLineEnd)
|
||||
sc.SetState(SCE_AU3_DEFAULT);
|
||||
else
|
||||
sc.SetState(SCE_AU3_COMMENTBLOCK);
|
||||
break;
|
||||
}
|
||||
//skip rest of line when a ; is encountered
|
||||
if (sc.chPrev == ';') {
|
||||
@ -265,12 +277,12 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
||||
break;
|
||||
}
|
||||
if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) {
|
||||
if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0))
|
||||
sc.SetState(SCE_AU3_COMMENT); // set to comment line for the rest of the line
|
||||
if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0))
|
||||
sc.SetState(SCE_AU3_COMMENT); // set to comment line for the rest of the line
|
||||
else
|
||||
ci=2; // line doesn't begin with #CE so skip the rest of the line
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case SCE_AU3_COMMENT:
|
||||
{
|
||||
@ -304,6 +316,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
||||
{
|
||||
sc.ChangeState(SCE_AU3_COMMENTBLOCK);
|
||||
sc.SetState(SCE_AU3_COMMENTBLOCK);
|
||||
break;
|
||||
}
|
||||
else if (keywords.InList(s)) {
|
||||
sc.ChangeState(SCE_AU3_KEYWORD);
|
||||
@ -424,6 +437,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
||||
{
|
||||
sc.ForwardSetState(SCE_AU3_DEFAULT);
|
||||
si=0;
|
||||
break;
|
||||
}
|
||||
if (sc.atLineEnd)
|
||||
{
|
||||
@ -433,6 +447,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
||||
if (!IsContinuationLine(lineCurrent,styler))
|
||||
{
|
||||
sc.SetState(SCE_AU3_DEFAULT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// find Sendkeys in a STRING
|
||||
@ -686,7 +701,7 @@ static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Acc
|
||||
// vars for getting first word to check for keywords
|
||||
bool FirstWordStart = false;
|
||||
bool FirstWordEnd = false;
|
||||
char szKeyword[10]="";
|
||||
char szKeyword[11]="";
|
||||
int szKeywordlen = 0;
|
||||
char szThen[5]="";
|
||||
int szThenlen = 0;
|
||||
|
@ -22,6 +22,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
|
260
src/stc/scintilla/src/LexAbaqus.cxx
Normal file
260
src/stc/scintilla/src/LexAbaqus.cxx
Normal file
@ -0,0 +1,260 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file LexABAQUS.cxx
|
||||
** Lexer for ABAQUS. Based on the lexer for APDL by Hadar Raz.
|
||||
** By Sergio Lucato.
|
||||
**/
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
// Code folding copyied and modified from LexBasic.cxx
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "StyleContext.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80 && (isalnum(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) {
|
||||
|
||||
int stringStart = ' ';
|
||||
|
||||
WordList &processors = *keywordlists[0];
|
||||
WordList &commands = *keywordlists[1];
|
||||
WordList &slashcommands = *keywordlists[2];
|
||||
WordList &starcommands = *keywordlists[3];
|
||||
WordList &arguments = *keywordlists[4];
|
||||
WordList &functions = *keywordlists[5];
|
||||
|
||||
// Do not leak onto next line
|
||||
initStyle = SCE_ABAQUS_DEFAULT;
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
// Determine if the current state should terminate.
|
||||
if (sc.state == SCE_ABAQUS_NUMBER) {
|
||||
if (!(IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') ||
|
||||
((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) {
|
||||
sc.SetState(SCE_ABAQUS_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_ABAQUS_COMMENT) {
|
||||
if (sc.atLineEnd) {
|
||||
sc.SetState(SCE_ABAQUS_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_ABAQUS_COMMENTBLOCK) {
|
||||
if (sc.atLineEnd) {
|
||||
if (sc.ch == '\r') {
|
||||
sc.Forward();
|
||||
}
|
||||
sc.ForwardSetState(SCE_ABAQUS_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_ABAQUS_STRING) {
|
||||
if (sc.atLineEnd) {
|
||||
sc.SetState(SCE_ABAQUS_DEFAULT);
|
||||
} else if ((sc.ch == '\'' && stringStart == '\'') || (sc.ch == '\"' && stringStart == '\"')) {
|
||||
sc.ForwardSetState(SCE_ABAQUS_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_ABAQUS_WORD) {
|
||||
if (!IsAWordChar(sc.ch)) {
|
||||
char s[100];
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
if (processors.InList(s)) {
|
||||
sc.ChangeState(SCE_ABAQUS_PROCESSOR);
|
||||
} else if (slashcommands.InList(s)) {
|
||||
sc.ChangeState(SCE_ABAQUS_SLASHCOMMAND);
|
||||
} else if (starcommands.InList(s)) {
|
||||
sc.ChangeState(SCE_ABAQUS_STARCOMMAND);
|
||||
} else if (commands.InList(s)) {
|
||||
sc.ChangeState(SCE_ABAQUS_COMMAND);
|
||||
} else if (arguments.InList(s)) {
|
||||
sc.ChangeState(SCE_ABAQUS_ARGUMENT);
|
||||
} else if (functions.InList(s)) {
|
||||
sc.ChangeState(SCE_ABAQUS_FUNCTION);
|
||||
}
|
||||
sc.SetState(SCE_ABAQUS_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_ABAQUS_OPERATOR) {
|
||||
if (!IsAnOperator(static_cast<char>(sc.ch))) {
|
||||
sc.SetState(SCE_ABAQUS_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
if (sc.state == SCE_ABAQUS_DEFAULT) {
|
||||
if (sc.ch == '*' && sc.chNext == '*') {
|
||||
sc.SetState(SCE_ABAQUS_COMMENTBLOCK);
|
||||
} else if (sc.ch == '!') {
|
||||
sc.SetState(SCE_ABAQUS_COMMENT);
|
||||
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_ABAQUS_NUMBER);
|
||||
} else if (sc.ch == '\'' || sc.ch == '\"') {
|
||||
sc.SetState(SCE_ABAQUS_STRING);
|
||||
stringStart = sc.ch;
|
||||
} else if (IsAWordChar(sc.ch) || ((sc.ch == '*' || sc.ch == '/') && !isgraph(sc.chPrev))) {
|
||||
sc.SetState(SCE_ABAQUS_WORD);
|
||||
} else if (IsAnOperator(static_cast<char>(sc.ch))) {
|
||||
sc.SetState(SCE_ABAQUS_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// This copyied and modified from LexBasic.cxx
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/* Bits:
|
||||
* 1 - whitespace
|
||||
* 2 - operator
|
||||
* 4 - identifier
|
||||
* 8 - decimal digit
|
||||
* 16 - hex digit
|
||||
* 32 - bin digit
|
||||
*/
|
||||
static int character_classification[128] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
|
||||
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, 6, 2, 2, 2, 10, 6,
|
||||
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
|
||||
};
|
||||
|
||||
static bool IsSpace(int c) {
|
||||
return c < 128 && (character_classification[c] & 1);
|
||||
}
|
||||
|
||||
static bool IsIdentifier(int c) {
|
||||
return c < 128 && (character_classification[c] & 4);
|
||||
}
|
||||
|
||||
static int LowerCase(int c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return 'a' + c - 'A';
|
||||
return c;
|
||||
}
|
||||
|
||||
static int CheckABAQUSFoldPoint(char const *token, int &level) {
|
||||
if (!strcmp(token, "*step") ||
|
||||
!strcmp(token, "*part") ||
|
||||
!strcmp(token, "*instance") ||
|
||||
!strcmp(token, "*assembly") ||
|
||||
!strcmp(token, "***region") ) {
|
||||
level |= SC_FOLDLEVELHEADERFLAG;
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp(token, "*end step") ||
|
||||
!strcmp(token, "*end part") ||
|
||||
!strcmp(token, "*end instance") ||
|
||||
!strcmp(token, "*end assembly") ||
|
||||
!strcmp(token, "***end region") ) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void FoldABAQUSDoc(unsigned int startPos, int length, int,
|
||||
WordList *[], Accessor &styler) {
|
||||
|
||||
int line = styler.GetLine(startPos);
|
||||
int level = styler.LevelAt(line);
|
||||
int go = 0, done = 0;
|
||||
int endPos = startPos + length;
|
||||
char word[256];
|
||||
int wordlen = 0;
|
||||
int i;
|
||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
// Scan for tokens at the start of the line (they may include
|
||||
// whitespace, for tokens like "End Function"
|
||||
for (i = startPos; i < endPos; i++) {
|
||||
int c = styler.SafeGetCharAt(i);
|
||||
if (!done && !go) {
|
||||
if (wordlen) { // are we scanning a token already?
|
||||
word[wordlen] = static_cast<char>(LowerCase(c));
|
||||
if (!IsIdentifier(c)) { // done with token
|
||||
word[wordlen] = '\0';
|
||||
go = CheckABAQUSFoldPoint(word, level);
|
||||
if (!go) {
|
||||
// Treat any whitespace as single blank, for
|
||||
// things like "End Function".
|
||||
if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) {
|
||||
word[wordlen] = ' ';
|
||||
if (wordlen < 255)
|
||||
wordlen++;
|
||||
}
|
||||
else // done with this line
|
||||
done = 1;
|
||||
}
|
||||
} else if (wordlen < 255) {
|
||||
wordlen++;
|
||||
}
|
||||
} else { // start scanning at first non-whitespace character
|
||||
if (!IsSpace(c)) {
|
||||
if (IsIdentifier(c)) {
|
||||
word[0] = static_cast<char>(LowerCase(c));
|
||||
wordlen = 1;
|
||||
} else // done with this line
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c == '\n') { // line end
|
||||
if (!done && wordlen == 0 && foldCompact) // line was only space
|
||||
level |= SC_FOLDLEVELWHITEFLAG;
|
||||
if (level != styler.LevelAt(line))
|
||||
styler.SetLevel(line, level);
|
||||
level += go;
|
||||
line++;
|
||||
// reset state
|
||||
wordlen = 0;
|
||||
level &= ~SC_FOLDLEVELHEADERFLAG;
|
||||
level &= ~SC_FOLDLEVELWHITEFLAG;
|
||||
go = 0;
|
||||
done = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const char * const abaqusWordListDesc[] = {
|
||||
"processors",
|
||||
"commands",
|
||||
"slashommands",
|
||||
"starcommands",
|
||||
"arguments",
|
||||
"functions",
|
||||
0
|
||||
};
|
||||
|
||||
LexerModule lmAbaqus(SCLEX_ABAQUS, ColouriseABAQUSDoc, "abaqus", FoldABAQUSDoc, abaqusWordListDesc);
|
@ -19,6 +19,10 @@
|
||||
#include "SciLexer.h"
|
||||
#include "SString.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interface
|
||||
*/
|
||||
|
@ -23,6 +23,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
// Some char test functions
|
||||
static bool isAsn1Number(int ch)
|
||||
{
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '$' || ch == ':');
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/** @file LexBash.cxx
|
||||
** Lexer for Bash.
|
||||
**/
|
||||
// Copyright 2004-2005 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Copyright 2004-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Adapted from LexPerl by Kein-Hong Man <mkh@pl.jaring.my> 2004
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
@ -20,14 +20,24 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
// define this if you want 'invalid octals' to be marked as errors
|
||||
// usually, this is not a good idea, permissive lexing is better
|
||||
#undef PEDANTIC_OCTAL
|
||||
|
||||
#define BASH_BASE_ERROR 65
|
||||
#define BASH_BASE_DECIMAL 66
|
||||
#define BASH_BASE_HEX 67
|
||||
#ifdef PEDANTIC_OCTAL
|
||||
#define BASH_BASE_OCTAL 68
|
||||
#define BASH_BASE_OCTAL_ERROR 69
|
||||
#endif
|
||||
|
||||
#define HERE_DELIM_MAX 256
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline int translateBashDigit(char ch) {
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
return ch - '0';
|
||||
@ -273,7 +283,11 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
} else if (isdigit(chNext)) {
|
||||
#ifdef PEDANTIC_OCTAL
|
||||
numBase = BASH_BASE_OCTAL;
|
||||
#else
|
||||
numBase = BASH_BASE_HEX;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else if (iswordstart(ch)) {
|
||||
@ -338,7 +352,8 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
HereDoc.Indent = false;
|
||||
} else if (ch == '-' // file test operators
|
||||
&& isSingleCharOp(chNext)
|
||||
&& !isalnum((chNext2 = styler.SafeGetCharAt(i+2)))) {
|
||||
&& !isalnum((chNext2 = styler.SafeGetCharAt(i+2)))
|
||||
&& isspace(chPrev)) {
|
||||
styler.ColourTo(i + 1, SCE_SH_WORD);
|
||||
state = SCE_SH_DEFAULT;
|
||||
i++;
|
||||
@ -364,14 +379,16 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
// hex digit 0-9a-fA-F
|
||||
} else
|
||||
goto numAtEnd;
|
||||
#ifdef PEDANTIC_OCTAL
|
||||
} else if (numBase == BASH_BASE_OCTAL ||
|
||||
numBase == BASH_BASE_OCTAL_ERROR) {
|
||||
if (digit > 7) {
|
||||
if (digit <= 9) {
|
||||
numBase = BASH_BASE_OCTAL_ERROR;
|
||||
numBase = BASH_BASE_OCTAL_ERROR;
|
||||
} else
|
||||
goto numAtEnd;
|
||||
}
|
||||
#endif
|
||||
} else if (numBase == BASH_BASE_ERROR) {
|
||||
if (digit > 9)
|
||||
goto numAtEnd;
|
||||
@ -389,8 +406,11 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
} else {
|
||||
numAtEnd:
|
||||
if (numBase == BASH_BASE_ERROR ||
|
||||
numBase == BASH_BASE_OCTAL_ERROR)
|
||||
if (numBase == BASH_BASE_ERROR
|
||||
#ifdef PEDANTIC_OCTAL
|
||||
|| numBase == BASH_BASE_OCTAL_ERROR
|
||||
#endif
|
||||
)
|
||||
state = SCE_SH_ERROR;
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_SH_DEFAULT;
|
||||
|
@ -31,6 +31,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
/* Bits:
|
||||
* 1 - whitespace
|
||||
* 2 - operator
|
||||
|
@ -15,6 +15,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static int classifyWordBullant(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
|
||||
char s[100];
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
// Is an end of line character
|
||||
inline bool IsEOL(const int ch) {
|
||||
|
||||
|
@ -19,28 +19,11 @@
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
#include "CharacterSet.h"
|
||||
|
||||
#define KEYWORD_BOXHEADER 1
|
||||
#define KEYWORD_FOLDCONTRACTED 2
|
||||
|
||||
static bool IsOKBeforeRE(int ch) {
|
||||
return (ch == '(') || (ch == '=') || (ch == ',');
|
||||
}
|
||||
|
||||
static inline bool IsAWordChar(int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
|
||||
}
|
||||
|
||||
static inline bool IsAWordStart(int ch) {
|
||||
return (ch < 0x80) && (isalpha(ch) || ch == '_');
|
||||
}
|
||||
|
||||
static inline bool IsADoxygenChar(int ch) {
|
||||
return (ch < 0x80 && islower(ch)) || ch == '$' || ch == '@' ||
|
||||
ch == '\\' || ch == '&' || ch == '<' ||
|
||||
ch == '>' || ch == '#' || ch == '{' ||
|
||||
ch == '}' || ch == '[' || ch == ']';
|
||||
}
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static bool IsSpaceEquiv(int state) {
|
||||
return (state <= SCE_C_COMMENTDOC) ||
|
||||
@ -49,6 +32,24 @@ static bool IsSpaceEquiv(int state) {
|
||||
(state == SCE_C_COMMENTDOCKEYWORDERROR);
|
||||
}
|
||||
|
||||
// Preconditions: sc.currentPos points to a character after '+' or '-'.
|
||||
// The test for pos reaching 0 should be redundant,
|
||||
// and is in only for safety measures.
|
||||
// Limitation: this code will give the incorrect answer for code like
|
||||
// a = b+++/ptn/...
|
||||
// Putting a space between the '++' post-inc operator and the '+' binary op
|
||||
// fixes this, and is highly recommended for readability anyway.
|
||||
static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) {
|
||||
int pos = (int) sc.currentPos;
|
||||
while (--pos > 0) {
|
||||
char ch = styler[pos];
|
||||
if (ch == '+' || ch == '-') {
|
||||
return styler[pos - 1] == ch;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler, bool caseSensitive) {
|
||||
|
||||
@ -59,6 +60,18 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
|
||||
bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
|
||||
|
||||
CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-");
|
||||
CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-");
|
||||
|
||||
CharacterSet setDoxygen(CharacterSet::setLower, "$@\\&<>#{}[]");
|
||||
|
||||
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
|
||||
CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
|
||||
if (styler.GetPropertyInt("lexer.cpp.allow.dollars", 1) != 0) {
|
||||
setWordStart.Add('$');
|
||||
setWord.Add('$');
|
||||
}
|
||||
|
||||
int chPrevNonWhite = ' ';
|
||||
int visibleChars = 0;
|
||||
bool lastWordWasUUID = false;
|
||||
@ -97,7 +110,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
|
||||
if (sc.atLineStart) {
|
||||
if (sc.state == SCE_C_STRING) {
|
||||
// Prevent SCE_C_STRINGEOL from leaking back to previous line which
|
||||
// Prevent SCE_C_STRINGEOL from leaking back to previous line which
|
||||
// ends with a line continuation by locking in the state upto this position.
|
||||
sc.SetState(SCE_C_STRING);
|
||||
}
|
||||
@ -126,12 +139,12 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
break;
|
||||
case SCE_C_NUMBER:
|
||||
// We accept almost anything because of hex. and number suffixes
|
||||
if (!IsAWordChar(sc.ch)) {
|
||||
if (!setWord.Contains(sc.ch)) {
|
||||
sc.SetState(SCE_C_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_C_IDENTIFIER:
|
||||
if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
|
||||
if (!setWord.Contains(sc.ch) || (sc.ch == '.')) {
|
||||
char s[1000];
|
||||
if (caseSensitive) {
|
||||
sc.GetCurrent(s, sizeof(s));
|
||||
@ -201,14 +214,14 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR);
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_C_DEFAULT);
|
||||
} else if (!IsADoxygenChar(sc.ch)) {
|
||||
} else if (!setDoxygen.Contains(sc.ch)) {
|
||||
char s[100];
|
||||
if (caseSensitive) {
|
||||
sc.GetCurrent(s, sizeof(s));
|
||||
} else {
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
}
|
||||
if (!isspace(sc.ch) || !keywords3.InList(s + 1)) {
|
||||
if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) {
|
||||
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR);
|
||||
}
|
||||
sc.SetState(styleBeforeDCKeyword);
|
||||
@ -283,7 +296,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
} else {
|
||||
sc.SetState(SCE_C_NUMBER);
|
||||
}
|
||||
} else if (IsAWordStart(sc.ch) || (sc.ch == '@')) {
|
||||
} else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) {
|
||||
if (lastWordWasUUID) {
|
||||
sc.SetState(SCE_C_UUID);
|
||||
lastWordWasUUID = false;
|
||||
@ -303,7 +316,8 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
sc.SetState(SCE_C_COMMENTLINEDOC);
|
||||
else
|
||||
sc.SetState(SCE_C_COMMENTLINE);
|
||||
} else if (sc.ch == '/' && IsOKBeforeRE(chPrevNonWhite)) {
|
||||
} else if (sc.ch == '/' && setOKBeforeRE.Contains(chPrevNonWhite) &&
|
||||
(!setCouldBePostOp.Contains(chPrevNonWhite) || !FollowsPostfixOperator(sc, styler))) {
|
||||
sc.SetState(SCE_C_REGEX); // JavaScript's RegEx
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_C_STRING);
|
||||
@ -343,8 +357,8 @@ static bool IsStreamCommentStyle(int style) {
|
||||
// Store both the current line's fold level and the next lines in the
|
||||
// level store to make it easy to pick up with each increment
|
||||
// and to make it possible to fiddle the current level for "} else {".
|
||||
static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
|
||||
Accessor &styler) {
|
||||
static void FoldCppDoc(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;
|
||||
@ -368,9 +382,9 @@ static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
|
||||
styleNext = styler.StyleAt(i + 1);
|
||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||
if (foldComment && IsStreamCommentStyle(style)) {
|
||||
if (!IsStreamCommentStyle(stylePrev)) {
|
||||
if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_C_COMMENTLINEDOC)) {
|
||||
levelNext++;
|
||||
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
|
||||
} else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_C_COMMENTLINEDOC) && !atEOL) {
|
||||
// Comments don't end at end of line and the next character may be unstyled.
|
||||
levelNext--;
|
||||
}
|
||||
@ -428,16 +442,11 @@ static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
|
||||
levelMinCurrent = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
if (!isspacechar(ch))
|
||||
if (!IsASpace(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
|
||||
static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[],
|
||||
Accessor &styler) {
|
||||
FoldNoBoxCppDoc(startPos, length, initStyle, styler);
|
||||
}
|
||||
|
||||
static const char * const cppWordLists[] = {
|
||||
"Primary keywords and identifiers",
|
||||
"Secondary keywords and identifiers",
|
||||
|
@ -22,6 +22,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
|
||||
static inline bool IsAWordChar(const unsigned int ch) {
|
||||
return (isalnum(ch) || ch == '-' || ch == '_' || ch >= 161); // _ is not in fact correct CSS word-character
|
||||
|
@ -42,6 +42,10 @@ static const int baseT[24] = {
|
||||
0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_AS_EXTERNAL_LEXER
|
||||
/*
|
||||
(actually seems to work!)
|
||||
|
456
src/stc/scintilla/src/LexCmake.cxx
Normal file
456
src/stc/scintilla/src/LexCmake.cxx
Normal file
@ -0,0 +1,456 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file LexCmake.cxx
|
||||
** Lexer for Cmake
|
||||
**/
|
||||
// Copyright 2007 by Cristian Adam <cristian [dot] adam [at] gmx [dot] net>
|
||||
// based on the NSIS lexer
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static bool isCmakeNumber(char ch)
|
||||
{
|
||||
return(ch >= '0' && ch <= '9');
|
||||
}
|
||||
|
||||
static bool isCmakeChar(char ch)
|
||||
{
|
||||
return(ch == '.' ) || (ch == '_' ) || isCmakeNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
||||
}
|
||||
|
||||
static bool isCmakeLetter(char ch)
|
||||
{
|
||||
return(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
||||
}
|
||||
|
||||
static bool CmakeNextLineHasElse(unsigned int start, unsigned int end, Accessor &styler)
|
||||
{
|
||||
int nNextLine = -1;
|
||||
for ( unsigned int i = start; i < end; i++ ) {
|
||||
char cNext = styler.SafeGetCharAt( i );
|
||||
if ( cNext == '\n' ) {
|
||||
nNextLine = i+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( nNextLine == -1 ) // We never foudn the next line...
|
||||
return false;
|
||||
|
||||
for ( unsigned int firstChar = nNextLine; firstChar < end; firstChar++ ) {
|
||||
char cNext = styler.SafeGetCharAt( firstChar );
|
||||
if ( cNext == ' ' )
|
||||
continue;
|
||||
if ( cNext == '\t' )
|
||||
continue;
|
||||
if ( styler.Match(firstChar, "ELSE") || styler.Match(firstChar, "else"))
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int calculateFoldCmake(unsigned int start, unsigned int end, int foldlevel, Accessor &styler, bool bElse)
|
||||
{
|
||||
// If the word is too long, it is not what we are looking for
|
||||
if ( end - start > 20 )
|
||||
return foldlevel;
|
||||
|
||||
int newFoldlevel = foldlevel;
|
||||
|
||||
char s[20]; // The key word we are looking for has atmost 13 characters
|
||||
for (unsigned int i = 0; i < end - start + 1 && i < 19; i++) {
|
||||
s[i] = static_cast<char>( styler[ start + i ] );
|
||||
s[i + 1] = '\0';
|
||||
}
|
||||
|
||||
if ( CompareCaseInsensitive(s, "IF") == 0 || CompareCaseInsensitive(s, "WHILE") == 0
|
||||
|| CompareCaseInsensitive(s, "MACRO") == 0 || CompareCaseInsensitive(s, "FOREACH") == 0
|
||||
|| CompareCaseInsensitive(s, "ELSEIF") == 0 )
|
||||
newFoldlevel++;
|
||||
else if ( CompareCaseInsensitive(s, "ENDIF") == 0 || CompareCaseInsensitive(s, "ENDWHILE") == 0
|
||||
|| CompareCaseInsensitive(s, "ENDMACRO") == 0 || CompareCaseInsensitive(s, "ENDFOREACH") == 0)
|
||||
newFoldlevel--;
|
||||
else if ( bElse && CompareCaseInsensitive(s, "ELSEIF") == 0 )
|
||||
newFoldlevel++;
|
||||
else if ( bElse && CompareCaseInsensitive(s, "ELSE") == 0 )
|
||||
newFoldlevel++;
|
||||
|
||||
return newFoldlevel;
|
||||
}
|
||||
|
||||
static int classifyWordCmake(unsigned int start, unsigned int end, WordList *keywordLists[], Accessor &styler )
|
||||
{
|
||||
char word[100] = {0};
|
||||
char lowercaseWord[100] = {0};
|
||||
|
||||
WordList &Commands = *keywordLists[0];
|
||||
WordList &Parameters = *keywordLists[1];
|
||||
WordList &UserDefined = *keywordLists[2];
|
||||
|
||||
for (unsigned int i = 0; i < end - start + 1 && i < 99; i++) {
|
||||
word[i] = static_cast<char>( styler[ start + i ] );
|
||||
lowercaseWord[i] = static_cast<char>(tolower(word[i]));
|
||||
}
|
||||
|
||||
// Check for special words...
|
||||
if ( CompareCaseInsensitive(word, "MACRO") == 0 || CompareCaseInsensitive(word, "ENDMACRO") == 0 )
|
||||
return SCE_CMAKE_MACRODEF;
|
||||
|
||||
if ( CompareCaseInsensitive(word, "IF") == 0 || CompareCaseInsensitive(word, "ENDIF") == 0 )
|
||||
return SCE_CMAKE_IFDEFINEDEF;
|
||||
|
||||
if ( CompareCaseInsensitive(word, "ELSEIF") == 0 || CompareCaseInsensitive(word, "ELSE") == 0 )
|
||||
return SCE_CMAKE_IFDEFINEDEF;
|
||||
|
||||
if ( CompareCaseInsensitive(word, "WHILE") == 0 || CompareCaseInsensitive(word, "ENDWHILE") == 0)
|
||||
return SCE_CMAKE_WHILEDEF;
|
||||
|
||||
if ( CompareCaseInsensitive(word, "FOREACH") == 0 || CompareCaseInsensitive(word, "ENDFOREACH") == 0)
|
||||
return SCE_CMAKE_FOREACHDEF;
|
||||
|
||||
if ( Commands.InList(lowercaseWord) )
|
||||
return SCE_CMAKE_COMMANDS;
|
||||
|
||||
if ( Parameters.InList(word) )
|
||||
return SCE_CMAKE_PARAMETERS;
|
||||
|
||||
|
||||
if ( UserDefined.InList(word) )
|
||||
return SCE_CMAKE_USERDEFINED;
|
||||
|
||||
if ( strlen(word) > 3 ) {
|
||||
if ( word[1] == '{' && word[strlen(word)-1] == '}' )
|
||||
return SCE_CMAKE_VARIABLE;
|
||||
}
|
||||
|
||||
// To check for numbers
|
||||
if ( isCmakeNumber( word[0] ) ) {
|
||||
bool bHasSimpleCmakeNumber = true;
|
||||
for (unsigned int j = 1; j < end - start + 1 && j < 99; j++) {
|
||||
if ( !isCmakeNumber( word[j] ) ) {
|
||||
bHasSimpleCmakeNumber = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bHasSimpleCmakeNumber )
|
||||
return SCE_CMAKE_NUMBER;
|
||||
}
|
||||
|
||||
return SCE_CMAKE_DEFAULT;
|
||||
}
|
||||
|
||||
static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
|
||||
{
|
||||
int state = SCE_CMAKE_DEFAULT;
|
||||
if ( startPos > 0 )
|
||||
state = styler.StyleAt(startPos-1); // Use the style from the previous line, usually default, but could be commentbox
|
||||
|
||||
styler.StartAt( startPos );
|
||||
styler.GetLine( startPos );
|
||||
|
||||
unsigned int nLengthDoc = startPos + length;
|
||||
styler.StartSegment( startPos );
|
||||
|
||||
char cCurrChar;
|
||||
bool bVarInString = false;
|
||||
bool bClassicVarInString = false;
|
||||
|
||||
unsigned int i;
|
||||
for ( i = startPos; i < nLengthDoc; i++ ) {
|
||||
cCurrChar = styler.SafeGetCharAt( i );
|
||||
char cNextChar = styler.SafeGetCharAt(i+1);
|
||||
|
||||
switch (state) {
|
||||
case SCE_CMAKE_DEFAULT:
|
||||
if ( cCurrChar == '#' ) { // we have a comment line
|
||||
styler.ColourTo(i-1, state );
|
||||
state = SCE_CMAKE_COMMENT;
|
||||
break;
|
||||
}
|
||||
if ( cCurrChar == '"' ) {
|
||||
styler.ColourTo(i-1, state );
|
||||
state = SCE_CMAKE_STRINGDQ;
|
||||
bVarInString = false;
|
||||
bClassicVarInString = false;
|
||||
break;
|
||||
}
|
||||
if ( cCurrChar == '\'' ) {
|
||||
styler.ColourTo(i-1, state );
|
||||
state = SCE_CMAKE_STRINGRQ;
|
||||
bVarInString = false;
|
||||
bClassicVarInString = false;
|
||||
break;
|
||||
}
|
||||
if ( cCurrChar == '`' ) {
|
||||
styler.ColourTo(i-1, state );
|
||||
state = SCE_CMAKE_STRINGLQ;
|
||||
bVarInString = false;
|
||||
bClassicVarInString = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// CMake Variable
|
||||
if ( cCurrChar == '$' || isCmakeChar(cCurrChar)) {
|
||||
styler.ColourTo(i-1,state);
|
||||
state = SCE_CMAKE_VARIABLE;
|
||||
|
||||
// If it is a number, we must check and set style here first...
|
||||
if ( isCmakeNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) )
|
||||
styler.ColourTo( i, SCE_CMAKE_NUMBER);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case SCE_CMAKE_COMMENT:
|
||||
if ( cNextChar == '\n' || cNextChar == '\r' ) {
|
||||
// Special case:
|
||||
if ( cCurrChar == '\\' ) {
|
||||
styler.ColourTo(i-2,state);
|
||||
styler.ColourTo(i,SCE_CMAKE_DEFAULT);
|
||||
}
|
||||
else {
|
||||
styler.ColourTo(i,state);
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SCE_CMAKE_STRINGDQ:
|
||||
case SCE_CMAKE_STRINGLQ:
|
||||
case SCE_CMAKE_STRINGRQ:
|
||||
|
||||
if ( styler.SafeGetCharAt(i-1) == '\\' && styler.SafeGetCharAt(i-2) == '$' )
|
||||
break; // Ignore the next character, even if it is a quote of some sort
|
||||
|
||||
if ( cCurrChar == '"' && state == SCE_CMAKE_STRINGDQ ) {
|
||||
styler.ColourTo(i,state);
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( cCurrChar == '`' && state == SCE_CMAKE_STRINGLQ ) {
|
||||
styler.ColourTo(i,state);
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( cCurrChar == '\'' && state == SCE_CMAKE_STRINGRQ ) {
|
||||
styler.ColourTo(i,state);
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( cNextChar == '\r' || cNextChar == '\n' ) {
|
||||
int nCurLine = styler.GetLine(i+1);
|
||||
int nBack = i;
|
||||
// We need to check if the previous line has a \ in it...
|
||||
bool bNextLine = false;
|
||||
|
||||
while ( nBack > 0 ) {
|
||||
if ( styler.GetLine(nBack) != nCurLine )
|
||||
break;
|
||||
|
||||
char cTemp = styler.SafeGetCharAt(nBack, 'a'); // Letter 'a' is safe here
|
||||
|
||||
if ( cTemp == '\\' ) {
|
||||
bNextLine = true;
|
||||
break;
|
||||
}
|
||||
if ( cTemp != '\r' && cTemp != '\n' && cTemp != '\t' && cTemp != ' ' )
|
||||
break;
|
||||
|
||||
nBack--;
|
||||
}
|
||||
|
||||
if ( bNextLine ) {
|
||||
styler.ColourTo(i+1,state);
|
||||
}
|
||||
if ( bNextLine == false ) {
|
||||
styler.ColourTo(i,state);
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_CMAKE_VARIABLE:
|
||||
|
||||
// CMake Variable:
|
||||
if ( cCurrChar == '$' )
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
else if ( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) )
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
else if ( (isCmakeChar(cCurrChar) && !isCmakeChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' ) {
|
||||
state = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler );
|
||||
styler.ColourTo( i, state);
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
}
|
||||
else if ( !isCmakeChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' ) {
|
||||
if ( classifyWordCmake( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_CMAKE_NUMBER )
|
||||
styler.ColourTo( i-1, SCE_CMAKE_NUMBER );
|
||||
|
||||
state = SCE_CMAKE_DEFAULT;
|
||||
|
||||
if ( cCurrChar == '"' ) {
|
||||
state = SCE_CMAKE_STRINGDQ;
|
||||
bVarInString = false;
|
||||
bClassicVarInString = false;
|
||||
}
|
||||
else if ( cCurrChar == '`' ) {
|
||||
state = SCE_CMAKE_STRINGLQ;
|
||||
bVarInString = false;
|
||||
bClassicVarInString = false;
|
||||
}
|
||||
else if ( cCurrChar == '\'' ) {
|
||||
state = SCE_CMAKE_STRINGRQ;
|
||||
bVarInString = false;
|
||||
bClassicVarInString = false;
|
||||
}
|
||||
else if ( cCurrChar == '#' ) {
|
||||
state = SCE_CMAKE_COMMENT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( state == SCE_CMAKE_COMMENT) {
|
||||
styler.ColourTo(i,state);
|
||||
}
|
||||
else if ( state == SCE_CMAKE_STRINGDQ || state == SCE_CMAKE_STRINGLQ || state == SCE_CMAKE_STRINGRQ ) {
|
||||
bool bIngoreNextDollarSign = false;
|
||||
|
||||
if ( bVarInString && cCurrChar == '$' ) {
|
||||
bVarInString = false;
|
||||
bIngoreNextDollarSign = true;
|
||||
}
|
||||
else if ( bVarInString && cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' || cNextChar == '"' || cNextChar == '`' || cNextChar == '\'' ) ) {
|
||||
styler.ColourTo( i+1, SCE_CMAKE_STRINGVAR);
|
||||
bVarInString = false;
|
||||
bIngoreNextDollarSign = false;
|
||||
}
|
||||
|
||||
else if ( bVarInString && !isCmakeChar(cNextChar) ) {
|
||||
int nWordState = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler);
|
||||
if ( nWordState == SCE_CMAKE_VARIABLE )
|
||||
styler.ColourTo( i, SCE_CMAKE_STRINGVAR);
|
||||
bVarInString = false;
|
||||
}
|
||||
// Covers "${TEST}..."
|
||||
else if ( bClassicVarInString && cNextChar == '}' ) {
|
||||
styler.ColourTo( i+1, SCE_CMAKE_STRINGVAR);
|
||||
bClassicVarInString = false;
|
||||
}
|
||||
|
||||
// Start of var in string
|
||||
if ( !bIngoreNextDollarSign && cCurrChar == '$' && cNextChar == '{' ) {
|
||||
styler.ColourTo( i-1, state);
|
||||
bClassicVarInString = true;
|
||||
bVarInString = false;
|
||||
}
|
||||
else if ( !bIngoreNextDollarSign && cCurrChar == '$' ) {
|
||||
styler.ColourTo( i-1, state);
|
||||
bVarInString = true;
|
||||
bClassicVarInString = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Colourise remaining document
|
||||
styler.ColourTo(nLengthDoc-1,state);
|
||||
}
|
||||
|
||||
static void FoldCmakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
|
||||
{
|
||||
// No folding enabled, no reason to continue...
|
||||
if ( styler.GetPropertyInt("fold") == 0 )
|
||||
return;
|
||||
|
||||
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1;
|
||||
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
unsigned int safeStartPos = styler.LineStart( lineCurrent );
|
||||
|
||||
bool bArg1 = true;
|
||||
int nWordStart = -1;
|
||||
|
||||
int levelCurrent = SC_FOLDLEVELBASE;
|
||||
if (lineCurrent > 0)
|
||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||
int levelNext = levelCurrent;
|
||||
|
||||
for (unsigned int i = safeStartPos; i < startPos + length; i++) {
|
||||
char chCurr = styler.SafeGetCharAt(i);
|
||||
|
||||
if ( bArg1 ) {
|
||||
if ( nWordStart == -1 && (isCmakeLetter(chCurr)) ) {
|
||||
nWordStart = i;
|
||||
}
|
||||
else if ( isCmakeLetter(chCurr) == false && nWordStart > -1 ) {
|
||||
int newLevel = calculateFoldCmake( nWordStart, i-1, levelNext, styler, foldAtElse);
|
||||
|
||||
if ( newLevel == levelNext ) {
|
||||
if ( foldAtElse ) {
|
||||
if ( CmakeNextLineHasElse(i, startPos + length, styler) )
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
else
|
||||
levelNext = newLevel;
|
||||
bArg1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( chCurr == '\n' ) {
|
||||
if ( bArg1 && foldAtElse) {
|
||||
if ( CmakeNextLineHasElse(i, startPos + length, styler) )
|
||||
levelNext--;
|
||||
}
|
||||
|
||||
// If we are on a new line...
|
||||
int levelUse = levelCurrent;
|
||||
int lev = levelUse | levelNext << 16;
|
||||
if (levelUse < levelNext )
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent))
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
|
||||
lineCurrent++;
|
||||
levelCurrent = levelNext;
|
||||
bArg1 = true; // New line, lets look at first argument again
|
||||
nWordStart = -1;
|
||||
}
|
||||
}
|
||||
|
||||
int levelUse = levelCurrent;
|
||||
int lev = levelUse | levelNext << 16;
|
||||
if (levelUse < levelNext)
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent))
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
}
|
||||
|
||||
static const char * const cmakeWordLists[] = {
|
||||
"Commands",
|
||||
"Parameters",
|
||||
"UserDefined",
|
||||
0,
|
||||
0,};
|
||||
|
||||
LexerModule lmCmake(SCLEX_CMAKE, ColouriseCmakeDoc, "cmake", FoldCmakeDoc, cmakeWordLists);
|
@ -23,6 +23,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
|
||||
{
|
||||
int state = SCE_CONF_DEFAULT;
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordList
|
||||
*keywordLists[], Accessor &styler)
|
||||
{
|
||||
|
@ -20,6 +20,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
|
||||
|
358
src/stc/scintilla/src/LexD.cxx
Normal file
358
src/stc/scintilla/src/LexD.cxx
Normal file
@ -0,0 +1,358 @@
|
||||
/** @file LexD.cxx
|
||||
** Lexer for D.
|
||||
**
|
||||
** Copyright (c) 2006 by Waldemar Augustyn <waldemar@wdmsys.com>
|
||||
**/
|
||||
// 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 <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "StyleContext.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
/*/ Nested comments require keeping the value of the nesting level for every
|
||||
position in the document. But since scintilla always styles line by line,
|
||||
we only need to store one value per line. The non-negative number indicates
|
||||
nesting level at the end of the line.
|
||||
/*/
|
||||
|
||||
// We use custom qualifiers since it is not clear what D allows.
|
||||
|
||||
static bool IsWordStart(int ch) {
|
||||
return isascii(ch) && (isalpha(ch) || ch == '_');
|
||||
}
|
||||
|
||||
static bool IsWord(int ch) {
|
||||
return isascii(ch) && (isalnum(ch) || ch == '_');
|
||||
}
|
||||
|
||||
static bool IsDoxygen(int ch) {
|
||||
if (isascii(ch) && islower(ch))
|
||||
return true;
|
||||
if (ch == '$' || ch == '@' || ch == '\\' ||
|
||||
ch == '&' || ch == '#' || ch == '<' || ch == '>' ||
|
||||
ch == '{' || ch == '}' || ch == '[' || ch == ']')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
|
||||
WordList *keywordlists[], Accessor &styler, bool caseSensitive) {
|
||||
|
||||
WordList &keywords = *keywordlists[0];
|
||||
WordList &keywords2 = *keywordlists[1];
|
||||
WordList &keywords3 = *keywordlists[2];
|
||||
WordList &keywords4 = *keywordlists[3];
|
||||
|
||||
int styleBeforeDCKeyword = SCE_D_DEFAULT;
|
||||
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
|
||||
int curLine = styler.GetLine(startPos);
|
||||
int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
if (sc.atLineStart) {
|
||||
if (sc.state == SCE_D_STRING) {
|
||||
// Prevent SCE_D_STRINGEOL from leaking back to previous line which
|
||||
// ends with a line continuation by locking in the state upto this position.
|
||||
sc.SetState(SCE_D_STRING);
|
||||
}
|
||||
curLine = styler.GetLine(sc.currentPos);
|
||||
styler.SetLineState(curLine, curNcLevel);
|
||||
}
|
||||
|
||||
// Handle line continuation generically.
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\n' || sc.chNext == '\r') {
|
||||
sc.Forward();
|
||||
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||
sc.Forward();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if the current state should terminate.
|
||||
switch (sc.state) {
|
||||
case SCE_D_OPERATOR:
|
||||
sc.SetState(SCE_D_DEFAULT);
|
||||
break;
|
||||
case SCE_D_NUMBER:
|
||||
// We accept almost anything because of hex. and number suffixes
|
||||
if (!IsWord(sc.ch) && sc.ch != '.') {
|
||||
sc.SetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_D_IDENTIFIER:
|
||||
if (!IsWord(sc.ch)) {
|
||||
char s[1000];
|
||||
if (caseSensitive) {
|
||||
sc.GetCurrent(s, sizeof(s));
|
||||
} else {
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
}
|
||||
if (keywords.InList(s)) {
|
||||
sc.ChangeState(SCE_D_WORD);
|
||||
} else if (keywords2.InList(s)) {
|
||||
sc.ChangeState(SCE_D_WORD2);
|
||||
} else if (keywords4.InList(s)) {
|
||||
sc.ChangeState(SCE_D_TYPEDEF);
|
||||
}
|
||||
sc.SetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_D_COMMENT:
|
||||
if (sc.Match('*', '/')) {
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_D_COMMENTDOC:
|
||||
if (sc.Match('*', '/')) {
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_D_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_D_COMMENTDOC;
|
||||
sc.SetState(SCE_D_COMMENTDOCKEYWORD);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SCE_D_COMMENTLINE:
|
||||
if (sc.atLineStart) {
|
||||
sc.SetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_D_COMMENTLINEDOC:
|
||||
if (sc.atLineStart) {
|
||||
sc.SetState(SCE_D_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_D_COMMENTLINEDOC;
|
||||
sc.SetState(SCE_D_COMMENTDOCKEYWORD);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SCE_D_COMMENTDOCKEYWORD:
|
||||
if ((styleBeforeDCKeyword == SCE_D_COMMENTDOC) && sc.Match('*', '/')) {
|
||||
sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR);
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_D_DEFAULT);
|
||||
} else if (!IsDoxygen(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)) {
|
||||
sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR);
|
||||
}
|
||||
sc.SetState(styleBeforeDCKeyword);
|
||||
}
|
||||
break;
|
||||
case SCE_D_COMMENTNESTED:
|
||||
if (sc.Match('+', '/')) {
|
||||
if (curNcLevel > 0)
|
||||
curNcLevel -= 1;
|
||||
curLine = styler.GetLine(sc.currentPos);
|
||||
styler.SetLineState(curLine, curNcLevel);
|
||||
sc.Forward();
|
||||
if (curNcLevel == 0) {
|
||||
sc.ForwardSetState(SCE_D_DEFAULT);
|
||||
}
|
||||
}
|
||||
else if (sc.Match('/','+')) {
|
||||
curNcLevel += 1;
|
||||
curLine = styler.GetLine(sc.currentPos);
|
||||
styler.SetLineState(curLine, curNcLevel);
|
||||
sc.Forward();
|
||||
}
|
||||
break;
|
||||
case SCE_D_STRING:
|
||||
if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_D_STRINGEOL);
|
||||
} else if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_D_CHARACTER:
|
||||
if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_D_STRINGEOL);
|
||||
} else if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_D_STRINGEOL:
|
||||
if (sc.atLineStart) {
|
||||
sc.SetState(SCE_D_DEFAULT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
if (sc.state == SCE_D_DEFAULT) {
|
||||
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_D_NUMBER);
|
||||
} else if (IsWordStart(sc.ch)) {
|
||||
sc.SetState(SCE_D_IDENTIFIER);
|
||||
} else if (sc.Match('/','+')) {
|
||||
curNcLevel += 1;
|
||||
curLine = styler.GetLine(sc.currentPos);
|
||||
styler.SetLineState(curLine, curNcLevel);
|
||||
sc.SetState(SCE_D_COMMENTNESTED);
|
||||
sc.Forward();
|
||||
} else if (sc.Match('/', '*')) {
|
||||
if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style
|
||||
sc.SetState(SCE_D_COMMENTDOC);
|
||||
} else {
|
||||
sc.SetState(SCE_D_COMMENT);
|
||||
}
|
||||
sc.Forward(); // Eat the * so it isn't used for the end of the comment
|
||||
} else if (sc.Match('/', '/')) {
|
||||
if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!"))
|
||||
// Support of Qt/Doxygen doc. style
|
||||
sc.SetState(SCE_D_COMMENTLINEDOC);
|
||||
else
|
||||
sc.SetState(SCE_D_COMMENTLINE);
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_D_STRING);
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.SetState(SCE_D_CHARACTER);
|
||||
} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||
sc.SetState(SCE_D_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
static bool IsStreamCommentStyle(int style) {
|
||||
return style == SCE_D_COMMENT ||
|
||||
style == SCE_D_COMMENTDOC ||
|
||||
style == SCE_D_COMMENTDOCKEYWORD ||
|
||||
style == SCE_D_COMMENTDOCKEYWORDERROR;
|
||||
}
|
||||
|
||||
// Store both the current line's fold level and the next lines in the
|
||||
// level store to make it easy to pick up with each increment
|
||||
// and to make it possible to fiddle the current level for "} else {".
|
||||
static void FoldDoc(unsigned int startPos, int length, int initStyle, Accessor &styler) {
|
||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
bool foldAtElse = styler.GetPropertyInt("lexer.d.fold.at.else",
|
||||
styler.GetPropertyInt("fold.at.else", 0)) != 0;
|
||||
unsigned int endPos = startPos + length;
|
||||
int visibleChars = 0;
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
int levelCurrent = SC_FOLDLEVELBASE;
|
||||
if (lineCurrent > 0)
|
||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||
int levelMinCurrent = levelCurrent;
|
||||
int levelNext = levelCurrent;
|
||||
char chNext = styler[startPos];
|
||||
int styleNext = styler.StyleAt(startPos);
|
||||
int style = initStyle;
|
||||
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 && IsStreamCommentStyle(style)) {
|
||||
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 (style == SCE_D_OPERATOR) {
|
||||
if (ch == '{') {
|
||||
// Measure the minimum before a '{' to allow
|
||||
// folding on "} else {"
|
||||
if (levelMinCurrent > levelNext) {
|
||||
levelMinCurrent = levelNext;
|
||||
}
|
||||
levelNext++;
|
||||
} else if (ch == '}') {
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
if (atEOL) {
|
||||
if (foldComment) { // Handle nested comments
|
||||
int nc;
|
||||
nc = styler.GetLineState(lineCurrent);
|
||||
nc -= lineCurrent>0? styler.GetLineState(lineCurrent-1): 0;
|
||||
levelNext += nc;
|
||||
}
|
||||
int levelUse = levelCurrent;
|
||||
if (foldAtElse) {
|
||||
levelUse = levelMinCurrent;
|
||||
}
|
||||
int lev = levelUse | levelNext << 16;
|
||||
if (visibleChars == 0 && foldCompact)
|
||||
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||
if (levelUse < levelNext)
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent)) {
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
}
|
||||
lineCurrent++;
|
||||
levelCurrent = levelNext;
|
||||
levelMinCurrent = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
if (!IsASpace(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
|
||||
static void FoldDDoc(unsigned int startPos, int length, int initStyle,
|
||||
WordList *[], Accessor &styler) {
|
||||
FoldDoc(startPos, length, initStyle, styler);
|
||||
}
|
||||
|
||||
static const char * const dWordLists[] = {
|
||||
"Primary keywords and identifiers",
|
||||
"Secondary keywords and identifiers",
|
||||
"Documentation comment keywords",
|
||||
"Type definitions and aliases",
|
||||
0,
|
||||
};
|
||||
|
||||
static void ColouriseDDoc(unsigned int startPos, int length,
|
||||
int initStyle, WordList *keywordlists[], Accessor &styler) {
|
||||
ColouriseDoc(startPos, length, initStyle, keywordlists, styler, true);
|
||||
}
|
||||
|
||||
LexerModule lmD(SCLEX_D, ColouriseDDoc, "d", FoldDDoc, dWordLists);
|
@ -19,6 +19,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool isEiffelOperator(unsigned int ch) {
|
||||
// '.' left out as it is used to make up numbers
|
||||
return ch == '*' || ch == '/' || ch == '\\' || ch == '-' || ch == '+' ||
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
/*
|
||||
TODO:
|
||||
o _Param should be a new lexical type
|
||||
|
@ -22,6 +22,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static bool IsFlagShipComment(Accessor &styler, int pos, int len) {
|
||||
return len>0 && styler[pos]=='\'';
|
||||
}
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
bool is_whitespace(int ch){
|
||||
return ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ';
|
||||
}
|
||||
|
@ -19,6 +19,11 @@
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
/***********************************************/
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%');
|
||||
|
263
src/stc/scintilla/src/LexGAP.cxx
Normal file
263
src/stc/scintilla/src/LexGAP.cxx
Normal file
@ -0,0 +1,263 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file LexGAP.cxx
|
||||
** Lexer for the GAP language. (The GAP System for Computational Discrete Algebra)
|
||||
** http://www.gap-system.org
|
||||
**/
|
||||
// Copyright 2007 by Istvan Szollosi ( szteven <at> gmail <dot> com )
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "StyleContext.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsGAPOperator(char ch) {
|
||||
if (isalnum(ch)) return false;
|
||||
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 GetRange(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>(styler[start + i]);
|
||||
i++;
|
||||
}
|
||||
s[i] = '\0';
|
||||
}
|
||||
|
||||
static void ColouriseGAPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
|
||||
|
||||
WordList &keywords1 = *keywordlists[0];
|
||||
WordList &keywords2 = *keywordlists[1];
|
||||
WordList &keywords3 = *keywordlists[2];
|
||||
WordList &keywords4 = *keywordlists[3];
|
||||
|
||||
// Do not leak onto next line
|
||||
if (initStyle == SCE_GAP_STRINGEOL) initStyle = SCE_GAP_DEFAULT;
|
||||
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
// Prevent SCE_GAP_STRINGEOL from leaking back to previous line
|
||||
if ( sc.atLineStart ) {
|
||||
if (sc.state == SCE_GAP_STRING) sc.SetState(SCE_GAP_STRING);
|
||||
if (sc.state == SCE_GAP_CHAR) sc.SetState(SCE_GAP_CHAR);
|
||||
}
|
||||
|
||||
// Handle line continuation generically
|
||||
if (sc.ch == '\\' ) {
|
||||
if (sc.chNext == '\n' || sc.chNext == '\r') {
|
||||
sc.Forward();
|
||||
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||
sc.Forward();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if the current state should terminate
|
||||
switch (sc.state) {
|
||||
case SCE_GAP_OPERATOR :
|
||||
sc.SetState(SCE_GAP_DEFAULT);
|
||||
break;
|
||||
|
||||
case SCE_GAP_NUMBER :
|
||||
if (!IsADigit(sc.ch)) {
|
||||
if (sc.ch == '\\') {
|
||||
if (!sc.atLineEnd) {
|
||||
if (!IsADigit(sc.chNext)) {
|
||||
sc.Forward();
|
||||
sc.ChangeState(SCE_GAP_IDENTIFIER);
|
||||
}
|
||||
}
|
||||
} else if (isalpha(sc.ch) || sc.ch == '_') {
|
||||
sc.ChangeState(SCE_GAP_IDENTIFIER);
|
||||
}
|
||||
else sc.SetState(SCE_GAP_DEFAULT);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_GAP_IDENTIFIER :
|
||||
if (!(iswordstart(static_cast<char>(sc.ch)) || sc.ch == '$')) {
|
||||
if (sc.ch == '\\') sc.Forward();
|
||||
else {
|
||||
char s[1000];
|
||||
sc.GetCurrent(s, sizeof(s));
|
||||
if (keywords1.InList(s)) {
|
||||
sc.ChangeState(SCE_GAP_KEYWORD);
|
||||
} else if (keywords2.InList(s)) {
|
||||
sc.ChangeState(SCE_GAP_KEYWORD2);
|
||||
} else if (keywords3.InList(s)) {
|
||||
sc.ChangeState(SCE_GAP_KEYWORD3);
|
||||
} else if (keywords4.InList(s)) {
|
||||
sc.ChangeState(SCE_GAP_KEYWORD4);
|
||||
}
|
||||
sc.SetState(SCE_GAP_DEFAULT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_GAP_COMMENT :
|
||||
if (sc.atLineEnd) {
|
||||
sc.SetState(SCE_GAP_DEFAULT);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_GAP_STRING:
|
||||
if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_GAP_STRINGEOL);
|
||||
} else if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_GAP_DEFAULT);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_GAP_CHAR:
|
||||
if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_GAP_STRINGEOL);
|
||||
} else if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_GAP_DEFAULT);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_GAP_STRINGEOL:
|
||||
if (sc.atLineStart) {
|
||||
sc.SetState(SCE_GAP_DEFAULT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered
|
||||
if (sc.state == SCE_GAP_DEFAULT) {
|
||||
if (IsGAPOperator(static_cast<char>(sc.ch))) {
|
||||
sc.SetState(SCE_GAP_OPERATOR);
|
||||
}
|
||||
else if (IsADigit(sc.ch)) {
|
||||
sc.SetState(SCE_GAP_NUMBER);
|
||||
} else if (isalpha(sc.ch) || sc.ch == '_' || sc.ch == '\\' || sc.ch == '$' || sc.ch == '~') {
|
||||
sc.SetState(SCE_GAP_IDENTIFIER);
|
||||
if (sc.ch == '\\') sc.Forward();
|
||||
} else if (sc.ch == '#') {
|
||||
sc.SetState(SCE_GAP_COMMENT);
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_GAP_STRING);
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.SetState(SCE_GAP_CHAR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
static int ClassifyFoldPointGAP(const char* s) {
|
||||
int level = 0;
|
||||
if (strcmp(s, "function") == 0 ||
|
||||
strcmp(s, "do") == 0 ||
|
||||
strcmp(s, "if") == 0 ||
|
||||
strcmp(s, "repeat") == 0 ) {
|
||||
level = 1;
|
||||
} else if (strcmp(s, "end") == 0 ||
|
||||
strcmp(s, "od") == 0 ||
|
||||
strcmp(s, "fi") == 0 ||
|
||||
strcmp(s, "until") == 0 ) {
|
||||
level = -1;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
static void FoldGAPDoc( unsigned int startPos, int length, int initStyle, WordList** , Accessor &styler) {
|
||||
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;
|
||||
|
||||
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_GAP_KEYWORD && style == SCE_GAP_KEYWORD) {
|
||||
// Store last word start point.
|
||||
lastStart = i;
|
||||
}
|
||||
|
||||
if (stylePrev == SCE_GAP_KEYWORD) {
|
||||
if(iswordchar(ch) && !iswordchar(chNext)) {
|
||||
char s[100];
|
||||
GetRange(lastStart, i, styler, s, sizeof(s));
|
||||
levelCurrent += ClassifyFoldPointGAP(s);
|
||||
}
|
||||
}
|
||||
|
||||
if (atEOL) {
|
||||
int lev = levelPrev;
|
||||
if ((levelCurrent > levelPrev) && (visibleChars > 0))
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent)) {
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
}
|
||||
lineCurrent++;
|
||||
levelPrev = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
|
||||
if (!isspacechar(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
|
||||
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
|
||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||
}
|
||||
|
||||
static const char * const GAPWordListDesc[] = {
|
||||
"Keywords 1",
|
||||
"Keywords 2",
|
||||
"Keywords 3 (unused)",
|
||||
"Keywords 4 (unused)",
|
||||
0
|
||||
};
|
||||
|
||||
LexerModule lmGAP(
|
||||
SCLEX_GAP,
|
||||
ColouriseGAPDoc,
|
||||
"gap",
|
||||
FoldGAPDoc,
|
||||
GAPWordListDesc);
|
@ -36,6 +36,10 @@ val SCE_GC_OPERATOR=9
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#define debug Platform::DebugPrintf
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
|
@ -19,6 +19,11 @@
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
#include "CharacterSet.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#define SCE_HA_JS (SCE_HJA_START - SCE_HJ_START)
|
||||
#define SCE_HA_VBS (SCE_HBA_START - SCE_HB_START)
|
||||
@ -35,6 +40,20 @@ static inline bool IsAWordStart(const int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '_');
|
||||
}
|
||||
|
||||
inline bool IsOperator(int 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 == ';' ||
|
||||
ch == '<' || ch == '>' || ch == ',' || ch == '/' ||
|
||||
ch == '?' || ch == '!' || ch == '.' || ch == '~')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int MakeLowerCase(int ch) {
|
||||
if (ch < 'A' || ch > 'Z')
|
||||
return ch;
|
||||
@ -66,8 +85,15 @@ static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start,
|
||||
return eScriptJS;
|
||||
if (strstr(s, "php"))
|
||||
return eScriptPHP;
|
||||
if (strstr(s, "xml"))
|
||||
if (strstr(s, "xml")) {
|
||||
const char *xml = strstr(s, "xml");
|
||||
for (const char *t=s; t<xml; t++) {
|
||||
if (!IsASpace(*t)) {
|
||||
return prevValue;
|
||||
}
|
||||
}
|
||||
return eScriptXML;
|
||||
}
|
||||
|
||||
return prevValue;
|
||||
}
|
||||
@ -102,16 +128,16 @@ static script_type ScriptOfState(int state) {
|
||||
}
|
||||
|
||||
static int statePrintForState(int state, script_mode inScriptType) {
|
||||
int StateToPrint;
|
||||
int StateToPrint = state;
|
||||
|
||||
if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) {
|
||||
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON);
|
||||
} else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
|
||||
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS);
|
||||
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
|
||||
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS);
|
||||
} else {
|
||||
StateToPrint = state;
|
||||
if (state >= SCE_HJ_START) {
|
||||
if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) {
|
||||
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON);
|
||||
} else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
|
||||
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS);
|
||||
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
|
||||
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS);
|
||||
}
|
||||
}
|
||||
|
||||
return StateToPrint;
|
||||
@ -173,6 +199,7 @@ static inline bool stateAllowsTermination(int state) {
|
||||
bool allowTermination = !isStringState(state);
|
||||
if (allowTermination) {
|
||||
switch (state) {
|
||||
case SCE_HB_COMMENTLINE:
|
||||
case SCE_HPHP_COMMENT:
|
||||
case SCE_HP_COMMENTLINE:
|
||||
case SCE_HPA_COMMENTLINE:
|
||||
@ -222,7 +249,7 @@ static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &k
|
||||
|
||||
static int classifyTagHTML(unsigned int start, unsigned int end,
|
||||
WordList &keywords, Accessor &styler, bool &tagDontFold,
|
||||
bool caseSensitive) {
|
||||
bool caseSensitive, bool isXml) {
|
||||
char s[30 + 2];
|
||||
// Copy after the '<'
|
||||
unsigned int i = 0;
|
||||
@ -238,9 +265,10 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
|
||||
s[i] = ' ';
|
||||
s[i+1] = '\0';
|
||||
|
||||
// if the current language is XML, I can fold any tag
|
||||
// if the current language is HTML, I don't want to fold certain tags (input, meta, etc.)
|
||||
//...to find it in the list of no-container-tags
|
||||
// (There are many more. We will need a keywordlist in the property file for this)
|
||||
tagDontFold = (NULL != strstr("meta link img area br hr input ",s));
|
||||
tagDontFold = (!isXml) && (NULL != strstr("meta link img area br hr input ",s));
|
||||
|
||||
//now we can remove the trailing space
|
||||
s[i] = '\0';
|
||||
@ -390,21 +418,21 @@ static int StateForScript(script_type scriptLanguage) {
|
||||
return Result;
|
||||
}
|
||||
|
||||
static inline bool ishtmlwordchar(char ch) {
|
||||
static inline bool ishtmlwordchar(int ch) {
|
||||
return !isascii(ch) ||
|
||||
(isalnum(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':' || ch == '!' || ch == '#');
|
||||
}
|
||||
|
||||
static inline bool issgmlwordchar(char ch) {
|
||||
static inline bool issgmlwordchar(int ch) {
|
||||
return !isascii(ch) ||
|
||||
(isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '[');
|
||||
}
|
||||
|
||||
static inline bool IsPhpWordStart(const unsigned char ch) {
|
||||
static inline bool IsPhpWordStart(int ch) {
|
||||
return (isascii(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f);
|
||||
}
|
||||
|
||||
static inline bool IsPhpWordChar(char ch) {
|
||||
static inline bool IsPhpWordChar(int ch) {
|
||||
return IsADigit(ch) || IsPhpWordStart(ch);
|
||||
}
|
||||
|
||||
@ -425,11 +453,11 @@ static bool IsScriptCommentState(const int state) {
|
||||
state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE;
|
||||
}
|
||||
|
||||
static bool isLineEnd(char ch) {
|
||||
static bool isLineEnd(int ch) {
|
||||
return ch == '\r' || ch == '\n';
|
||||
}
|
||||
|
||||
static bool isOKBeforeRE(char ch) {
|
||||
static bool isOKBeforeRE(int ch) {
|
||||
return (ch == '(') || (ch == '=') || (ch == ',');
|
||||
}
|
||||
|
||||
@ -457,7 +485,7 @@ static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringD
|
||||
}
|
||||
|
||||
static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
Accessor &styler, bool isXml) {
|
||||
WordList &keywords = *keywordlists[0];
|
||||
WordList &keywords2 = *keywordlists[1];
|
||||
WordList &keywords3 = *keywordlists[2];
|
||||
@ -465,8 +493,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
WordList &keywords5 = *keywordlists[4];
|
||||
WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords
|
||||
|
||||
// Lexer for HTML requires more lexical states (7 bits worth) than most lexers
|
||||
styler.StartAt(startPos, STYLE_MAX);
|
||||
// Lexer for HTML requires more lexical states (8 bits worth) than most lexers
|
||||
styler.StartAt(startPos, static_cast<char>(STYLE_MAX));
|
||||
char prevWord[200];
|
||||
prevWord[0] = '\0';
|
||||
char phpStringDelimiter[200]; // PHP is not limited in length, we are
|
||||
@ -488,7 +516,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
length++;
|
||||
state = styler.StyleAt(startPos);
|
||||
}
|
||||
styler.StartAt(startPos, STYLE_MAX);
|
||||
styler.StartAt(startPos, static_cast<char>(STYLE_MAX));
|
||||
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
int lineState;
|
||||
@ -515,13 +543,17 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
const bool caseSensitive = styler.GetPropertyInt("html.tags.case.sensitive", 0) != 0;
|
||||
|
||||
const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true);
|
||||
const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true);
|
||||
const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true);
|
||||
|
||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||
int levelCurrent = levelPrev;
|
||||
int visibleChars = 0;
|
||||
|
||||
char chPrev = ' ';
|
||||
char ch = ' ';
|
||||
char chPrevNonWhite = ' ';
|
||||
int chPrev = ' ';
|
||||
int ch = ' ';
|
||||
int chPrevNonWhite = ' ';
|
||||
// look back to set chPrevNonWhite properly for better regex colouring
|
||||
if (scriptLanguage == eScriptJS && startPos > 0) {
|
||||
int back = startPos;
|
||||
@ -533,30 +565,30 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
break;
|
||||
}
|
||||
if (style == SCE_HJ_SYMBOLS) {
|
||||
chPrevNonWhite = styler.SafeGetCharAt(back);
|
||||
chPrevNonWhite = static_cast<unsigned char>(styler.SafeGetCharAt(back));
|
||||
}
|
||||
}
|
||||
|
||||
styler.StartSegment(startPos);
|
||||
const int lengthDoc = startPos + length;
|
||||
for (int i = startPos; i < lengthDoc; i++) {
|
||||
const char chPrev2 = chPrev;
|
||||
const int chPrev2 = chPrev;
|
||||
chPrev = ch;
|
||||
if (!isspacechar(ch) && state != SCE_HJ_COMMENT &&
|
||||
if (!IsASpace(ch) && state != SCE_HJ_COMMENT &&
|
||||
state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC)
|
||||
chPrevNonWhite = ch;
|
||||
ch = styler[i];
|
||||
char chNext = styler.SafeGetCharAt(i + 1);
|
||||
const char chNext2 = styler.SafeGetCharAt(i + 2);
|
||||
ch = static_cast<unsigned char>(styler[i]);
|
||||
int chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
const int chNext2 = static_cast<unsigned char>(styler.SafeGetCharAt(i + 2));
|
||||
|
||||
// Handle DBCS codepages
|
||||
if (styler.IsLeadByte(ch)) {
|
||||
if (styler.IsLeadByte(static_cast<char>(ch))) {
|
||||
chPrev = ' ';
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((!isspacechar(ch) || !foldCompact) && fold)
|
||||
if ((!IsASpace(ch) || !foldCompact) && fold)
|
||||
visibleChars++;
|
||||
|
||||
// decide what is the current state to print (depending of the script tag)
|
||||
@ -644,22 +676,24 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
case SCE_HJ_COMMENTDOC:
|
||||
//case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide
|
||||
// the end of script marker from some JS interpreters.
|
||||
case SCE_HB_COMMENTLINE:
|
||||
case SCE_HBA_COMMENTLINE:
|
||||
case SCE_HJ_DOUBLESTRING:
|
||||
case SCE_HJ_SINGLESTRING:
|
||||
case SCE_HJ_REGEX:
|
||||
case SCE_HB_STRING:
|
||||
case SCE_HBA_STRING:
|
||||
case SCE_HP_STRING:
|
||||
case SCE_HP_TRIPLE:
|
||||
case SCE_HP_TRIPLEDOUBLE:
|
||||
break;
|
||||
default :
|
||||
// check if the closing tag is a script tag
|
||||
if (state == SCE_HJ_COMMENTLINE) {
|
||||
if (state == SCE_HJ_COMMENTLINE || isXml) {
|
||||
char tag[7]; // room for the <script> tag
|
||||
char chr; // current char
|
||||
int j=0;
|
||||
chr = styler.SafeGetCharAt(i+2);
|
||||
while (j < 6 && !isspacechar(chr)) {
|
||||
int j = 0;
|
||||
char chr = styler.SafeGetCharAt(i+2);
|
||||
while (j < 6 && !IsASpace(chr)) {
|
||||
tag[j++] = static_cast<char>(MakeLowerCase(chr));
|
||||
chr = styler.SafeGetCharAt(i+2+j);
|
||||
}
|
||||
@ -708,7 +742,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
levelCurrent++;
|
||||
}
|
||||
// should be better
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -747,7 +781,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
if (foldHTMLPreprocessor)
|
||||
levelCurrent++;
|
||||
// should be better
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -862,7 +896,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_H_SGML_SIMPLESTRING;
|
||||
} else if ((ch == '-') && (chPrev == '-')) {
|
||||
styler.ColourTo(i - 2, StateToPrint);
|
||||
if (static_cast<int>(styler.GetStartSegment()) <= (i - 2)) {
|
||||
styler.ColourTo(i - 2, StateToPrint);
|
||||
}
|
||||
state = SCE_H_SGML_COMMENT;
|
||||
} else if (isascii(ch) && isalpha(ch) && (chPrev == '%')) {
|
||||
styler.ColourTo(i - 2, StateToPrint);
|
||||
@ -924,12 +960,12 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
// find the length of the word
|
||||
int size = 1;
|
||||
while (ishtmlwordchar(styler.SafeGetCharAt(i + size)))
|
||||
while (setHTMLWord.Contains(static_cast<unsigned char>(styler.SafeGetCharAt(i + size))))
|
||||
size++;
|
||||
styler.ColourTo(i + size - 1, StateToPrint);
|
||||
i += size - 1;
|
||||
visibleChars += size - 1;
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
|
||||
if (scriptLanguage == eScriptSGMLblock) {
|
||||
state = SCE_H_SGML_BLOCK_DEFAULT;
|
||||
} else {
|
||||
@ -1012,9 +1048,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
break;
|
||||
case SCE_H_TAGUNKNOWN:
|
||||
if (!ishtmlwordchar(ch) && !((ch == '/') && (chPrev == '<')) && ch != '[') {
|
||||
if (!setTagContinue.Contains(ch) && !((ch == '/') && (chPrev == '<'))) {
|
||||
int eClass = classifyTagHTML(styler.GetStartSegment(),
|
||||
i - 1, keywords, styler, tagDontFold, caseSensitive);
|
||||
i - 1, keywords, styler, tagDontFold, caseSensitive, isXml);
|
||||
if (eClass == SCE_H_SCRIPT) {
|
||||
if (!tagClosing) {
|
||||
inScriptType = eNonHtmlScript;
|
||||
@ -1064,7 +1100,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
break;
|
||||
case SCE_H_ATTRIBUTE:
|
||||
if (!ishtmlwordchar(ch) && ch != '/' && ch != '-') {
|
||||
if (!setAttributeContinue.Contains(ch)) {
|
||||
if (inScriptType == eNonHtmlScript) {
|
||||
int scriptLanguagePrev = scriptLanguage;
|
||||
clientScript = segIsScriptingIndicator(styler, styler.GetStartSegment(), i - 1, scriptLanguage);
|
||||
@ -1137,7 +1173,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
i++;
|
||||
ch = chNext;
|
||||
state = SCE_H_DEFAULT;
|
||||
} else if (ishtmlwordchar(ch)) {
|
||||
} else if (setHTMLWord.Contains(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_H_ATTRIBUTE;
|
||||
}
|
||||
@ -1161,7 +1197,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
break;
|
||||
case SCE_H_VALUE:
|
||||
if (!ishtmlwordchar(ch)) {
|
||||
if (!setHTMLWord.Contains(ch)) {
|
||||
if (ch == '\"' && chPrev == '=') {
|
||||
// Should really test for being first character
|
||||
state = SCE_H_DOUBLESTRING;
|
||||
@ -1198,7 +1234,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
case SCE_HJ_DEFAULT:
|
||||
case SCE_HJ_START:
|
||||
case SCE_HJ_SYMBOLS:
|
||||
if (iswordstart(ch)) {
|
||||
if (IsAWordStart(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HJ_WORD;
|
||||
} else if (ch == '/' && chNext == '*') {
|
||||
@ -1227,7 +1263,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HJ_COMMENTLINE;
|
||||
i += 2;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType));
|
||||
state = SCE_HJ_DEFAULT;
|
||||
@ -1239,7 +1275,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
break;
|
||||
case SCE_HJ_WORD:
|
||||
if (!iswordchar(ch)) {
|
||||
if (!IsAWordChar(ch)) {
|
||||
classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType);
|
||||
//styler.ColourTo(i - 1, eHTJSKeyword);
|
||||
state = SCE_HJ_DEFAULT;
|
||||
@ -1258,7 +1294,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HJ_COMMENTLINE;
|
||||
i += 2;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType));
|
||||
state = SCE_HJ_DEFAULT;
|
||||
}
|
||||
@ -1328,7 +1364,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
while (isascii(chNext) && islower(chNext)) { // gobble regex flags
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
}
|
||||
}
|
||||
styler.ColourTo(i, StateToPrint);
|
||||
@ -1338,13 +1374,13 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
if (chNext == '\\' || chNext == '/') {
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SCE_HB_DEFAULT:
|
||||
case SCE_HB_START:
|
||||
if (iswordstart(ch)) {
|
||||
if (IsAWordStart(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HB_WORD;
|
||||
} else if (ch == '\'') {
|
||||
@ -1357,7 +1393,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
styler.SafeGetCharAt(i + 3) == '-') {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HB_COMMENTLINE;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType));
|
||||
state = SCE_HB_DEFAULT;
|
||||
@ -1369,14 +1405,14 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
break;
|
||||
case SCE_HB_WORD:
|
||||
if (!iswordchar(ch)) {
|
||||
if (!IsAWordChar(ch)) {
|
||||
state = classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType);
|
||||
if (state == SCE_HB_DEFAULT) {
|
||||
if (ch == '\"') {
|
||||
state = SCE_HB_STRING;
|
||||
} else if (ch == '\'') {
|
||||
state = SCE_HB_COMMENTLINE;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType));
|
||||
state = SCE_HB_DEFAULT;
|
||||
}
|
||||
@ -1409,7 +1445,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
break;
|
||||
case SCE_HP_DEFAULT:
|
||||
case SCE_HP_START:
|
||||
if (iswordstart(ch)) {
|
||||
if (IsAWordStart(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HP_WORD;
|
||||
} else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') &&
|
||||
@ -1426,7 +1462,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HP_TRIPLEDOUBLE;
|
||||
ch = ' ';
|
||||
chPrev = ' ';
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
} else {
|
||||
// state = statePrintForState(SCE_HP_STRING,inScriptType);
|
||||
state = SCE_HP_STRING;
|
||||
@ -1438,11 +1474,11 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HP_TRIPLE;
|
||||
ch = ' ';
|
||||
chPrev = ' ';
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
} else {
|
||||
state = SCE_HP_CHARACTER;
|
||||
}
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType));
|
||||
} else if ((ch == ' ') || (ch == '\t')) {
|
||||
@ -1453,7 +1489,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
break;
|
||||
case SCE_HP_WORD:
|
||||
if (!iswordchar(ch)) {
|
||||
if (!IsAWordChar(ch)) {
|
||||
classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType);
|
||||
state = SCE_HP_DEFAULT;
|
||||
if (ch == '#') {
|
||||
@ -1464,7 +1500,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HP_TRIPLEDOUBLE;
|
||||
ch = ' ';
|
||||
chPrev = ' ';
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
} else {
|
||||
state = SCE_HP_STRING;
|
||||
}
|
||||
@ -1474,11 +1510,11 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HP_TRIPLE;
|
||||
ch = ' ';
|
||||
chPrev = ' ';
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
} else {
|
||||
state = SCE_HP_CHARACTER;
|
||||
}
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType));
|
||||
}
|
||||
}
|
||||
@ -1494,7 +1530,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
}
|
||||
} else if (ch == '\"') {
|
||||
styler.ColourTo(i, StateToPrint);
|
||||
@ -1506,7 +1542,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
|
||||
}
|
||||
} else if (ch == '\'') {
|
||||
styler.ColourTo(i, StateToPrint);
|
||||
@ -1527,7 +1563,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
break;
|
||||
///////////// start - PHP state handling
|
||||
case SCE_HPHP_WORD:
|
||||
if (!iswordchar(ch)) {
|
||||
if (!IsAWordChar(ch)) {
|
||||
classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler);
|
||||
if (ch == '/' && chNext == '*') {
|
||||
i++;
|
||||
@ -1547,7 +1583,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HPHP_SIMPLESTRING;
|
||||
} else if (ch == '$' && IsPhpWordStart(chNext)) {
|
||||
state = SCE_HPHP_VARIABLE;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
state = SCE_HPHP_OPERATOR;
|
||||
} else {
|
||||
state = SCE_HPHP_DEFAULT;
|
||||
@ -1560,7 +1596,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
&& strchr(".xXabcdefABCDEF", ch) == NULL
|
||||
&& ((ch != '-' && ch != '+') || (chPrev != 'e' && chPrev != 'E'))) {
|
||||
styler.ColourTo(i - 1, SCE_HPHP_NUMBER);
|
||||
if (isoperator(ch))
|
||||
if (IsOperator(ch))
|
||||
state = SCE_HPHP_OPERATOR;
|
||||
else
|
||||
state = SCE_HPHP_DEFAULT;
|
||||
@ -1569,7 +1605,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
case SCE_HPHP_VARIABLE:
|
||||
if (!IsPhpWordChar(ch)) {
|
||||
styler.ColourTo(i - 1, SCE_HPHP_VARIABLE);
|
||||
if (isoperator(ch))
|
||||
if (IsOperator(ch))
|
||||
state = SCE_HPHP_OPERATOR;
|
||||
else
|
||||
state = SCE_HPHP_DEFAULT;
|
||||
@ -1599,8 +1635,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HPHP_HSTRING_VARIABLE;
|
||||
} else if (styler.Match(i, phpStringDelimiter)) {
|
||||
if (strlen(phpStringDelimiter) > 1)
|
||||
i += strlen(phpStringDelimiter) - 1;
|
||||
const int psdLength = strlen(phpStringDelimiter);
|
||||
if ((psdLength > 1) && ((i + psdLength) < lengthDoc))
|
||||
i += psdLength - 1;
|
||||
styler.ColourTo(i, StateToPrint);
|
||||
state = SCE_HPHP_DEFAULT;
|
||||
}
|
||||
@ -1632,7 +1669,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
if (IsADigit(ch) || (ch == '.' && IsADigit(chNext))) {
|
||||
state = SCE_HPHP_NUMBER;
|
||||
} else if (iswordstart(ch)) {
|
||||
} else if (IsAWordStart(ch)) {
|
||||
state = SCE_HPHP_WORD;
|
||||
} else if (ch == '/' && chNext == '*') {
|
||||
i++;
|
||||
@ -1652,9 +1689,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HPHP_SIMPLESTRING;
|
||||
} else if (ch == '$' && IsPhpWordStart(chNext)) {
|
||||
state = SCE_HPHP_VARIABLE;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
state = SCE_HPHP_OPERATOR;
|
||||
} else if ((state == SCE_HPHP_OPERATOR) && (isspacechar(ch))) {
|
||||
} else if ((state == SCE_HPHP_OPERATOR) && (IsASpace(ch))) {
|
||||
state = SCE_HPHP_DEFAULT;
|
||||
}
|
||||
break;
|
||||
@ -1670,9 +1707,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HB_STRING;
|
||||
} else if (ch == '\'') {
|
||||
state = SCE_HB_COMMENTLINE;
|
||||
} else if (iswordstart(ch)) {
|
||||
} else if (IsAWordStart(ch)) {
|
||||
state = SCE_HB_WORD;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i, SCE_HB_DEFAULT);
|
||||
}
|
||||
} else if (state == SCE_HBA_DEFAULT) { // One of the above succeeded
|
||||
@ -1680,9 +1717,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HBA_STRING;
|
||||
} else if (ch == '\'') {
|
||||
state = SCE_HBA_COMMENTLINE;
|
||||
} else if (iswordstart(ch)) {
|
||||
} else if (IsAWordStart(ch)) {
|
||||
state = SCE_HBA_WORD;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i, SCE_HBA_DEFAULT);
|
||||
}
|
||||
} else if (state == SCE_HJ_DEFAULT) { // One of the above succeeded
|
||||
@ -1697,9 +1734,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HJ_DOUBLESTRING;
|
||||
} else if ((ch == '\'') && (nonEmptySegment)) {
|
||||
state = SCE_HJ_SINGLESTRING;
|
||||
} else if (iswordstart(ch)) {
|
||||
} else if (IsAWordStart(ch)) {
|
||||
state = SCE_HJ_WORD;
|
||||
} else if (isoperator(ch)) {
|
||||
} else if (IsOperator(ch)) {
|
||||
styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType));
|
||||
}
|
||||
}
|
||||
@ -1715,6 +1752,18 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
}
|
||||
}
|
||||
|
||||
static void ColouriseXMLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
// Passing in true because we're lexing XML
|
||||
ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists,styler, true);
|
||||
}
|
||||
|
||||
static void ColouriseHTMLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
// Passing in false because we're notlexing XML
|
||||
ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists,styler, false);
|
||||
}
|
||||
|
||||
static bool isASPScript(int state) {
|
||||
return
|
||||
(state >= SCE_HJA_START && state <= SCE_HJA_REGEX) ||
|
||||
@ -1789,7 +1838,7 @@ static void ColouriseHTMLPiece(StyleContext &sc, WordList *keywordlists[]) {
|
||||
sc.SetState(SCE_H_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_H_TAGUNKNOWN) {
|
||||
if (!ishtmlwordchar(static_cast<char>(sc.ch)) && !((sc.ch == '/') && (sc.chPrev == '<')) && sc.ch != '[') {
|
||||
if (!ishtmlwordchar(sc.ch) && !((sc.ch == '/') && (sc.chPrev == '<')) && sc.ch != '[') {
|
||||
char s[100];
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
if (s[1] == '/') {
|
||||
@ -1812,7 +1861,7 @@ static void ColouriseHTMLPiece(StyleContext &sc, WordList *keywordlists[]) {
|
||||
}
|
||||
}
|
||||
} else if (sc.state == SCE_H_ATTRIBUTE) {
|
||||
if (!ishtmlwordchar(static_cast<char>(sc.ch))) {
|
||||
if (!ishtmlwordchar(sc.ch)) {
|
||||
char s[100];
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
if (!keywordsTags.InList(s)) {
|
||||
@ -1864,7 +1913,7 @@ static void ColouriseHTMLPiece(StyleContext &sc, WordList *keywordlists[]) {
|
||||
} else if (sc.ch == '>') {
|
||||
sc.SetState(SCE_H_TAG);
|
||||
sc.ForwardSetState(SCE_H_DEFAULT);
|
||||
} else if (ishtmlwordchar(static_cast<char>(sc.ch))) {
|
||||
} else if (ishtmlwordchar(sc.ch)) {
|
||||
sc.SetState(SCE_H_ATTRIBUTE);
|
||||
}
|
||||
}
|
||||
@ -1908,8 +1957,8 @@ static void ColouriseASPPiece(StyleContext &sc, WordList *keywordlists[]) {
|
||||
|
||||
static void ColouriseASPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
// Lexer for HTML requires more lexical states (7 bits worth) than most lexers
|
||||
StyleContext sc(startPos, length, initStyle, styler, 0x7f);
|
||||
// Lexer for HTML requires more lexical states (8 bits worth) than most lexers
|
||||
StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX));
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
ColouriseASPPiece(sc, keywordlists);
|
||||
}
|
||||
@ -1992,7 +2041,7 @@ static void ColourisePHPPiece(StyleContext &sc, WordList *keywordlists[]) {
|
||||
sc.SetState(SCE_HPHP_SIMPLESTRING);
|
||||
} else if (sc.ch == '$' && IsPhpWordStart(static_cast<char>(sc.chNext))) {
|
||||
sc.SetState(SCE_HPHP_VARIABLE);
|
||||
} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||
} else if (IsOperator(static_cast<char>(sc.ch))) {
|
||||
sc.SetState(SCE_HPHP_OPERATOR);
|
||||
}
|
||||
}
|
||||
@ -2000,8 +2049,8 @@ static void ColourisePHPPiece(StyleContext &sc, WordList *keywordlists[]) {
|
||||
|
||||
static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
// Lexer for HTML requires more lexical states (7 bits worth) than most lexers
|
||||
StyleContext sc(startPos, length, initStyle, styler, 0x7f);
|
||||
// Lexer for HTML requires more lexical states (8 bits worth) than most lexers
|
||||
StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX));
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
ColourisePHPPiece(sc, keywordlists);
|
||||
}
|
||||
@ -2011,7 +2060,7 @@ static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
static void ColourisePHPScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
if(startPos == 0) initStyle = SCE_HPHP_DEFAULT;
|
||||
ColouriseHyperTextDoc(startPos,length,initStyle,keywordlists,styler);
|
||||
ColouriseHTMLDoc(startPos,length,initStyle,keywordlists,styler);
|
||||
}
|
||||
|
||||
static const char * const htmlWordListDesc[] = {
|
||||
@ -2034,9 +2083,9 @@ static const char * const phpscriptWordListDesc[] = {
|
||||
0,
|
||||
};
|
||||
|
||||
LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext", 0, htmlWordListDesc, 7);
|
||||
LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml", 0, htmlWordListDesc, 7);
|
||||
LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8);
|
||||
LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8);
|
||||
// SCLEX_ASP and SCLEX_PHP should not be used in new code: use SCLEX_HTML instead.
|
||||
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 7);
|
||||
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 7);
|
||||
LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 7);
|
||||
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 8);
|
||||
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 8);
|
||||
LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8);
|
||||
|
@ -31,6 +31,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_AS_EXTERNAL_LEXER
|
||||
|
||||
#include "ExternalLexer.h"
|
||||
@ -85,12 +89,16 @@ static void ColorizeHaskellDoc(unsigned int startPos, int length, int initStyle,
|
||||
else if (sc.state == SCE_HA_STRING) {
|
||||
if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_HA_DEFAULT);
|
||||
} else if (sc.ch == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
}
|
||||
// Char
|
||||
else if (sc.state == SCE_HA_CHARACTER) {
|
||||
if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_HA_DEFAULT);
|
||||
} else if (sc.ch == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
}
|
||||
// Number
|
||||
@ -185,7 +193,7 @@ static void ColorizeHaskellDoc(unsigned int startPos, int length, int initStyle,
|
||||
sc.SetState(SCE_HA_STRING);
|
||||
}
|
||||
// Character
|
||||
else if (sc.Match('\'') && IsWhitespace(sc.GetRelative(-1)) ) {
|
||||
else if (sc.Match('\'')) {
|
||||
sc.SetState(SCE_HA_CHARACTER);
|
||||
}
|
||||
// Stringstart
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) {
|
||||
int state = SCE_INNO_DEFAULT;
|
||||
char chPrev;
|
||||
@ -172,14 +176,14 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
|
||||
case SCE_INNO_STRING_DOUBLE:
|
||||
if (ch == '"' || isEOL) {
|
||||
state = SCE_INNO_DEFAULT;
|
||||
styler.ColourTo(i,SCE_INNO_DEFAULT);
|
||||
styler.ColourTo(i,SCE_INNO_STRING_DOUBLE);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCE_INNO_STRING_SINGLE:
|
||||
if (ch == '\'' || isEOL) {
|
||||
state = SCE_INNO_DEFAULT;
|
||||
styler.ColourTo(i,SCE_INNO_DEFAULT);
|
||||
styler.ColourTo(i,SCE_INNO_STRING_SINGLE);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
// Extended to accept accented characters
|
||||
static inline bool IsAWordChar(int ch) {
|
||||
return ch >= 0x80 || isalnum(ch) || ch == '_';
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "SciLexer.h"
|
||||
#include "StyleContext.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#define SCE_LISP_CHARACTER 29
|
||||
#define SCE_LISP_MACRO 30
|
||||
#define SCE_LISP_MACRO_DISPATCH 31
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (ch < 0x80) && (isalpha(ch) || ch == '@' || ch == '_');
|
||||
}
|
||||
|
@ -22,6 +22,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
// Extended to accept accented characters
|
||||
static inline bool IsAWordChar(int ch) {
|
||||
return ch >= 0x80 ||
|
||||
@ -149,7 +153,10 @@ static void ColouriseLuaDoc(
|
||||
// We stop the number definition on non-numerical non-dot non-eE non-sign non-hexdigit char
|
||||
if (!IsANumberChar(sc.ch)) {
|
||||
sc.SetState(SCE_LUA_DEFAULT);
|
||||
}
|
||||
} else if (sc.ch == '-' || sc.ch == '+') {
|
||||
if (sc.chPrev != 'E' && sc.chPrev != 'e')
|
||||
sc.SetState(SCE_LUA_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_LUA_IDENTIFIER) {
|
||||
if (!IsAWordChar(sc.ch) || sc.Match('.', '.')) {
|
||||
char s[100];
|
||||
@ -166,8 +173,6 @@ static void ColouriseLuaDoc(
|
||||
sc.ChangeState(SCE_LUA_WORD5);
|
||||
} else if (keywords6.InList(s)) {
|
||||
sc.ChangeState(SCE_LUA_WORD6);
|
||||
} else if (keywords6.InList(s)) {
|
||||
sc.ChangeState(SCE_LUA_WORD6);
|
||||
} else if (keywords7.InList(s)) {
|
||||
sc.ChangeState(SCE_LUA_WORD7);
|
||||
} else if (keywords8.InList(s)) {
|
||||
|
@ -22,6 +22,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "SciLexer.h"
|
||||
#include "SString.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static int GetLotLineState(SString &line) {
|
||||
if (line.length()) {
|
||||
// Most of the time the first non-blank character in line determines that line's type
|
||||
|
@ -19,6 +19,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#define KW_MSSQL_STATEMENTS 0
|
||||
#define KW_MSSQL_DATA_TYPES 1
|
||||
#define KW_MSSQL_SYSTEM_TABLES 2
|
||||
@ -307,16 +311,16 @@ static void FoldMSSQLDoc(unsigned int startPos, int length, int, WordList *[], A
|
||||
inComment = (style == SCE_MSSQL_COMMENT);
|
||||
}
|
||||
if (style == SCE_MSSQL_STATEMENT) {
|
||||
// Folding between begin and end
|
||||
if (ch == 'b' || ch == 'e') {
|
||||
// Folding between begin or case and end
|
||||
if (ch == 'b' || ch == 'B' || ch == 'c' || ch == 'C' || ch == 'e' || ch == 'E') {
|
||||
for (unsigned int j = 0; j < 5; j++) {
|
||||
if (!iswordchar(styler[i + j])) {
|
||||
break;
|
||||
}
|
||||
s[j] = styler[i + j];
|
||||
s[j] = static_cast<char>(tolower(styler[i + j]));
|
||||
s[j + 1] = '\0';
|
||||
}
|
||||
if (strcmp(s, "begin") == 0) {
|
||||
if ((strcmp(s, "begin") == 0) || (strcmp(s, "case") == 0)) {
|
||||
levelCurrent++;
|
||||
}
|
||||
if (strcmp(s, "end") == 0) {
|
||||
|
@ -25,6 +25,9 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static bool IsMatlabCommentChar(int c) {
|
||||
return (c == '%') ;
|
||||
@ -100,11 +103,19 @@ static void ColouriseMatlabOctaveDoc(
|
||||
transpose = true;
|
||||
}
|
||||
} else if (sc.state == SCE_MATLAB_STRING) {
|
||||
if (sc.ch == '\'' && sc.chPrev != '\\') {
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) {
|
||||
if (sc.ch == '"' && sc.chPrev != '\\') {
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_MATLAB_COMMENT || sc.state == SCE_MATLAB_COMMAND) {
|
||||
@ -126,7 +137,7 @@ static void ColouriseMatlabOctaveDoc(
|
||||
sc.SetState(SCE_MATLAB_STRING);
|
||||
}
|
||||
} else if (sc.ch == '"') {
|
||||
sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING);
|
||||
sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING);
|
||||
} else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) {
|
||||
sc.SetState(SCE_MATLAB_NUMBER);
|
||||
} else if (isalpha(sc.ch)) {
|
||||
@ -148,17 +159,17 @@ 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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,
|
||||
WordList *[], Accessor &styler,
|
||||
bool (*IsComment)(Accessor&,int,int)) {
|
||||
WordList *[], Accessor &styler,
|
||||
bool (*IsComment)(Accessor&, int, int)) {
|
||||
|
||||
int endPos = startPos + length;
|
||||
|
||||
@ -202,12 +213,12 @@ static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,
|
||||
|
||||
static void FoldMatlabDoc(unsigned int startPos, int length, int initStyle,
|
||||
WordList *keywordlists[], Accessor &styler) {
|
||||
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment);
|
||||
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment);
|
||||
}
|
||||
|
||||
static void FoldOctaveDoc(unsigned int startPos, int length, int initStyle,
|
||||
WordList *keywordlists[], Accessor &styler) {
|
||||
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment);
|
||||
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment);
|
||||
}
|
||||
|
||||
static const char * const matlabWordListDesc[] = {
|
||||
|
@ -3,6 +3,8 @@
|
||||
// File: LexMetapost.cxx - general context conformant metapost coloring scheme
|
||||
// Author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com
|
||||
// Version: September 28, 2003
|
||||
// Modified by instanton: July 10, 2007
|
||||
// Folding based on keywordlists[]
|
||||
|
||||
// Copyright: 1998-2003 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
@ -25,6 +27,10 @@
|
||||
#include "SciLexer.h"
|
||||
#include "StyleContext.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
// val SCE_METAPOST_DEFAULT = 0
|
||||
// val SCE_METAPOST_SPECIAL = 1
|
||||
// val SCE_METAPOST_GROUP = 2
|
||||
@ -317,4 +323,77 @@ static const char * const metapostWordListDesc[] = {
|
||||
0
|
||||
} ;
|
||||
|
||||
LexerModule lmMETAPOST(SCLEX_METAPOST, ColouriseMETAPOSTDoc, "metapost", 0, metapostWordListDesc);
|
||||
static int classifyFoldPointMetapost(const char* s,WordList *keywordlists[]) {
|
||||
WordList& keywordsStart=*keywordlists[3];
|
||||
WordList& keywordsStop1=*keywordlists[4];
|
||||
|
||||
if (keywordsStart.InList(s)) {return 1;}
|
||||
else if (keywordsStop1.InList(s)) {return -1;}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static int ParseMetapostWord(unsigned int pos, Accessor &styler, char *word)
|
||||
{
|
||||
int length=0;
|
||||
char ch=styler.SafeGetCharAt(pos);
|
||||
*word=0;
|
||||
|
||||
while(isMETAPOSTidentifier(ch) && isalpha(ch) && length<100){
|
||||
word[length]=ch;
|
||||
length++;
|
||||
ch=styler.SafeGetCharAt(pos+length);
|
||||
}
|
||||
word[length]=0;
|
||||
return length;
|
||||
}
|
||||
|
||||
static void FoldMetapostDoc(unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler)
|
||||
{
|
||||
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];
|
||||
|
||||
char buffer[100]="";
|
||||
|
||||
for (unsigned int i=startPos; i < endPos; i++) {
|
||||
char ch=chNext;
|
||||
chNext=styler.SafeGetCharAt(i+1);
|
||||
char chPrev=styler.SafeGetCharAt(i-1);
|
||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||
|
||||
if(i==0 || chPrev == '\r' || chPrev=='\n'|| chPrev==' '|| chPrev=='(' || chPrev=='$')
|
||||
{
|
||||
ParseMetapostWord(i, styler, buffer);
|
||||
levelCurrent += classifyFoldPointMetapost(buffer,keywordlists);
|
||||
}
|
||||
|
||||
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 (!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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
LexerModule lmMETAPOST(SCLEX_METAPOST, ColouriseMETAPOSTDoc, "metapost", FoldMetapostDoc, metapostWordListDesc);
|
||||
|
@ -19,6 +19,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
/*
|
||||
// located in SciLexer.h
|
||||
#define SCLEX_NSIS 43
|
||||
@ -94,7 +98,7 @@ static bool NsisNextLineHasElse(unsigned int start, unsigned int end, Accessor &
|
||||
return false;
|
||||
}
|
||||
|
||||
static int NsisCmp( const char *s1, const char *s2, bool bIgnoreCase )
|
||||
static int NsisCmp( char *s1, char *s2, bool bIgnoreCase )
|
||||
{
|
||||
if( bIgnoreCase )
|
||||
return CompareCaseInsensitive( s1, s2);
|
||||
@ -120,7 +124,7 @@ static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel
|
||||
return foldlevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF &&
|
||||
style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_SECTIONGROUP &&
|
||||
style != SCE_NSIS_PAGEEX )
|
||||
@ -141,7 +145,7 @@ static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel
|
||||
|
||||
if( s[0] == '!' )
|
||||
{
|
||||
if( NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!macro", bIgnoreCase ) == 0 )
|
||||
if( NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!macro", bIgnoreCase ) == 0 )
|
||||
newFoldlevel++;
|
||||
else if( NsisCmp(s, "!endif", bIgnoreCase) == 0 || NsisCmp(s, "!macroend", bIgnoreCase ) == 0 )
|
||||
newFoldlevel--;
|
||||
@ -155,7 +159,7 @@ static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel
|
||||
else if( NsisCmp(s, "SectionGroupEnd", bIgnoreCase ) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase ) == 0 )
|
||||
newFoldlevel--;
|
||||
}
|
||||
|
||||
|
||||
return newFoldlevel;
|
||||
}
|
||||
|
||||
@ -195,6 +199,9 @@ static int classifyWordNsis(unsigned int start, unsigned int end, WordList *keyw
|
||||
if( NsisCmp(s, "!else", bIgnoreCase ) == 0 ) // || NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!endif", bIgnoreCase) == 0 )
|
||||
return SCE_NSIS_IFDEFINEDEF;
|
||||
|
||||
if( NsisCmp(s, "!if", bIgnoreCase ) == 0 )
|
||||
return SCE_NSIS_IFDEFINEDEF;
|
||||
|
||||
if( NsisCmp(s, "SectionGroup", bIgnoreCase) == 0 || NsisCmp(s, "SectionGroupEnd", bIgnoreCase) == 0 ) // Covers SectionGroup and SectionGroupEnd
|
||||
return SCE_NSIS_SECTIONGROUP;
|
||||
|
||||
|
@ -19,6 +19,10 @@
|
||||
#include "SciLexer.h"
|
||||
#include "StyleContext.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
inline static void getRange( unsigned int start, unsigned int end, Accessor & styler, char * s, unsigned int len )
|
||||
{
|
||||
unsigned int i = 0;
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static bool Is0To9(char ch) {
|
||||
return (ch >= '0') && (ch <= '9');
|
||||
}
|
||||
@ -125,7 +129,7 @@ static void ColouriseBatchLine(
|
||||
styler.ColourTo(startLine + offset + 1, SCE_BAT_IDENTIFIER);
|
||||
offset += 2;
|
||||
// Check for External Command / Program
|
||||
if (!isspacechar(lineBuffer[offset])) {
|
||||
if (offset < lengthLine && !isspacechar(lineBuffer[offset])) {
|
||||
cmdLoc = offset;
|
||||
}
|
||||
// Check for Environment Variable (%x...%)
|
||||
@ -136,7 +140,7 @@ static void ColouriseBatchLine(
|
||||
styler.ColourTo(startLine + offset, SCE_BAT_IDENTIFIER);
|
||||
offset++;
|
||||
// Check for External Command / Program
|
||||
if (!isspacechar(lineBuffer[offset])) {
|
||||
if (offset < lengthLine && !isspacechar(lineBuffer[offset])) {
|
||||
cmdLoc = offset;
|
||||
}
|
||||
}
|
||||
@ -371,6 +375,7 @@ static void ColouriseBatchLine(
|
||||
offset -= (wbl - wbo);
|
||||
// Check for Local Variable (%%a)
|
||||
} else if (
|
||||
(wbl > 2) &&
|
||||
(wordBuffer[1] == '%') &&
|
||||
(wordBuffer[2] != '%') &&
|
||||
(!IsBOperator(wordBuffer[2])) &&
|
||||
@ -473,6 +478,7 @@ static void ColouriseBatchDoc(
|
||||
}
|
||||
}
|
||||
if (linePos > 0) { // Last line does not have ending characters
|
||||
lineBuffer[linePos] = '\0';
|
||||
ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1,
|
||||
keywordlists, styler);
|
||||
}
|
||||
@ -720,6 +726,12 @@ static void ColouriseMakeLine(
|
||||
int lastNonSpace = -1;
|
||||
unsigned int state = SCE_MAKE_DEFAULT;
|
||||
bool bSpecial = false;
|
||||
|
||||
// check for a tab character in column 0 indicating a command
|
||||
bool bCommand = false;
|
||||
if ((lengthLine > 0) && (lineBuffer[0] == '\t'))
|
||||
bCommand = true;
|
||||
|
||||
// Skip initial spaces
|
||||
while ((i < lengthLine) && isspacechar(lineBuffer[i])) {
|
||||
i++;
|
||||
@ -740,14 +752,24 @@ static void ColouriseMakeLine(
|
||||
styler.ColourTo(startLine + i, state);
|
||||
state = SCE_MAKE_DEFAULT;
|
||||
}
|
||||
if (!bSpecial) {
|
||||
|
||||
// skip identifier and target styling if this is a command line
|
||||
if (!bSpecial && !bCommand) {
|
||||
if (lineBuffer[i] == ':') {
|
||||
// We should check that no colouring was made since the beginning of the line,
|
||||
// to avoid colouring stuff like /OUT:file
|
||||
if (lastNonSpace >= 0)
|
||||
styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_TARGET);
|
||||
styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT);
|
||||
styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR);
|
||||
if (((i + 1) < lengthLine) && (lineBuffer[i + 1] == '=')) {
|
||||
// it's a ':=', so style as an identifier
|
||||
if (lastNonSpace >= 0)
|
||||
styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER);
|
||||
styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT);
|
||||
styler.ColourTo(startLine + i + 1, SCE_MAKE_OPERATOR);
|
||||
} else {
|
||||
// We should check that no colouring was made since the beginning of the line,
|
||||
// to avoid colouring stuff like /OUT:file
|
||||
if (lastNonSpace >= 0)
|
||||
styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_TARGET);
|
||||
styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT);
|
||||
styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR);
|
||||
}
|
||||
bSpecial = true; // Only react to the first ':' of the line
|
||||
state = SCE_MAKE_DEFAULT;
|
||||
} else if (lineBuffer[i] == '=') {
|
||||
@ -796,7 +818,7 @@ static bool strstart(const char *haystack, const char *needle) {
|
||||
return strncmp(haystack, needle, strlen(needle)) == 0;
|
||||
}
|
||||
|
||||
static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine) {
|
||||
static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine, int &startValue) {
|
||||
if (lineBuffer[0] == '>') {
|
||||
// Command or return status
|
||||
return SCE_ERR_CMD;
|
||||
@ -879,7 +901,9 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
|
||||
// Microsoft: <filename>(<line>,<column>)<message>
|
||||
// CTags: \t<message>
|
||||
// Lua 5 traceback: \t<filename>:<line>:<message>
|
||||
// Lua 5.1: <exe>: <filename>:<line>:<message>
|
||||
bool initialTab = (lineBuffer[0] == '\t');
|
||||
bool initialColonPart = false;
|
||||
enum { stInitial,
|
||||
stGccStart, stGccDigit, stGcc,
|
||||
stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet,
|
||||
@ -894,10 +918,12 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
|
||||
if (state == stInitial) {
|
||||
if (ch == ':') {
|
||||
// May be GCC, or might be Lua 5 (Lua traceback same but with tab prefix)
|
||||
if ((chNext != '\\') && (chNext != '/')) {
|
||||
if ((chNext != '\\') && (chNext != '/') && (chNext != ' ')) {
|
||||
// This check is not completely accurate as may be on
|
||||
// GTK+ with a file name that includes ':'.
|
||||
state = stGccStart;
|
||||
state = stGccStart;
|
||||
} else if (chNext == ' ') { // indicates a Lua 5.1 error message
|
||||
initialColonPart = true;
|
||||
}
|
||||
} else if ((ch == '(') && Is1To9(chNext) && (!initialTab)) {
|
||||
// May be Microsoft
|
||||
@ -912,6 +938,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
|
||||
} else if (state == stGccDigit) { // <filename>:<line>
|
||||
if (ch == ':') {
|
||||
state = stGcc; // :9.*: is GCC
|
||||
startValue = i + 1;
|
||||
break;
|
||||
} else if (!Is0To9(ch)) {
|
||||
state = stUnrecognized;
|
||||
@ -972,7 +999,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
|
||||
}
|
||||
}
|
||||
if (state == stGcc) {
|
||||
return SCE_ERR_GCC;
|
||||
return initialColonPart ? SCE_ERR_LUA : SCE_ERR_GCC;
|
||||
} else if ((state == stMsVc) || (state == stMsDotNet)) {
|
||||
return SCE_ERR_MS;
|
||||
} else if ((state == stCtagsStringDollar) || (state == stCtags)) {
|
||||
@ -987,8 +1014,16 @@ static void ColouriseErrorListLine(
|
||||
char *lineBuffer,
|
||||
unsigned int lengthLine,
|
||||
unsigned int endPos,
|
||||
Accessor &styler) {
|
||||
styler.ColourTo(endPos, RecogniseErrorListLine(lineBuffer, lengthLine));
|
||||
Accessor &styler,
|
||||
bool valueSeparate) {
|
||||
int startValue = -1;
|
||||
int style = RecogniseErrorListLine(lineBuffer, lengthLine, startValue);
|
||||
if (valueSeparate && (startValue >= 0)) {
|
||||
styler.ColourTo(endPos - (lengthLine - startValue), style);
|
||||
styler.ColourTo(endPos, SCE_ERR_VALUE);
|
||||
} else {
|
||||
styler.ColourTo(endPos, style);
|
||||
}
|
||||
}
|
||||
|
||||
static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
|
||||
@ -996,17 +1031,18 @@ static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordLi
|
||||
styler.StartAt(startPos);
|
||||
styler.StartSegment(startPos);
|
||||
unsigned int linePos = 0;
|
||||
bool valueSeparate = styler.GetPropertyInt("lexer.errorlist.value.separate", 0) != 0;
|
||||
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';
|
||||
ColouriseErrorListLine(lineBuffer, linePos, i, styler);
|
||||
ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate);
|
||||
linePos = 0;
|
||||
}
|
||||
}
|
||||
if (linePos > 0) { // Last line does not have ending characters
|
||||
ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler);
|
||||
ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsTypeCharacter(const int ch)
|
||||
{
|
||||
return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$' || ch == '?';
|
||||
|
198
src/stc/scintilla/src/LexPLM.cxx
Normal file
198
src/stc/scintilla/src/LexPLM.cxx
Normal file
@ -0,0 +1,198 @@
|
||||
// Copyright (c) 1990-2007, Scientific Toolworks, Inc.
|
||||
// Author: Jason Haslam
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
#include "StyleContext.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static void GetRange(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>(tolower(styler[start + i]));
|
||||
i++;
|
||||
}
|
||||
s[i] = '\0';
|
||||
}
|
||||
|
||||
static void ColourisePlmDoc(unsigned int startPos,
|
||||
int length,
|
||||
int initStyle,
|
||||
WordList *keywordlists[],
|
||||
Accessor &styler)
|
||||
{
|
||||
unsigned int endPos = startPos + length;
|
||||
int state = initStyle;
|
||||
|
||||
styler.StartAt(startPos);
|
||||
styler.StartSegment(startPos);
|
||||
|
||||
for (unsigned int i = startPos; i < endPos; i++) {
|
||||
char ch = styler.SafeGetCharAt(i);
|
||||
char chNext = styler.SafeGetCharAt(i + 1);
|
||||
|
||||
if (state == SCE_PLM_DEFAULT) {
|
||||
if (ch == '/' && chNext == '*') {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_COMMENT;
|
||||
} else if (ch == '\'') {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_STRING;
|
||||
} else if (isdigit(ch)) {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_NUMBER;
|
||||
} else if (isalpha(ch)) {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_IDENTIFIER;
|
||||
} else if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
|
||||
ch == '=' || ch == '<' || ch == '>' || ch == ':') {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_OPERATOR;
|
||||
} else if (ch == '$') {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_CONTROL;
|
||||
}
|
||||
} else if (state == SCE_PLM_COMMENT) {
|
||||
if (ch == '*' && chNext == '/') {
|
||||
i++;
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PLM_DEFAULT;
|
||||
}
|
||||
} else if (state == SCE_PLM_STRING) {
|
||||
if (ch == '\'') {
|
||||
if (chNext == '\'') {
|
||||
i++;
|
||||
} else {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PLM_DEFAULT;
|
||||
}
|
||||
}
|
||||
} else if (state == SCE_PLM_NUMBER) {
|
||||
if (!isdigit(ch) && !isalpha(ch) && ch != '$') {
|
||||
i--;
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PLM_DEFAULT;
|
||||
}
|
||||
} else if (state == SCE_PLM_IDENTIFIER) {
|
||||
if (!isdigit(ch) && !isalpha(ch) && ch != '$') {
|
||||
// Get the entire identifier.
|
||||
char word[1024];
|
||||
int segmentStart = styler.GetStartSegment();
|
||||
GetRange(segmentStart, i - 1, styler, word, sizeof(word));
|
||||
|
||||
i--;
|
||||
if (keywordlists[0]->InList(word))
|
||||
styler.ColourTo(i, SCE_PLM_KEYWORD);
|
||||
else
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PLM_DEFAULT;
|
||||
}
|
||||
} else if (state == SCE_PLM_OPERATOR) {
|
||||
if (ch != '=' && ch != '>') {
|
||||
i--;
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PLM_DEFAULT;
|
||||
}
|
||||
} else if (state == SCE_PLM_CONTROL) {
|
||||
if (ch == '\r' || ch == '\n') {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PLM_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
styler.ColourTo(endPos - 1, state);
|
||||
}
|
||||
|
||||
static void FoldPlmDoc(unsigned int startPos,
|
||||
int length,
|
||||
int initStyle,
|
||||
WordList *[],
|
||||
Accessor &styler)
|
||||
{
|
||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 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 startKeyword = 0;
|
||||
|
||||
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_PLM_KEYWORD && style == SCE_PLM_KEYWORD)
|
||||
startKeyword = i;
|
||||
|
||||
if (style == SCE_PLM_KEYWORD && styleNext != SCE_PLM_KEYWORD) {
|
||||
char word[1024];
|
||||
GetRange(startKeyword, i, styler, word, sizeof(word));
|
||||
|
||||
if (strcmp(word, "procedure") == 0 || strcmp(word, "do") == 0)
|
||||
levelCurrent++;
|
||||
else if (strcmp(word, "end") == 0)
|
||||
levelCurrent--;
|
||||
}
|
||||
|
||||
if (foldComment) {
|
||||
if (stylePrev != SCE_PLM_COMMENT && style == SCE_PLM_COMMENT)
|
||||
levelCurrent++;
|
||||
else if (stylePrev == SCE_PLM_COMMENT && style != SCE_PLM_COMMENT)
|
||||
levelCurrent--;
|
||||
}
|
||||
|
||||
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 (!isspacechar(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
|
||||
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
|
||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||
}
|
||||
|
||||
static const char *const plmWordListDesc[] = {
|
||||
"Keywords",
|
||||
0
|
||||
};
|
||||
|
||||
LexerModule lmPLM(SCLEX_PLM, ColourisePlmDoc, "PL/M", FoldPlmDoc, plmWordListDesc);
|
@ -29,6 +29,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(int ch) {
|
||||
return ch < 0x80 && (isalnum(ch) || ch == '_');
|
||||
}
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsASelfDelimitingChar(const int ch) {
|
||||
return (ch == '[' || ch == ']' || ch == '{' || ch == '}' ||
|
||||
ch == '/' || ch == '<' || ch == '>' ||
|
||||
@ -103,7 +107,7 @@ static void ColourisePSDoc(
|
||||
sc.SetState(SCE_C_DEFAULT);
|
||||
} else if (sc.atLineEnd) {
|
||||
sc.SetState(SCE_C_DEFAULT);
|
||||
} else if (IsAWhitespaceChar(sc.ch)) {
|
||||
} else if (IsAWhitespaceChar(sc.ch) && sc.ch != '\r') {
|
||||
sc.ChangeState(SCE_PS_COMMENT);
|
||||
}
|
||||
} else if (sc.state == SCE_PS_NUMBER) {
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "SciLexer.h"
|
||||
#include "StyleContext.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static void getRange(unsigned int start,
|
||||
unsigned int end,
|
||||
Accessor &styler,
|
||||
@ -289,7 +293,7 @@ static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, Word
|
||||
styleNext = styler.StyleAt(i + 1);
|
||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||
|
||||
if (stylePrev == SCE_C_DEFAULT && style == SCE_C_WORD)
|
||||
if (stylePrev != SCE_C_WORD && style == SCE_C_WORD)
|
||||
{
|
||||
// Store last word start point.
|
||||
lastStart = i;
|
||||
|
@ -2,7 +2,7 @@
|
||||
/** @file LexPerl.cxx
|
||||
** Lexer for subset of Perl.
|
||||
**/
|
||||
// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Lexical analysis fixes by Kein-Hong Man <mkh@pl.jaring.my>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
@ -20,6 +20,10 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
#define PERLNUM_BINARY 1 // order is significant: 1-4 cannot have a dot
|
||||
#define PERLNUM_HEX 2
|
||||
#define PERLNUM_OCTAL 3
|
||||
@ -68,14 +72,22 @@ static bool isPerlKeyword(unsigned int start, unsigned int end, WordList &keywor
|
||||
return keywords.InList(s);
|
||||
}
|
||||
|
||||
// Note: as lexer uses chars, UTF-8 bytes are considered as <0 values
|
||||
// Note: iswordchar() was used in only one place in LexPerl, it is
|
||||
// unnecessary as '.' is processed as the concatenation operator, so
|
||||
// only isWordStart() is used in LexPerl
|
||||
|
||||
static inline bool isWordStart(char ch) {
|
||||
return !isascii(ch) || isalnum(ch) || ch == '_';
|
||||
}
|
||||
|
||||
static inline bool isEndVar(char ch) {
|
||||
return !isalnum(ch) && ch != '#' && ch != '$' &&
|
||||
return isascii(ch) && !isalnum(ch) && ch != '#' && ch != '$' &&
|
||||
ch != '_' && ch != '\'';
|
||||
}
|
||||
|
||||
|
||||
static inline bool isNonQuote(char ch) {
|
||||
return isalnum(ch) || ch == '_';
|
||||
return !isascii(ch) || isalnum(ch) || ch == '_';
|
||||
}
|
||||
|
||||
static inline char actualNumStyle(int numberStyle) {
|
||||
@ -121,6 +133,10 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
|
||||
WordList &keywords = *keywordlists[0];
|
||||
|
||||
// keywords that forces /PATTERN/ at all times
|
||||
WordList reWords;
|
||||
reWords.Set("elsif if split while");
|
||||
|
||||
class HereDocCls {
|
||||
public:
|
||||
int State; // 0: '<<' encountered
|
||||
@ -175,6 +191,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
//char sooked[100];
|
||||
//sooked[sookedpos] = '\0';
|
||||
|
||||
styler.StartAt(startPos, static_cast<char>(STYLE_MAX));
|
||||
// If in a long distance lexical state, seek to the beginning to find quote characters
|
||||
// Perl strings can be multi-line with embedded newlines, so backtrack.
|
||||
// Perl numbers have additional state during lexing, so backtrack too.
|
||||
@ -185,6 +202,14 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
startPos = styler.LineStart(styler.GetLine(startPos));
|
||||
state = styler.StyleAt(startPos - 1);
|
||||
}
|
||||
// Backtrack for format body.
|
||||
if (state == SCE_PL_FORMAT) {
|
||||
while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_PL_FORMAT_IDENT)) {
|
||||
startPos--;
|
||||
}
|
||||
startPos = styler.LineStart(styler.GetLine(startPos));
|
||||
state = styler.StyleAt(startPos - 1);
|
||||
}
|
||||
if ( state == SCE_PL_STRING_Q
|
||||
|| state == SCE_PL_STRING_QQ
|
||||
|| state == SCE_PL_STRING_QX
|
||||
@ -198,6 +223,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
|| state == SCE_PL_NUMBER
|
||||
|| state == SCE_PL_IDENTIFIER
|
||||
|| state == SCE_PL_ERROR
|
||||
|| state == SCE_PL_SUB_PROTOTYPE
|
||||
) {
|
||||
while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) {
|
||||
startPos--;
|
||||
@ -221,7 +247,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
backflag = BACK_KEYWORD;
|
||||
}
|
||||
|
||||
styler.StartAt(startPos);
|
||||
styler.StartAt(startPos, static_cast<char>(STYLE_MAX));
|
||||
char chPrev = styler.SafeGetCharAt(startPos - 1);
|
||||
if (startPos == 0)
|
||||
chPrev = '\n';
|
||||
@ -282,9 +308,15 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (HereDoc.State == 4 && isEOLChar(ch)) {
|
||||
// Start of format body.
|
||||
HereDoc.State = 0;
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_PL_FORMAT;
|
||||
}
|
||||
|
||||
if (state == SCE_PL_DEFAULT) {
|
||||
if (isdigit(ch) || (isdigit(chNext) &&
|
||||
if ((isascii(ch) && isdigit(ch)) || (isascii(chNext) && isdigit(chNext) &&
|
||||
(ch == '.' || ch == 'v'))) {
|
||||
state = SCE_PL_NUMBER;
|
||||
backflag = BACK_NONE;
|
||||
@ -295,7 +327,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
numState = PERLNUM_HEX;
|
||||
} else if (chNext == 'b') {
|
||||
numState = PERLNUM_BINARY;
|
||||
} else if (isdigit(chNext)) {
|
||||
} else if (isascii(chNext) && isdigit(chNext)) {
|
||||
numState = PERLNUM_OCTAL;
|
||||
}
|
||||
if (numState != PERLNUM_DECIMAL) {
|
||||
@ -306,7 +338,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
} else if (ch == 'v') { // vector
|
||||
numState = PERLNUM_V_VECTOR;
|
||||
}
|
||||
} else if (iswordstart(ch)) {
|
||||
} else if (isWordStart(ch)) {
|
||||
// if immediately prefixed by '::', always a bareword
|
||||
state = SCE_PL_WORD;
|
||||
if (chPrev == ':' && styler.SafeGetCharAt(i - 2) == ':') {
|
||||
@ -338,7 +370,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
Quote.New(1);
|
||||
kw++;
|
||||
} else if (ch == 'x' && (chNext == '=' || // repetition
|
||||
(chNext != '_' && !isalnum(chNext)) ||
|
||||
!isWordStart(chNext) ||
|
||||
(isdigit(chPrev) && isdigit(chNext)))) {
|
||||
state = SCE_PL_OPERATOR;
|
||||
}
|
||||
@ -347,7 +379,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
// otherwise it is always a bareword and we skip a lot of scanning
|
||||
// note: keywords assumed to be limited to [_a-zA-Z] only
|
||||
if (state == SCE_PL_WORD) {
|
||||
while (iswordstart(styler.SafeGetCharAt(kw))) kw++;
|
||||
while (isWordStart(styler.SafeGetCharAt(kw))) kw++;
|
||||
if (!isPerlKeyword(styler.GetStartSegment(), kw, keywords, styler)) {
|
||||
state = SCE_PL_IDENTIFIER;
|
||||
}
|
||||
@ -371,7 +403,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
if (ch2 == '{' && !moreback) {
|
||||
// {bareword: possible variable spec
|
||||
brace = true;
|
||||
} else if ((ch2 == '&')
|
||||
} else if ((ch2 == '&' && styler.SafeGetCharAt(j - 1) != '&')
|
||||
// &bareword: subroutine call
|
||||
|| (ch2 == '>' && styler.SafeGetCharAt(j - 1) == '-')
|
||||
// ->bareword: part of variable spec
|
||||
@ -403,7 +435,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
backflag = BACK_NONE;
|
||||
// an identifier or bareword
|
||||
if (state == SCE_PL_IDENTIFIER) {
|
||||
if ((!iswordchar(chNext) && chNext != '\'')
|
||||
if ((!isWordStart(chNext) && chNext != '\'')
|
||||
|| (chNext == '.' && chNext2 == '.')) {
|
||||
// We need that if length of word == 1!
|
||||
// This test is copied from the SCE_PL_WORD handler.
|
||||
@ -419,8 +451,13 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
styler.ColourTo(i, SCE_PL_DATASECTION);
|
||||
state = SCE_PL_DATASECTION;
|
||||
} else {
|
||||
if (isMatch(styler, lengthDoc, styler.GetStartSegment(), "format")) {
|
||||
state = SCE_PL_FORMAT_IDENT;
|
||||
HereDoc.State = 0;
|
||||
} else {
|
||||
state = SCE_PL_DEFAULT;
|
||||
}
|
||||
styler.ColourTo(i, SCE_PL_WORD);
|
||||
state = SCE_PL_DEFAULT;
|
||||
backflag = BACK_KEYWORD;
|
||||
backPos = i;
|
||||
}
|
||||
@ -428,8 +465,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
// a repetition operator 'x'
|
||||
} else if (state == SCE_PL_OPERATOR) {
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
state = SCE_PL_DEFAULT;
|
||||
goto handleOperator;
|
||||
// quote-like delimiter, skip one char if double-char delimiter
|
||||
} else {
|
||||
i = kw - 1;
|
||||
@ -462,7 +499,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
styler.ColourTo(i, SCE_PL_SCALAR);
|
||||
} else {
|
||||
state = SCE_PL_SCALAR;
|
||||
if (chNext == '`' && chNext2 == '`') {
|
||||
if ((chNext == '`' && chNext2 == '`')
|
||||
|| (chNext == ':' && chNext2 == ':')) {
|
||||
i += 2;
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
@ -474,9 +512,14 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '@') {
|
||||
if (isalpha(chNext) || chNext == '#' || chNext == '$'
|
||||
if (!isascii(chNext) || isalpha(chNext) || chNext == '#' || chNext == '$'
|
||||
|| chNext == '_' || chNext == '+' || chNext == '-') {
|
||||
state = SCE_PL_ARRAY;
|
||||
} else if (chNext == ':' && chNext2 == ':') {
|
||||
state = SCE_PL_ARRAY;
|
||||
i += 2;
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
} else if (chNext != '{' && chNext != '[') {
|
||||
styler.ColourTo(i, SCE_PL_ARRAY);
|
||||
} else {
|
||||
@ -484,24 +527,35 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '%') {
|
||||
if (isalpha(chNext) || chNext == '#' || chNext == '$'
|
||||
backflag = BACK_NONE;
|
||||
if (!isascii(chNext) || isalpha(chNext) || chNext == '#' || chNext == '$'
|
||||
|| chNext == '_' || chNext == '!' || chNext == '^') {
|
||||
state = SCE_PL_HASH;
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
} else if (chNext == ':' && chNext2 == ':') {
|
||||
state = SCE_PL_HASH;
|
||||
i += 2;
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
} else if (chNext == '{') {
|
||||
styler.ColourTo(i, SCE_PL_HASH);
|
||||
} else {
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
goto handleOperator;
|
||||
}
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '*') {
|
||||
backflag = BACK_NONE;
|
||||
char strch[2];
|
||||
strch[0] = chNext;
|
||||
strch[1] = '\0';
|
||||
if (isalpha(chNext) || chNext == '_' ||
|
||||
NULL != strstr("^/|,\\\";#%^:?<>)[]", strch)) {
|
||||
if (chNext == ':' && chNext2 == ':') {
|
||||
state = SCE_PL_SYMBOLTABLE;
|
||||
i += 2;
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
} else if (!isascii(chNext) || isalpha(chNext) || chNext == '_'
|
||||
|| NULL != strstr("^/|,\\\";#%^:?<>)[]", strch)) {
|
||||
state = SCE_PL_SYMBOLTABLE;
|
||||
i++;
|
||||
ch = chNext;
|
||||
@ -514,9 +568,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
}
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
goto handleOperator;
|
||||
}
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '/' || (ch == '<' && chNext == '<')) {
|
||||
// Explicit backward peeking to set a consistent preferRE for
|
||||
// any slash found, so no longer need to track preferRE state.
|
||||
@ -528,6 +581,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
bool hereDocSpace = false; // these are for corner case:
|
||||
bool hereDocScalar = false; // SCALAR [whitespace] '<<'
|
||||
unsigned int bk = (i > 0)? i - 1: 0;
|
||||
unsigned int bkend;
|
||||
char bkch;
|
||||
styler.Flush();
|
||||
if (styler.StyleAt(bk) == SCE_PL_DEFAULT)
|
||||
@ -603,26 +657,21 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
if (bkstyle == SCE_PL_DEFAULT ||
|
||||
bkstyle == SCE_PL_COMMENTLINE) {
|
||||
} else if (bkstyle == SCE_PL_OPERATOR) {
|
||||
// gcc 3.2.3 bloats if more compact form used
|
||||
bkch = styler.SafeGetCharAt(bk);
|
||||
if (bkch == '>') { // "->"
|
||||
if (styler.SafeGetCharAt(bk - 1) == '-') {
|
||||
preferRE = false;
|
||||
break;
|
||||
}
|
||||
} else if (bkch == ':') { // "::"
|
||||
if (styler.SafeGetCharAt(bk - 1) == ':') {
|
||||
preferRE = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {// bare identifier, usually a function call but Perl
|
||||
// optimizes them as pseudo-constants, then the next
|
||||
// '/' will be a divide; favour divide over regex
|
||||
// if there is a whitespace after the '/'
|
||||
if (isspacechar(chNext)) {
|
||||
preferRE = false;
|
||||
// test for "->" and "::"
|
||||
if ((bkch == '>' && styler.SafeGetCharAt(bk - 1) == '-')
|
||||
|| (bkch == ':' && styler.SafeGetCharAt(bk - 1) == ':')) {
|
||||
preferRE = false;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// bare identifier, if '/', /PATTERN/ unless digit/space immediately after '/'
|
||||
if (!isHereDoc &&
|
||||
(isspacechar(chNext) || isdigit(chNext)))
|
||||
preferRE = false;
|
||||
// HERE docs cannot have a space after the >>
|
||||
if (isspacechar(chNext))
|
||||
preferRE = false;
|
||||
break;
|
||||
}
|
||||
bk--;
|
||||
@ -631,8 +680,24 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
case SCE_PL_SCALAR: // for $var<< case
|
||||
hereDocScalar = true;
|
||||
break;
|
||||
// other styles uses the default, preferRE=false
|
||||
// for HERE docs, always true for preferRE
|
||||
case SCE_PL_WORD:
|
||||
preferRE = true;
|
||||
if (isHereDoc)
|
||||
break;
|
||||
// adopt heuristics similar to vim-style rules:
|
||||
// keywords always forced as /PATTERN/: split, if, elsif, while
|
||||
// everything else /PATTERN/ unless digit/space immediately after '/'
|
||||
bkend = bk + 1;
|
||||
while (bk > 0 && styler.StyleAt(bk-1) == SCE_PL_WORD) {
|
||||
bk--;
|
||||
}
|
||||
if (isPerlKeyword(bk, bkend, reWords, styler))
|
||||
break;
|
||||
if (isspacechar(chNext) || isdigit(chNext))
|
||||
preferRE = false;
|
||||
break;
|
||||
// other styles uses the default, preferRE=false
|
||||
case SCE_PL_POD:
|
||||
case SCE_PL_POD_VERB:
|
||||
case SCE_PL_HERE_Q:
|
||||
@ -642,6 +707,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
break;
|
||||
}
|
||||
}
|
||||
backflag = BACK_NONE;
|
||||
if (isHereDoc) { // handle HERE doc
|
||||
// if SCALAR whitespace '<<', *always* a HERE doc
|
||||
if (preferRE || (hereDocSpace && hereDocScalar)) {
|
||||
@ -651,7 +717,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
goto handleOperator;
|
||||
}
|
||||
} else { // handle regexp
|
||||
if (preferRE) {
|
||||
@ -659,10 +725,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
Quote.New(1);
|
||||
Quote.Open(ch);
|
||||
} else { // / operator
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
goto handleOperator;
|
||||
}
|
||||
}
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '<') {
|
||||
// looks forward for matching > on same line
|
||||
unsigned int fw = i + 1;
|
||||
@ -671,24 +736,23 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
if (fwch == ' ') {
|
||||
if (styler.SafeGetCharAt(fw-1) != '\\' ||
|
||||
styler.SafeGetCharAt(fw-2) != '\\')
|
||||
break;
|
||||
goto handleOperator;
|
||||
} else if (isEOLChar(fwch) || isspacechar(fwch)) {
|
||||
break;
|
||||
goto handleOperator;
|
||||
} else if (fwch == '>') {
|
||||
if ((fw - i) == 2 && // '<=>' case
|
||||
styler.SafeGetCharAt(fw-1) == '=') {
|
||||
styler.ColourTo(fw, SCE_PL_OPERATOR);
|
||||
} else {
|
||||
styler.ColourTo(fw, SCE_PL_IDENTIFIER);
|
||||
goto handleOperator;
|
||||
}
|
||||
styler.ColourTo(fw, SCE_PL_IDENTIFIER);
|
||||
i = fw;
|
||||
ch = fwch;
|
||||
chNext = styler.SafeGetCharAt(i+1);
|
||||
}
|
||||
fw++;
|
||||
}
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
backflag = BACK_NONE;
|
||||
if (fw == lengthDoc)
|
||||
goto handleOperator;
|
||||
} else if (ch == '=' // POD
|
||||
&& isalpha(chNext)
|
||||
&& (isEOLChar(chPrev))) {
|
||||
@ -705,6 +769,35 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '-' // bareword promotion (-FOO cases)
|
||||
&& ((isascii(chNext) && isalpha(chNext)) || chNext == '_')
|
||||
&& backflag != BACK_NONE) {
|
||||
state = SCE_PL_IDENTIFIER;
|
||||
backflag = BACK_NONE;
|
||||
} else if (ch == '(' && i > 0) {
|
||||
// backtrack to identify if we're starting a sub prototype
|
||||
// for generality, we need to ignore whitespace/comments
|
||||
unsigned int bk = i - 1; // i > 0 tested above
|
||||
styler.Flush();
|
||||
while (bk > 0 && (styler.StyleAt(bk) == SCE_PL_DEFAULT ||
|
||||
styler.StyleAt(bk) == SCE_PL_COMMENTLINE)) {
|
||||
bk--;
|
||||
}
|
||||
if (bk == 0 || styler.StyleAt(bk) != SCE_PL_IDENTIFIER) // check identifier
|
||||
goto handleOperator;
|
||||
while (bk > 0 && (styler.StyleAt(bk) == SCE_PL_IDENTIFIER)) {
|
||||
bk--;
|
||||
}
|
||||
while (bk > 0 && (styler.StyleAt(bk) == SCE_PL_DEFAULT ||
|
||||
styler.StyleAt(bk) == SCE_PL_COMMENTLINE)) {
|
||||
bk--;
|
||||
}
|
||||
if (bk < 2 || styler.StyleAt(bk) != SCE_PL_WORD // check "sub" keyword
|
||||
|| !styler.Match(bk - 2, "sub")) // assume suffix is unique!
|
||||
goto handleOperator;
|
||||
state = SCE_PL_SUB_PROTOTYPE;
|
||||
backflag = BACK_NONE;
|
||||
backPos = i; // needed for restart
|
||||
} else if (isPerlOperator(ch)) {
|
||||
if (ch == '.' && chNext == '.') { // .. and ...
|
||||
i++;
|
||||
@ -713,10 +806,14 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
handleOperator:
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
backflag = BACK_OPERATOR;
|
||||
backPos = i;
|
||||
} else {
|
||||
} else if (ch == 4 || ch == 26) { // ^D and ^Z ends valid perl source
|
||||
styler.ColourTo(i, SCE_PL_DATASECTION);
|
||||
state = SCE_PL_DATASECTION;
|
||||
} else {
|
||||
// keep colouring defaults to make restart easier
|
||||
styler.ColourTo(i, SCE_PL_DEFAULT);
|
||||
}
|
||||
@ -728,8 +825,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
} else if (numState <= PERLNUM_FLOAT) {
|
||||
// non-decimal number or float exponent, consume next dot
|
||||
styler.ColourTo(i - 1, SCE_PL_NUMBER);
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
state = SCE_PL_DEFAULT;
|
||||
goto handleOperator;
|
||||
} else { // decimal or vectors allows dots
|
||||
dotCount++;
|
||||
if (numState == PERLNUM_DECIMAL) {
|
||||
@ -744,13 +841,11 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
goto numAtEnd;
|
||||
}
|
||||
}
|
||||
} else if (ch == '_' && numState == PERLNUM_DECIMAL) {
|
||||
if (!isdigit(chNext)) {
|
||||
goto numAtEnd;
|
||||
}
|
||||
} else if (isalnum(ch)) {
|
||||
} else if (ch == '_') {
|
||||
// permissive underscoring for number and vector literals
|
||||
} else if (!isascii(ch) || isalnum(ch)) {
|
||||
if (numState == PERLNUM_VECTOR || numState == PERLNUM_V_VECTOR) {
|
||||
if (isalpha(ch)) {
|
||||
if (!isascii(ch) || isalpha(ch)) {
|
||||
if (dotCount == 0) { // change to word
|
||||
state = SCE_PL_IDENTIFIER;
|
||||
} else { // vector then word
|
||||
@ -765,7 +860,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
}
|
||||
} else if (!isdigit(ch)) { // number then word
|
||||
} else if (!isascii(ch) || !isdigit(ch)) { // number then word
|
||||
goto numAtEnd;
|
||||
}
|
||||
} else if (numState == PERLNUM_FLOAT) {
|
||||
@ -798,7 +893,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
goto restartLexer;
|
||||
}
|
||||
} else if (state == SCE_PL_IDENTIFIER) {
|
||||
if (!iswordstart(chNext) && chNext != '\'') {
|
||||
if (!isWordStart(chNext) && chNext != '\'') {
|
||||
styler.ColourTo(i, SCE_PL_IDENTIFIER);
|
||||
state = SCE_PL_DEFAULT;
|
||||
ch = ' ';
|
||||
@ -871,6 +966,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
i = oldi;
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
state = SCE_PL_DEFAULT;
|
||||
backflag = BACK_OPERATOR;
|
||||
backPos = i;
|
||||
HereDoc.State = 0;
|
||||
goto restartLexer;
|
||||
} else {
|
||||
@ -994,7 +1091,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
} else if (ch == Quote.Up /*&& chPrev != '\\'*/) {
|
||||
Quote.Count++;
|
||||
} else if (!isalpha(chNext)) {
|
||||
} else if (!isascii(chNext) || !isalpha(chNext)) {
|
||||
if (Quote.Rep <= 0) {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PL_DEFAULT;
|
||||
@ -1028,7 +1125,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
if (isspacechar(ch)) {
|
||||
// Keep going
|
||||
}
|
||||
else if (isalnum(ch)) {
|
||||
else if (!isascii(ch) || isalnum(ch)) {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PL_DEFAULT;
|
||||
ch = ' ';
|
||||
@ -1040,7 +1137,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
if (Quote.Count == 0) {
|
||||
Quote.Rep--;
|
||||
}
|
||||
if (!isalpha(chNext)) {
|
||||
if (!isascii(chNext) || !isalpha(chNext)) {
|
||||
if (Quote.Rep <= 0) {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PL_DEFAULT;
|
||||
@ -1052,7 +1149,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
} else if (ch == Quote.Up /*&& chPrev != '\\'*/) {
|
||||
Quote.Count++;
|
||||
} else if (!isalpha(chNext)) {
|
||||
} else if (!isascii(chNext) || !isalpha(chNext)) {
|
||||
if (Quote.Rep <= 0) {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PL_DEFAULT;
|
||||
@ -1090,7 +1187,63 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
} else if (ch == Quote.Up) {
|
||||
Quote.Count++;
|
||||
}
|
||||
}
|
||||
} else if (state == SCE_PL_SUB_PROTOTYPE) {
|
||||
char strch[2];
|
||||
strch[0] = ch;
|
||||
strch[1] = '\0';
|
||||
if (NULL != strstr("\\[$@%&*];", strch)) {
|
||||
// keep going
|
||||
} else if (ch == ')') {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PL_DEFAULT;
|
||||
} else {
|
||||
// abandon prototype, restart from '('
|
||||
i = backPos;
|
||||
styler.ColourTo(i, SCE_PL_OPERATOR);
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
state = SCE_PL_DEFAULT;
|
||||
}
|
||||
} else if (state == SCE_PL_FORMAT_IDENT) {
|
||||
// occupies different HereDoc states to avoid clashing with HERE docs
|
||||
if (HereDoc.State == 0) {
|
||||
if ((isascii(ch) && isalpha(ch)) || ch == '_' // probable identifier
|
||||
|| ch == '=') { // no identifier
|
||||
HereDoc.State = 3;
|
||||
HereDoc.Quoted = false; // whitespace flag
|
||||
} else if (ch == ' ' || ch == '\t') {
|
||||
styler.ColourTo(i, SCE_PL_DEFAULT);
|
||||
} else {
|
||||
state = SCE_PL_DEFAULT;
|
||||
HereDoc.State = 0;
|
||||
goto restartLexer;
|
||||
}
|
||||
}
|
||||
if (HereDoc.State == 3) { // with just a '=', state goes 0->3->4
|
||||
if (ch == '=') {
|
||||
styler.ColourTo(i, SCE_PL_FORMAT_IDENT);
|
||||
state = SCE_PL_DEFAULT;
|
||||
HereDoc.State = 4;
|
||||
} else if (ch == ' ' || ch == '\t') {
|
||||
HereDoc.Quoted = true;
|
||||
} else if (isEOLChar(ch) || (HereDoc.Quoted && ch != '=')) {
|
||||
// abandon format, restart from after 'format'
|
||||
i = backPos + 1;
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
state = SCE_PL_DEFAULT;
|
||||
HereDoc.State = 0;
|
||||
}
|
||||
}
|
||||
} else if (state == SCE_PL_FORMAT) {
|
||||
if (isEOLChar(chPrev)) {
|
||||
styler.ColourTo(i - 1, state);
|
||||
if (ch == '.' && isEOLChar(chNext)) {
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_PL_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (state == SCE_PL_ERROR) {
|
||||
break;
|
||||
@ -1228,5 +1381,5 @@ static const char * const perlWordListDesc[] = {
|
||||
0
|
||||
};
|
||||
|
||||
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl", FoldPerlDoc, perlWordListDesc);
|
||||
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl", FoldPerlDoc, perlWordListDesc, 8);
|
||||
|
||||
|
271
src/stc/scintilla/src/LexProgress.cxx
Normal file
271
src/stc/scintilla/src/LexProgress.cxx
Normal file
@ -0,0 +1,271 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file LexProgress.cxx
|
||||
** Lexer for Progress 4GL.
|
||||
** Based on LexCPP.cxx of Neil Hodgson <neilh@scintilla.org>
|
||||
**/
|
||||
// Copyright 2006-2007 by Yuval Papish <Yuval@YuvCom.com>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
/** TODO:
|
||||
WebSpeed support in html lexer
|
||||
Support "end triggers" expression of the triggers phrase
|
||||
change lmPS to lmProgress
|
||||
Support more than 6 comments levels
|
||||
**/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "StyleContext.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(int ch) {
|
||||
return (ch < 0x80) && (isalnum(ch) || ch == '_');
|
||||
}
|
||||
|
||||
static inline bool IsAWordStart(int ch) {
|
||||
return (ch < 0x80) && (isalpha(ch) || ch == '_');
|
||||
}
|
||||
|
||||
enum SentenceStart { SetSentenceStart = 0xf, ResetSentenceStart = 0x10}; // true -> bit = 0
|
||||
|
||||
static void Colourise4glDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
|
||||
WordList &keywords1 = *keywordlists[0];
|
||||
WordList &keywords2 = *keywordlists[1];
|
||||
WordList &keywords3 = *keywordlists[2];
|
||||
//WordList &keywords4 = *keywordlists[3];
|
||||
//WordList &keywords5 = *keywordlists[4];
|
||||
|
||||
int visibleChars = 0;
|
||||
int mask;
|
||||
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
if (sc.atLineStart) {
|
||||
// Reset states to begining of colourise so no surprises
|
||||
// if different sets of lines lexed.
|
||||
visibleChars = 0;
|
||||
}
|
||||
|
||||
// Handle line continuation generically.
|
||||
if (sc.ch == '~') {
|
||||
// Skip whitespace between ~ and EOL
|
||||
/* do {
|
||||
sc.Forward();
|
||||
} */
|
||||
while ((sc.chNext == ' ' || sc.chNext == '\t') ) {
|
||||
sc.Forward();
|
||||
sc.More();
|
||||
}
|
||||
if (sc.chNext == '\n' || sc.chNext == '\r') {
|
||||
sc.Forward();
|
||||
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||
sc.Forward();
|
||||
}
|
||||
sc.Forward();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Determine if a new state should be terminated.
|
||||
mask = sc.state & 0x10;
|
||||
switch (sc.state & 0xf) {
|
||||
case SCE_4GL_OPERATOR:
|
||||
sc.SetState(SCE_4GL_DEFAULT | mask);
|
||||
break;
|
||||
case SCE_4GL_NUMBER:
|
||||
if (!(IsADigit(sc.ch))) {
|
||||
sc.SetState(SCE_4GL_DEFAULT | mask);
|
||||
}
|
||||
break;
|
||||
case SCE_4GL_IDENTIFIER:
|
||||
if (!IsAWordChar(sc.ch) && sc.ch != '-') {
|
||||
char s[1000];
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
if (((sc.state & 0x10) == 0) && keywords2.InList(s) || keywords3.InList(s)) {
|
||||
sc.ChangeState(SCE_4GL_BLOCK | ResetSentenceStart);
|
||||
}
|
||||
else if (keywords1.InList(s)) {
|
||||
if ((s[0] == 'e' && s[1] =='n' && s[2] == 'd' && !isalnum(s[3]) && s[3] != '-') ||
|
||||
(s[0] == 'f' && s[1] =='o' && s[2] == 'r' && s[3] == 'w' && s[4] =='a' && s[5] == 'r' && s[6] == 'd'&& !isalnum(s[7]))) {
|
||||
sc.ChangeState(SCE_4GL_END | ResetSentenceStart);
|
||||
}
|
||||
else if ((s[0] == 'e' && s[1] =='l' && s[2] == 's' && s[3] == 'e') ||
|
||||
(s[0] == 't' && s[1] =='h' && s[2] == 'e' && s[3] == 'n')) {
|
||||
sc.ChangeState(SCE_4GL_WORD & SetSentenceStart);
|
||||
}
|
||||
else {
|
||||
sc.ChangeState(SCE_4GL_WORD | ResetSentenceStart);
|
||||
}
|
||||
}
|
||||
sc.SetState(SCE_4GL_DEFAULT | (sc.state & 0x10));
|
||||
}
|
||||
break;
|
||||
case SCE_4GL_PREPROCESSOR:
|
||||
if (sc.atLineStart) {
|
||||
sc.SetState(SCE_4GL_DEFAULT & SetSentenceStart);
|
||||
} else if (sc.ch == '*' && sc.chNext == '/') {
|
||||
sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
|
||||
}
|
||||
break;
|
||||
case SCE_4GL_STRING:
|
||||
if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
|
||||
}
|
||||
break;
|
||||
case SCE_4GL_CHARACTER:
|
||||
if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ((sc.state & 0xf) >= SCE_4GL_COMMENT1) {
|
||||
if (sc.ch == '*' && sc.chNext == '/') {
|
||||
sc.Forward();
|
||||
if ((sc.state & 0xf) == SCE_4GL_COMMENT1) {
|
||||
sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
|
||||
}
|
||||
else
|
||||
sc.SetState((sc.state & 0x1f) - 1);
|
||||
} else if (sc.ch == '/' && sc.chNext == '*') {
|
||||
sc.Forward();
|
||||
sc.SetState((sc.state & 0x1f) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
mask = sc.state & 0x10;
|
||||
if ((sc.state & 0xf) == SCE_4GL_DEFAULT) {
|
||||
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_4GL_NUMBER | ResetSentenceStart);
|
||||
} else if (IsAWordStart(sc.ch) || (sc.ch == '@')) {
|
||||
sc.SetState(SCE_4GL_IDENTIFIER | mask);
|
||||
} else if (sc.ch == '/' && sc.chNext == '*') {
|
||||
sc.SetState(SCE_4GL_COMMENT1 | mask);
|
||||
sc.Forward();
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_4GL_STRING | ResetSentenceStart);
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.SetState(SCE_4GL_CHARACTER | ResetSentenceStart);
|
||||
} else if (sc.ch == '&' && visibleChars == 0 && ((sc.state & 0x10) == 0)) {
|
||||
sc.SetState(SCE_4GL_PREPROCESSOR | ResetSentenceStart);
|
||||
// Skip whitespace between & and preprocessor word
|
||||
do {
|
||||
sc.Forward();
|
||||
} while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
|
||||
// Handle syntactical line termination
|
||||
} else if ((sc.ch == '.' || sc.ch == ':' || sc.ch == '}') && (sc.chNext == ' ' || sc.chNext == '\t' || sc.chNext == '\n' || sc.chNext == '\r')) {
|
||||
sc.SetState(sc.state & SetSentenceStart);
|
||||
} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||
if (sc.ch == ':')
|
||||
sc.SetState(SCE_4GL_OPERATOR & SetSentenceStart);
|
||||
else
|
||||
sc.SetState(SCE_4GL_OPERATOR | ResetSentenceStart);
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsASpace(sc.ch)) {
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
static bool IsStreamCommentStyle(int style) {
|
||||
return (style & 0xf) >= SCE_4GL_COMMENT1 ;
|
||||
}
|
||||
|
||||
// Store both the current line's fold level and the next lines in the
|
||||
// level store to make it easy to pick up with each increment
|
||||
// and to make it possible to fiddle the current level for "} else {".
|
||||
static void FoldNoBox4glDoc(unsigned int startPos, int length, int initStyle,
|
||||
Accessor &styler) {
|
||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
|
||||
unsigned int endPos = startPos + length;
|
||||
int visibleChars = 0;
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
int levelCurrent = SC_FOLDLEVELBASE;
|
||||
if (lineCurrent > 0)
|
||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||
int levelMinCurrent = levelCurrent;
|
||||
int levelNext = levelCurrent;
|
||||
char chNext = static_cast<char>(tolower(styler[startPos]));
|
||||
int styleNext = styler.StyleAt(startPos);
|
||||
int style = initStyle;
|
||||
for (unsigned int i = startPos; i < endPos; i++) {
|
||||
char ch = chNext;
|
||||
chNext = static_cast<char>(tolower(styler.SafeGetCharAt(i + 1)));
|
||||
int stylePrev = style;
|
||||
style = styleNext;
|
||||
styleNext = styler.StyleAt(i + 1);
|
||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||
if (foldComment && IsStreamCommentStyle(style)) {
|
||||
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--;
|
||||
}
|
||||
}
|
||||
else if ((style & 0xf) == SCE_4GL_BLOCK && !isalnum(chNext)) {
|
||||
levelNext++;
|
||||
}
|
||||
else if ((style & 0xf) == SCE_4GL_END && (ch == 'e' || ch == 'f')) {
|
||||
levelNext--;
|
||||
}
|
||||
if (atEOL) {
|
||||
int levelUse = levelCurrent;
|
||||
if (foldAtElse) {
|
||||
levelUse = levelMinCurrent;
|
||||
}
|
||||
int lev = levelUse | levelNext << 16;
|
||||
if (visibleChars == 0 && foldCompact)
|
||||
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||
if (levelUse < levelNext)
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent)) {
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
}
|
||||
lineCurrent++;
|
||||
levelCurrent = levelNext;
|
||||
levelMinCurrent = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
if (!isspacechar(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
|
||||
static void Fold4glDoc(unsigned int startPos, int length, int initStyle, WordList *[],
|
||||
Accessor &styler) {
|
||||
FoldNoBox4glDoc(startPos, length, initStyle, styler);
|
||||
}
|
||||
|
||||
static const char * const FglWordLists[] = {
|
||||
"Primary keywords and identifiers",
|
||||
"Secondary keywords and identifiers",
|
||||
"Documentation comment keywords",
|
||||
"Unused",
|
||||
"Global classes and typedefs",
|
||||
0,
|
||||
};
|
||||
|
||||
LexerModule lmProgress(SCLEX_PS, Colourise4glDoc, "progress", Fold4glDoc, FglWordLists);
|
@ -20,7 +20,12 @@
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
enum kwType { kwOther, kwClass, kwDef, kwImport };
|
||||
static const int indicatorWhitespace = 1;
|
||||
|
||||
static bool IsPyComment(Accessor &styler, int pos, int len) {
|
||||
return len > 0 && styler[pos] == '#';
|
||||
@ -123,26 +128,29 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
|
||||
styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
|
||||
bool hexadecimal = false;
|
||||
|
||||
// Python uses a different mask because bad indentation is marked by oring with 32
|
||||
StyleContext sc(startPos, endPos - startPos, initStyle, styler, 0x7f);
|
||||
StyleContext sc(startPos, endPos - startPos, initStyle, styler);
|
||||
|
||||
bool indentGood = true;
|
||||
int startIndicator = sc.currentPos;
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
if (sc.atLineStart) {
|
||||
const char chBad = static_cast<char>(64);
|
||||
const char chGood = static_cast<char>(0);
|
||||
char chFlags = chGood;
|
||||
styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
|
||||
indentGood = true;
|
||||
if (whingeLevel == 1) {
|
||||
chFlags = (spaceFlags & wsInconsistent) ? chBad : chGood;
|
||||
indentGood = (spaceFlags & wsInconsistent) == 0;
|
||||
} else if (whingeLevel == 2) {
|
||||
chFlags = (spaceFlags & wsSpaceTab) ? chBad : chGood;
|
||||
indentGood = (spaceFlags & wsSpaceTab) == 0;
|
||||
} else if (whingeLevel == 3) {
|
||||
chFlags = (spaceFlags & wsSpace) ? chBad : chGood;
|
||||
indentGood = (spaceFlags & wsSpace) == 0;
|
||||
} else if (whingeLevel == 4) {
|
||||
chFlags = (spaceFlags & wsTab) ? chBad : chGood;
|
||||
indentGood = (spaceFlags & wsTab) == 0;
|
||||
}
|
||||
if (!indentGood) {
|
||||
styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 0);
|
||||
startIndicator = sc.currentPos;
|
||||
}
|
||||
sc.SetState(sc.state);
|
||||
styler.SetFlags(chFlags, static_cast<char>(sc.state));
|
||||
}
|
||||
|
||||
if (sc.atLineEnd) {
|
||||
@ -154,7 +162,6 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
|
||||
sc.SetState(sc.state);
|
||||
}
|
||||
lineCurrent++;
|
||||
styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
|
||||
if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) {
|
||||
sc.ChangeState(SCE_P_STRINGEOL);
|
||||
sc.ForwardSetState(SCE_P_DEFAULT);
|
||||
@ -210,10 +217,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
|
||||
sc.SetState(SCE_P_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_P_DECORATOR) {
|
||||
if (sc.ch == '\r' || sc.ch == '\n') {
|
||||
if (!IsAWordChar(sc.ch)) {
|
||||
sc.SetState(SCE_P_DEFAULT);
|
||||
} else if (sc.ch == '#') {
|
||||
sc.SetState((sc.chNext == '#') ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE);
|
||||
}
|
||||
} else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) {
|
||||
if (sc.ch == '\\') {
|
||||
@ -248,6 +253,12 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
}
|
||||
|
||||
if (!indentGood && !IsASpaceOrTab(sc.ch)) {
|
||||
styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 1);
|
||||
startIndicator = sc.currentPos;
|
||||
indentGood = true;
|
||||
}
|
||||
|
||||
// State exit code may have moved on to end of line
|
||||
if (needEOLCheck && sc.atLineEnd) {
|
||||
lineCurrent++;
|
||||
@ -282,6 +293,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
}
|
||||
}
|
||||
styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 0);
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
|
213
src/stc/scintilla/src/LexR.cxx
Normal file
213
src/stc/scintilla/src/LexR.cxx
Normal file
@ -0,0 +1,213 @@
|
||||
// Scintilla source code edit control
|
||||
/** @file Lexr.cxx
|
||||
** Lexer for R, S, SPlus Statistics Program (Heavily derived from CPP Lexer).
|
||||
**
|
||||
**/
|
||||
// Copyright 1998-2002 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 <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "StyleContext.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.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) || ch == '_');
|
||||
}
|
||||
|
||||
static inline bool IsAnOperator(const int 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 == '(' ||
|
||||
ch == ')' || ch == '}' || ch == '{' || ch == '[' ||
|
||||
ch == ']')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ColouriseRDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||
Accessor &styler) {
|
||||
|
||||
WordList &keywords = *keywordlists[0];
|
||||
WordList &keywords2 = *keywordlists[1];
|
||||
WordList &keywords3 = *keywordlists[2];
|
||||
|
||||
|
||||
// Do not leak onto next line
|
||||
if (initStyle == SCE_R_INFIXEOL)
|
||||
initStyle = SCE_R_DEFAULT;
|
||||
|
||||
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
if (sc.atLineStart && (sc.state == SCE_R_STRING)) {
|
||||
// Prevent SCE_R_STRINGEOL from leaking back to previous line
|
||||
sc.SetState(SCE_R_STRING);
|
||||
}
|
||||
|
||||
// Determine if the current state should terminate.
|
||||
if (sc.state == SCE_R_OPERATOR) {
|
||||
sc.SetState(SCE_R_DEFAULT);
|
||||
} else if (sc.state == SCE_R_NUMBER) {
|
||||
if (!IsADigit(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_R_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_R_IDENTIFIER) {
|
||||
if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
|
||||
char s[100];
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
if (keywords.InList(s)) {
|
||||
sc.ChangeState(SCE_R_KWORD);
|
||||
} else if (keywords2.InList(s)) {
|
||||
sc.ChangeState(SCE_R_BASEKWORD);
|
||||
} else if (keywords3.InList(s)) {
|
||||
sc.ChangeState(SCE_R_OTHERKWORD);
|
||||
}
|
||||
sc.SetState(SCE_R_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_R_COMMENT) {
|
||||
if (sc.ch == '\r' || sc.ch == '\n') {
|
||||
sc.SetState(SCE_R_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_R_STRING) {
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_R_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_R_INFIX) {
|
||||
if (sc.ch == '%') {
|
||||
sc.ForwardSetState(SCE_R_DEFAULT);
|
||||
} else if (sc.atLineEnd) {
|
||||
sc.ChangeState(SCE_R_INFIXEOL);
|
||||
sc.ForwardSetState(SCE_R_DEFAULT);
|
||||
}
|
||||
}else if (sc.state == SCE_R_STRING2) {
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.ForwardSetState(SCE_R_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
if (sc.state == SCE_R_DEFAULT) {
|
||||
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_R_NUMBER);
|
||||
} else if (IsAWordStart(sc.ch) ) {
|
||||
sc.SetState(SCE_R_IDENTIFIER);
|
||||
} else if (sc.Match('#')) {
|
||||
sc.SetState(SCE_R_COMMENT);
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_R_STRING);
|
||||
} else if (sc.ch == '%') {
|
||||
sc.SetState(SCE_R_INFIX);
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.SetState(SCE_R_STRING2);
|
||||
} else if (IsAnOperator(sc.ch)) {
|
||||
sc.SetState(SCE_R_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
sc.Complete();
|
||||
}
|
||||
|
||||
// Store both the current line's fold level and the next lines in the
|
||||
// level store to make it easy to pick up with each increment
|
||||
// and to make it possible to fiddle the current level for "} else {".
|
||||
static void FoldRDoc(unsigned int startPos, int length, int, WordList *[],
|
||||
Accessor &styler) {
|
||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
|
||||
unsigned int endPos = startPos + length;
|
||||
int visibleChars = 0;
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
int levelCurrent = SC_FOLDLEVELBASE;
|
||||
if (lineCurrent > 0)
|
||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||
int levelMinCurrent = levelCurrent;
|
||||
int levelNext = levelCurrent;
|
||||
char chNext = styler[startPos];
|
||||
int styleNext = styler.StyleAt(startPos);
|
||||
for (unsigned int i = startPos; i < endPos; i++) {
|
||||
char ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
int style = styleNext;
|
||||
styleNext = styler.StyleAt(i + 1);
|
||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||
if (style == SCE_R_OPERATOR) {
|
||||
if (ch == '{') {
|
||||
// Measure the minimum before a '{' to allow
|
||||
// folding on "} else {"
|
||||
if (levelMinCurrent > levelNext) {
|
||||
levelMinCurrent = levelNext;
|
||||
}
|
||||
levelNext++;
|
||||
} else if (ch == '}') {
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
if (atEOL) {
|
||||
int levelUse = levelCurrent;
|
||||
if (foldAtElse) {
|
||||
levelUse = levelMinCurrent;
|
||||
}
|
||||
int lev = levelUse | levelNext << 16;
|
||||
if (visibleChars == 0 && foldCompact)
|
||||
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||
if (levelUse < levelNext)
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
if (lev != styler.LevelAt(lineCurrent)) {
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
}
|
||||
lineCurrent++;
|
||||
levelCurrent = levelNext;
|
||||
levelMinCurrent = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
if (!isspacechar(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const char * const RWordLists[] = {
|
||||
"Language Keywords",
|
||||
"Base / Default package function",
|
||||
"Other Package Functions",
|
||||
"Unused",
|
||||
"Unused",
|
||||
0,
|
||||
};
|
||||
|
||||
|
||||
|
||||
LexerModule lmR(SCLEX_R, ColouriseRDoc, "r", FoldRDoc, RWordLists);
|
@ -26,6 +26,9 @@
|
||||
#include "SciLexer.h"
|
||||
#include "StyleContext.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
static inline bool IsAWordChar(const int ch) {
|
||||
return (isalnum(ch) || ch == '?' || ch == '!' || ch == '.' || ch == '\'' || ch == '+' || ch == '-' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user