mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-08 22:44:39 +02:00
Update with https://www.scintilla.org/scintilla521.zip https://www.scintilla.org/lexilla515.zip - fix setting to bring Scintilla::PositionCR from ScintillaStructures.h inline with Sci_Position.h Sci_PositionCR - add workaround to enable lexer for searchResult commented out SCI_SETILEXER call on searchResult to get one result which is correctly handled by the lexer, added comment about the current problem with property @MarkingsStruct which seems to disappear after call to SCI_SETILEXER or CreateLexer - corrected usage of ObjC lexer - removed unnecessary filter stuff - use own sections for scintilla and lexilla build targets and allow parallel builds - as libscilex is no longer existing, changed to libscintilla - adapt makefiles and cmake - use VS2019 - started simple changes for createlexer adaptations, nullpointercheck missing on return of lexer name from deprecated LexerNameFromID -> undefined behaviour - movement from id -> lexer name, mostly done via LexerNameFromID + switching off corresponding compiler warning - changed to SCI_SETILEXER from SCI_SETLEXER, SCI_SETLEXERLANGUAGE needs to be corrected, see Scintilla5Migration.html - just commented out: SCI_LOADLEXERLIBRARY Fix #10504, close #11419
57 lines
1.9 KiB
Python
57 lines
1.9 KiB
Python
#!/usr/bin/env python3
|
|
# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
|
|
# definition file.
|
|
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
|
|
# Requires Python 3.6 or later
|
|
|
|
import pathlib
|
|
import Face
|
|
import FileGenerator
|
|
|
|
def printHFile(f):
|
|
out = []
|
|
previousCategory = ""
|
|
anyProvisional = False
|
|
for name in f.order:
|
|
v = f.features[name]
|
|
if v["Category"] != "Deprecated":
|
|
if v["Category"] == "Provisional" and previousCategory != "Provisional":
|
|
out.append("#ifndef SCI_DISABLE_PROVISIONAL")
|
|
anyProvisional = True
|
|
previousCategory = v["Category"]
|
|
if v["FeatureType"] in ["fun", "get", "set"]:
|
|
featureDefineName = "SCI_" + name.upper()
|
|
out.append("#define " + featureDefineName + " " + v["Value"])
|
|
elif v["FeatureType"] in ["evt"]:
|
|
featureDefineName = "SCN_" + name.upper()
|
|
out.append("#define " + featureDefineName + " " + v["Value"])
|
|
elif v["FeatureType"] in ["val"]:
|
|
out.append("#define " + name + " " + v["Value"])
|
|
if anyProvisional:
|
|
out.append("#endif")
|
|
return out
|
|
|
|
def RegenerateAll(root, showMaxID):
|
|
f = Face.Face()
|
|
f.ReadFromFile(root / "include/Scintilla.iface")
|
|
FileGenerator.Regenerate(root / "include/Scintilla.h", "/* ", printHFile(f))
|
|
if showMaxID:
|
|
valueSet = set(int(x) for x in f.values if int(x) < 3000)
|
|
maximumID = max(valueSet)
|
|
print("Maximum ID is %d" % maximumID)
|
|
#~ valuesUnused = sorted(x for x in range(2001,maximumID) if x not in valueSet)
|
|
#~ print("\nUnused values")
|
|
#~ valueToName = {}
|
|
#~ for name, feature in f.features.items():
|
|
#~ try:
|
|
#~ value = int(feature["Value"])
|
|
#~ valueToName[value] = name
|
|
#~ except ValueError:
|
|
#~ pass
|
|
#~ for v in valuesUnused:
|
|
#~ prev = valueToName.get(v-1, "")
|
|
#~ print(v, prev)
|
|
|
|
if __name__ == "__main__":
|
|
RegenerateAll(pathlib.Path(__file__).resolve().parent.parent, True)
|