From: Alexis Laferrière Date: Tue, 1 Sep 2015 14:52:41 +0000 (-0400) Subject: contrib/objcwrapper: each ObjcProperty keeps track of its declaring class X-Git-Tag: v0.7.8~42^2~19 X-Git-Url: http://nitlanguage.org contrib/objcwrapper: each ObjcProperty keeps track of its declaring class Signed-off-by: Alexis Laferrière --- diff --git a/contrib/objcwrapper/src/objc_model.nit b/contrib/objcwrapper/src/objc_model.nit index 3ce3946..21a34fa 100644 --- a/contrib/objcwrapper/src/objc_model.nit +++ b/contrib/objcwrapper/src/objc_model.nit @@ -93,6 +93,9 @@ end # Property of an `ObjcClass` class ObjcProperty + # Introducing class + var objc_class: ObjcClass + # Is this property to be commented out? var is_commented = false is writable end diff --git a/contrib/objcwrapper/src/objc_visitor.nit b/contrib/objcwrapper/src/objc_visitor.nit index 0c131cc..295434e 100644 --- a/contrib/objcwrapper/src/objc_visitor.nit +++ b/contrib/objcwrapper/src/objc_visitor.nit @@ -73,7 +73,10 @@ end redef class Nsignature_block_signature redef fun accept_objc(v) do - var method = new ObjcMethod + var c = v.objc_class + assert c != null + + var method = new ObjcMethod(c) method.return_type = n_signature_return_type.to_type method.is_class_property = n_scope.is_class_property @@ -94,7 +97,7 @@ redef class Nsignature_block_signature method.params.add param end - v.objc_class.methods.add method + c.methods.add method end end @@ -102,11 +105,14 @@ end redef class Nproperty_property redef fun accept_objc(v) do - var attr = new ObjcAttribute + var c = v.objc_class + assert c != null + + var attr = new ObjcAttribute(c) attr.return_type = n_type.to_type attr.name = n_left.collect_text - v.objc_class.attributes.add attr + c.attributes.add attr end end