Swift: changes required for TBD node rework

These changes are required to allow a new type-safe approach to TBD
nodes, that will come in a separate commit.

This introduces:
* the possibility to add properties to the root `Element`
* a functor taking tags to the corresponding binding trap entry
* `hasProp()` methods for optional properties in QL
* `getPrimaryQlClass()` method
This commit is contained in:
Paolo Tranquilli
2022-05-10 11:54:39 +02:00
parent 2421076d2f
commit 0b9dc9703f
246 changed files with 351 additions and 263 deletions

View File

@@ -7,14 +7,14 @@ from swift.codegen.lib import cpp
@pytest.mark.parametrize("keyword", cpp.cpp_keywords)
def test_field_keyword_cpp_name(keyword):
def test_field_keyword_name(keyword):
f = cpp.Field(keyword, "int")
assert f.cpp_name == keyword + "_"
assert f.field_name == keyword + "_"
def test_field_cpp_name():
def test_field_name():
f = cpp.Field("foo", "int")
assert f.cpp_name == "foo"
assert f.field_name == "foo"
@pytest.mark.parametrize("type,expected", [