end
return max + 1
end
+
+ # Find all mmodules nested in `self` if `self` is the default module of a `MGroup`.
+ fun nested_mmodules: Array[MModule] do
+ var res = new Array[MModule]
+ var mgroup = mgroup
+ if mgroup == null or self != mgroup.default_mmodule then return res
+ for mmodule in mgroup.mmodules do
+ if mmodule == self then continue
+ res.add mmodule
+ end
+ for nested in mgroup.in_nesting.direct_smallers do
+ var default = nested.default_mmodule
+ if default == null then continue
+ res.add default
+ end
+ return res
+ end
end
redef class MClass
super Comparator
redef type COMPARED: MEntity
redef fun compare(a, b) do return a.name <=> b.name
- init do end
end
# Sort MConcerns based on the module importation hierarchy ranking
#
# Comparison is made with the formula:
#
-# a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~nitish
+# a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~
#
# If both `a` and `b` have the same ranking,
# ordering is based on lexicographic comparison of `a.name` and `b.name`
super Comparator
redef type COMPARED: MConcern
- init do end
-
redef fun compare(a, b) do
if a.concern_rank == b.concern_rank then
return a.name <=> b.name