model/model_contract: Move contract model representation
[nit.git] / src / model / model_filters.nit
index 2c6cead..0d47a92 100644 (file)
@@ -41,6 +41,22 @@ import parse_annotations
 # ~~~
 class ModelFilter
 
+       # Initialize `self` by copying the options from another `filter`
+       init from(filter: ModelFilter) do
+               init(
+                       min_visibility = filter.min_visibility,
+                       accept_fictive = filter.accept_fictive,
+                       accept_test = filter.accept_test,
+                       accept_redef = filter.accept_redef,
+                       accept_extern = filter.accept_extern,
+                       accept_example = filter.accept_example,
+                       accept_attribute = filter.accept_attribute,
+                       accept_empty_doc = filter.accept_empty_doc,
+                       accept_inherited = filter.accept_inherited,
+                       accept_full_name = filter.accept_full_name
+               )
+       end
+
        # Accept `mentity` based on all the options from `self`?
        #
        # If one of the filter returns `false` then the `mentity` is not accepted.
@@ -184,7 +200,7 @@ class ModelFilter
        # Accept examples?
        #
        # Default is `true`.
-       var accept_example = true is optional
+       var accept_example = true is optional, writable
 
        # Accept only entities that are not example related
        fun accept_mentity_example(mentity: MEntity): Bool do
@@ -193,7 +209,7 @@ class ModelFilter
        end
 
        # If set, accept only entities local to `accept_inherited`
-       var accept_inherited: nullable MEntity = null is optional
+       var accept_inherited: nullable MEntity = null is optional, writable
 
        # Accept only entities local to `accept_inherited`
        #