Swift: implement python schema

The information that was contained in `schema.yml` is now in
`swift/schema.py`, which allows a more integrated IDE experience
for writing and navigating it.

Another minor change is that `schema.Class` now has a `str` `group`
field instead of a `pathlib.Path` `dir` one.
This commit is contained in:
Paolo Tranquilli
2022-09-02 14:06:04 +02:00
parent caaf9e7ff3
commit 96897a0cdc
20 changed files with 1034 additions and 1719 deletions

View File

@@ -136,10 +136,10 @@ def test_classes_with_dirs(generate_grouped):
cbase = cpp.Class(name="CBase")
assert generate_grouped([
schema.Class(name="A"),
schema.Class(name="B", dir=pathlib.Path("foo")),
schema.Class(name="CBase", derived={"C"}, dir=pathlib.Path("bar")),
schema.Class(name="C", bases=["CBase"], dir=pathlib.Path("bar")),
schema.Class(name="D", dir=pathlib.Path("foo/bar/baz")),
schema.Class(name="B", group="foo"),
schema.Class(name="CBase", derived={"C"}, group="bar"),
schema.Class(name="C", bases=["CBase"], group="bar"),
schema.Class(name="D", group="foo/bar/baz"),
]) == {
".": [cpp.Class(name="A", trap_name="As", final=True)],
"foo": [cpp.Class(name="B", trap_name="Bs", final=True)],