From 417ea0c1d77794f25db534b5c0eda3ced5d95c45 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 8 Jan 2015 22:50:17 -0500 Subject: [PATCH] model: add `MModule::mproject` to simplify clients Signed-off-by: Jean Privat --- src/model/mmodule.nit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/model/mmodule.nit b/src/model/mmodule.nit index e66f164..2b1e2e5 100644 --- a/src/model/mmodule.nit +++ b/src/model/mmodule.nit @@ -76,6 +76,14 @@ class MModule # The group of module in the project if any var mgroup: nullable MGroup + # The project of the module if any + # Safe alias for `mgroup.mproject` + fun mproject: nullable MProject + do + var g = mgroup + if g == null then return null else return g.mproject + end + # The short name of the module redef var name: String -- 1.7.9.5