From: Florian Deljarry Date: Mon, 9 Mar 2020 18:56:14 +0000 (-0400) Subject: modelize_property: Add `unsafe_add_mclassdef2nclassdef` X-Git-Url: http://nitlanguage.org modelize_property: Add `unsafe_add_mclassdef2nclassdef` Add a way to associate a `nclassdef` with its `mclassdef` without verification. Signed-off-by: Florian Deljarry --- diff --git a/src/modelize/modelize_property.nit b/src/modelize/modelize_property.nit index 7aeffe8..a7acef6 100644 --- a/src/modelize/modelize_property.nit +++ b/src/modelize/modelize_property.nit @@ -53,6 +53,17 @@ redef class ModelBuilder mpropdef2npropdef[mpropdef] = npropdef end + # Associate a `nclassdef` with its `mclassdef` + # + # Be careful, this method is unsafe, no checking is done when it's used. + # The safe way to add mclass it's to use the `build_property` + # + # See `mclassdef2nclassdef` + fun unsafe_add_mclassdef2nclassdef(mclassdef: MClassDef, nclassdef: AClassdef) + do + mclassdef2nclassdef[mclassdef] = nclassdef + end + # Retrieve the associated AST node of a mpropertydef. # This method is used to associate model entity with syntactic entities. #