From 1e0e00911a543b95e8af375d8447d8904c95c8f5 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 15 May 2018 12:50:11 -0400 Subject: [PATCH] model_filters: allow copy of filter options Signed-off-by: Alexandre Terrasa --- src/model/model_filters.nit | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/model/model_filters.nit b/src/model/model_filters.nit index 85f1042..0d47a92 100644 --- a/src/model/model_filters.nit +++ b/src/model/model_filters.nit @@ -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. -- 1.7.9.5