Swift: some restructuring of codegen

Loading of the schema and dbscheme has been moved to a separate
`loaders` package for better separation of concerns.
This commit is contained in:
Paolo Tranquilli
2023-02-14 09:51:01 +01:00
parent 781aab3eb7
commit 8e079320f3
19 changed files with 531 additions and 352 deletions

View File

@@ -17,6 +17,7 @@ import typing
import inflection
from swift.codegen.lib import cpp, schema
from swift.codegen.loaders import schemaloader
def _get_type(t: str, add_or_none_except: typing.Optional[str] = None) -> str:
@@ -90,7 +91,7 @@ class Processor:
def generate(opts, renderer):
assert opts.cpp_output
processor = Processor(schema.load_file(opts.schema))
processor = Processor(schemaloader.load_file(opts.schema))
out = opts.cpp_output
for dir, classes in processor.get_classes().items():
renderer.render(cpp.ClassList(classes, opts.schema,