From 4cd5b9d413431b3026025f2ea2e2098a0ec0ce3c Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Mon, 28 Jul 2014 16:09:51 -0400 Subject: [PATCH] src: use `get_annotations` instead of `collect_annotations_by_name` The former does what is implied, the second is a deep search Update the comment on the latter. Signed-off-by: Jean Privat --- src/android_annotations.nit | 4 ++-- src/parser_util.nit | 4 ++-- src/serialization_phase.nit | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/android_annotations.nit b/src/android_annotations.nit index 7e9f43a..799a548 100644 --- a/src/android_annotations.nit +++ b/src/android_annotations.nit @@ -109,7 +109,7 @@ redef class ModelBuilder var amod = mmodule2nmodule[mmod] var module_decl = amod.n_moduledecl if module_decl == null then continue - var aas = module_decl.collect_annotations_by_name(name) + var aas = module_decl.get_annotations(name) annotations.add_all aas end return annotations @@ -123,7 +123,7 @@ redef class ModelBuilder var amod = mmodule2nmodule[mmodule] var module_decl = amod.n_moduledecl if module_decl != null then - var annotations = module_decl.collect_annotations_by_name(name) + var annotations = module_decl.get_annotations(name) if annotations.length == 1 then return annotations.first else if annotations.length > 1 then diff --git a/src/parser_util.nit b/src/parser_util.nit index 54ccab2..ff97a78 100644 --- a/src/parser_util.nit +++ b/src/parser_util.nit @@ -248,7 +248,7 @@ class InjectedLexer end redef class ANode - # Return an array of tokens that match a given text + # Do a deep search and return an array of tokens that match a given text fun collect_tokens_by_text(text: String): Array[Token] do var v = new CollectTokensByTextVisitor(text) @@ -256,7 +256,7 @@ redef class ANode return v.result end - # Return an array of node that are annotated + # Do a deep search and return an array of node that are annotated # The attached node can be retrieved by two invocation of parent fun collect_annotations_by_name(name: String): Array[AAnnotation] do diff --git a/src/serialization_phase.nit b/src/serialization_phase.nit index c3b0dc0..ec472c2 100644 --- a/src/serialization_phase.nit +++ b/src/serialization_phase.nit @@ -64,7 +64,7 @@ private class SerializationPhasePreModel var auto_serializable_nclassdefs = new Array[AStdClassdef] for nclassdef in nmodule.n_classdefs do if nclassdef isa AStdClassdef and - not nclassdef.collect_annotations_by_name("auto_serializable").is_empty then + not nclassdef.get_annotations("auto_serializable").is_empty then auto_serializable_nclassdefs.add nclassdef end end -- 1.7.9.5