modelize_property: Add `unsafe_add_mclassdef2nclassdef`
authorFlorian Deljarry <deljarry.florian@gmail.com>
Mon, 9 Mar 2020 18:56:14 +0000 (14:56 -0400)
committerFlorian Deljarry <deljarry.florian@gmail.com>
Thu, 9 Apr 2020 13:40:45 +0000 (09:40 -0400)
Add a way to associate a `nclassdef` with its `mclassdef` without verification.

Signed-off-by: Florian Deljarry <deljarry.florian@gmail.com>

src/modelize/modelize_property.nit

index 7aeffe8..a7acef6 100644 (file)
@@ -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.
        #