Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
59 lines (54 loc) · 1.91 KB

File metadata and controls

59 lines (54 loc) · 1.91 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/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
showUnused = False
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)
if showUnused:
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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.