diff options
author | Daniel Kolesa <daniel@octaforge.org> | 2019-03-08 08:17:01 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-03-08 08:17:01 -0500 |
commit | 1a17aff85ffca1cae6d71aa6273e6a8214154276 (patch) | |
tree | 00ab2bc42a75136d4778a8c0c57500072550742e /src/scripts | |
parent | 23d0076346e64456280bd9b9c2d1d2659d065fd2 (diff) |
eolian: add support for marking type declarations beta
Summary:
This also simplifies the beta checking API by unifying it under
objects (makes much more sense that way) and reworks the validator
to have betaness support within its context state, allowing checks
to be done easily in any place.
The betaness checks are disabled for types for the time being,
because otherwise there are too many errors (types are assumed
to be stable as they are not tagged beta, but they reference beta
classes all over the place). Set EOLIAN_TYPEDECL_BETA_WARN to 1
in your environment to force enable the checks.
Reviewers: zmike, bu5hm4n, stefan_schmidt, lauromoura, cedric
Reviewed By: zmike
Subscribers: #reviewers, #committers
Tags: #efl, #eolian
Differential Revision: https://phab.enlightenment.org/D8102
Diffstat (limited to 'src/scripts')
-rw-r--r-- | src/scripts/pyolian/eolian.py | 12 | ||||
-rw-r--r-- | src/scripts/pyolian/eolian_lib.py | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index 0df6ee8884..a2a6b5c323 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py | |||
@@ -622,6 +622,10 @@ class Object(EolianBaseObject): | |||
622 | def column(self): | 622 | def column(self): |
623 | return int(lib.eolian_object_column_get(self)) | 623 | return int(lib.eolian_object_column_get(self)) |
624 | 624 | ||
625 | @cached_property | ||
626 | def is_beta(self): | ||
627 | return bool(lib.eolian_object_is_beta(self)) | ||
628 | |||
625 | 629 | ||
626 | class Class(Object): | 630 | class Class(Object): |
627 | def __repr__(self): | 631 | def __repr__(self): |
@@ -811,10 +815,6 @@ class Event(Object): | |||
811 | return Eolian_Object_Scope(lib.eolian_event_scope_get(self)) | 815 | return Eolian_Object_Scope(lib.eolian_event_scope_get(self)) |
812 | 816 | ||
813 | @cached_property | 817 | @cached_property |
814 | def is_beta(self): | ||
815 | return bool(lib.eolian_event_is_beta(self)) | ||
816 | |||
817 | @cached_property | ||
818 | def is_hot(self): | 818 | def is_hot(self): |
819 | return bool(lib.eolian_event_is_hot(self)) | 819 | return bool(lib.eolian_event_is_hot(self)) |
820 | 820 | ||
@@ -887,10 +887,6 @@ class Function(Object): | |||
887 | return bool(lib.eolian_function_is_class(self)) | 887 | return bool(lib.eolian_function_is_class(self)) |
888 | 888 | ||
889 | @cached_property | 889 | @cached_property |
890 | def is_beta(self): | ||
891 | return bool(lib.eolian_function_is_beta(self)) | ||
892 | |||
893 | @cached_property | ||
894 | def object_is_const(self): | 890 | def object_is_const(self): |
895 | return bool(lib.eolian_function_object_is_const(self)) | 891 | return bool(lib.eolian_function_object_is_const(self)) |
896 | 892 | ||
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py index 1f6a2f3d71..9389683123 100644 --- a/src/scripts/pyolian/eolian_lib.py +++ b/src/scripts/pyolian/eolian_lib.py | |||
@@ -228,6 +228,10 @@ lib.eolian_object_short_name_get.restype = c_char_p | |||
228 | lib.eolian_object_namespaces_get.argtypes = (c_void_p,) | 228 | lib.eolian_object_namespaces_get.argtypes = (c_void_p,) |
229 | lib.eolian_object_namespaces_get.restype = c_void_p | 229 | lib.eolian_object_namespaces_get.restype = c_void_p |
230 | 230 | ||
231 | # EAPI Eina_Bool eolian_object_is_beta(const Eolian_Object *obj); | ||
232 | lib.eolian_object_is_beta.argtypes = (c_void_p,) | ||
233 | lib.eolian_object_is_beta.restype = c_bool | ||
234 | |||
231 | ### Eolian_Class ############################################################ | 235 | ### Eolian_Class ############################################################ |
232 | 236 | ||
233 | # EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass); | 237 | # EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass); |
@@ -340,10 +344,6 @@ lib.eolian_function_is_legacy_only.restype = c_bool | |||
340 | lib.eolian_function_is_class.argtypes = (c_void_p,) | 344 | lib.eolian_function_is_class.argtypes = (c_void_p,) |
341 | lib.eolian_function_is_class.restype = c_bool | 345 | lib.eolian_function_is_class.restype = c_bool |
342 | 346 | ||
343 | # EAPI Eina_Bool eolian_function_is_beta(const Eolian_Function *function_id); | ||
344 | lib.eolian_function_is_beta.argtypes = (c_void_p,) | ||
345 | lib.eolian_function_is_beta.restype = c_bool | ||
346 | |||
347 | # EAPI Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass); | 347 | # EAPI Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass); |
348 | lib.eolian_function_is_constructor.argtypes = (c_void_p,c_void_p,) | 348 | lib.eolian_function_is_constructor.argtypes = (c_void_p,c_void_p,) |
349 | lib.eolian_function_is_constructor.restype = c_bool | 349 | lib.eolian_function_is_constructor.restype = c_bool |
@@ -485,10 +485,6 @@ lib.eolian_event_documentation_get.restype = c_void_p | |||
485 | lib.eolian_event_scope_get.argtypes = (c_void_p,) | 485 | lib.eolian_event_scope_get.argtypes = (c_void_p,) |
486 | lib.eolian_event_scope_get.restype = c_int | 486 | lib.eolian_event_scope_get.restype = c_int |
487 | 487 | ||
488 | # EAPI Eina_Bool eolian_event_is_beta(const Eolian_Event *event); | ||
489 | lib.eolian_event_is_beta.argtypes = (c_void_p,) | ||
490 | lib.eolian_event_is_beta.restype = c_bool | ||
491 | |||
492 | # EAPI Eina_Bool eolian_event_is_hot(const Eolian_Event *event); | 488 | # EAPI Eina_Bool eolian_event_is_hot(const Eolian_Event *event); |
493 | lib.eolian_event_is_hot.argtypes = (c_void_p,) | 489 | lib.eolian_event_is_hot.argtypes = (c_void_p,) |
494 | lib.eolian_event_is_hot.restype = c_bool | 490 | lib.eolian_event_is_hot.restype = c_bool |