nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92a8d6c
)
model_utils: add attributes count (local + inherited) in MClass
author
Alexandre Terrasa
<alexandre@moz-code.org>
Tue, 25 Mar 2014 21:25:05 +0000
(17:25 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 25 Apr 2014 01:56:59 +0000
(21:56 -0400)
src/model_utils.nit
patch
|
blob
|
history
diff --git
a/src/model_utils.nit
b/src/model_utils.nit
index
5347128
..
f893b8d
100644
(file)
--- a/
src/model_utils.nit
+++ b/
src/model_utils.nit
@@
-175,6
+175,14
@@
redef class MClass
return set
end
+ # the set of all accessible mattributes for this class
+ fun all_mattributes(mainmodule: MModule, min_visibility: MVisibility): Set[MAttribute] do
+ var set = new HashSet[MAttribute]
+ for mprop in all_mproperties(mainmodule, min_visibility) do
+ if mprop isa MAttribute then set.add(mprop)
+ end
+ return set
+ end
# Get the list of locally refined methods in 'self'.
fun redef_methods: Set[MMethod] do
@@
-247,6
+255,7
@@
redef class MClass
end
end
+
# Sorters
# Sort mmodules by their name