stone 3.3.7__tar.gz → 3.3.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stone-3.3.7/stone.egg-info → stone-3.3.8}/PKG-INFO +1 -1
- {stone-3.3.7 → stone-3.3.8}/setup.py +1 -1
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_types.py +17 -9
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/ir_generator.py +2 -1
- {stone-3.3.7 → stone-3.3.8/stone.egg-info}/PKG-INFO +1 -1
- {stone-3.3.7 → stone-3.3.8}/LICENSE +0 -0
- {stone-3.3.7 → stone-3.3.8}/MANIFEST.in +0 -0
- {stone-3.3.7 → stone-3.3.8}/README.rst +0 -0
- {stone-3.3.7 → stone-3.3.8}/ez_setup.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/setup.cfg +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/__init__.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backend.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/__init__.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/js_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/js_helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/js_types.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c_helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c_types.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/__init__.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/stone_base.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/stone_serializers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/stone_validators.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_type_mapping.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/python_type_stubs.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/swift.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/swift_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/swift_helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/swift_types.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/tsd_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/tsd_helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/backends/tsd_types.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/cli.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/cli_helpers.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/compiler.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/__init__.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/ast.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/exception.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/frontend.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/lexer.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/frontend/parser.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/ir/__init__.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/ir/api.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/ir/data_types.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/py.typed +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone/typing_hacks.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone.egg-info/SOURCES.txt +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone.egg-info/dependency_links.txt +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone.egg-info/entry_points.txt +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone.egg-info/not-zip-safe +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone.egg-info/requires.txt +0 -0
- {stone-3.3.7 → stone-3.3.8}/stone.egg-info/top_level.txt +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/requirements.txt +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_backend.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_cli.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_js_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_python_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_python_gen.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_python_type_stubs.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_python_types.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_stone.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_stone_internal.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_stone_route_whitelist.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_tsd_client.py +0 -0
- {stone-3.3.7 → stone-3.3.8}/test/test_tsd_types.py +0 -0
|
@@ -640,15 +640,23 @@ class PythonTypesBackend(CodeBackend):
|
|
|
640
640
|
dt, _, _ = unwrap(data_type)
|
|
641
641
|
if is_struct_type(dt) or is_union_type(dt):
|
|
642
642
|
annotation_types_seen = set()
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
643
|
+
# If data type enumerates subtypes, recurse to subtypes instead which in turn collect parents' custom annotations
|
|
644
|
+
if is_struct_type(dt) and dt.has_enumerated_subtypes():
|
|
645
|
+
for subtype in dt.get_enumerated_subtypes():
|
|
646
|
+
for annotation_type, recursive_processor in self._generate_custom_annotation_processors(ns, subtype.data_type):
|
|
647
|
+
if annotation_type not in annotation_types_seen:
|
|
648
|
+
yield (annotation_type, recursive_processor)
|
|
649
|
+
annotation_types_seen.add(annotation_type)
|
|
650
|
+
else:
|
|
651
|
+
for _, annotation in dt.recursive_custom_annotations:
|
|
652
|
+
if annotation.annotation_type not in annotation_types_seen:
|
|
653
|
+
yield (annotation.annotation_type,
|
|
654
|
+
generate_func_call(
|
|
655
|
+
'bb.make_struct_annotation_processor',
|
|
656
|
+
args=[class_name_for_annotation_type(annotation.annotation_type, ns),
|
|
657
|
+
'processor']
|
|
658
|
+
))
|
|
659
|
+
annotation_types_seen.add(annotation.annotation_type)
|
|
652
660
|
elif is_list_type(dt):
|
|
653
661
|
for annotation_type, recursive_processor in self._generate_custom_annotation_processors(
|
|
654
662
|
ns, dt.data_type):
|
|
@@ -824,10 +824,11 @@ class IRGenerator:
|
|
|
824
824
|
|
|
825
825
|
annotations = set()
|
|
826
826
|
|
|
827
|
-
# collect data types from subtypes recursively
|
|
828
827
|
if is_struct_type(data_type) or is_union_type(data_type):
|
|
828
|
+
# collect custom annotations from ancestor data types
|
|
829
829
|
if data_type.parent_type:
|
|
830
830
|
annotations.update(recurse(data_type.parent_type))
|
|
831
|
+
# collct custom annotations from nested data types
|
|
831
832
|
for field in data_type.fields:
|
|
832
833
|
annotations.update(recurse(field.data_type))
|
|
833
834
|
# annotations can be defined directly on fields
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|