MCPcopy Create free account
hub / github.com/christopherpoole/CADMesh / inlineSourceFunctions

Function inlineSourceFunctions

cmake/generateSingleHeader.py:29–55  ·  view source on GitHub ↗
(sources)

Source from the content-addressed store, hash-verified

27
28
29def inlineSourceFunctions(sources):
30
31 # TODO: Tidy with clang first?
32
33 for name in sources.keys():
34 source = sources[name]
35
36 if name == "Exceptions":
37 for i, line in enumerate(source):
38 if line.strip().startswith("void ") and line.strip().endswith(")"):
39 sources[name][i] = "inline " + line
40
41 if name == "FileTypes":
42 for i, line in enumerate(source):
43 if line.strip().startswith("Type ") and line.strip().endswith(")"):
44 sources[name][i] = "inline " + line
45
46 else:
47 for i, line in enumerate(source):
48 if name + "::" in line and not line.startswith(" ") and not line.strip().endswith(";"):
49 sources[name][i] = "inline " + line
50
51 elif line.startswith("std::shared_ptr<BuiltInReader> BuiltIn()"):
52 sources[name][i] = "inline " + line
53
54
55 return sources
56
57
58def stripComments(lines):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected