src/serialization: intro a service to detect the `noserialize` annotation
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 May 2015 00:41:02 +0000 (20:41 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 May 2015 20:46:03 +0000 (16:46 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/frontend/serialization_phase.nit

index 3fd62f9..d9ea51c 100644 (file)
@@ -38,6 +38,9 @@ redef class ANode
        # Is this node annotated to be made serializable?
        private fun is_serialize: Bool do return false
 
+       # Is this node annotated to not be made serializable?
+       private fun is_noserialize: Bool do return false
+
        private fun accept_precise_type_visitor(v: PreciseTypeVisitor) do visit_all(v)
 end
 
@@ -47,6 +50,10 @@ redef class ADefinition
                return get_annotations("serialize").not_empty or
                        get_annotations("auto_serializable").not_empty
        end
+
+       redef fun is_noserialize do
+               return get_annotations("noserialize").not_empty
+       end
 end
 
 # TODO add annotations on attributes (volatile, sensitive or do_not_serialize?)