From 5ce1e70141ebd22311d5efb48ee3509635682df6 Mon Sep 17 00:00:00 2001 From: Florian Deljarry Date: Fri, 19 Apr 2019 17:25:02 -0400 Subject: [PATCH] modelize_property: Adding unsafe method to register an mpropdef Add method to register an MPropDef with an APropdef without verification Signed-off-by: Florian Deljarry --- src/modelize/modelize_property.nit | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modelize/modelize_property.nit b/src/modelize/modelize_property.nit index c8a7f3b..35e210e 100644 --- a/src/modelize/modelize_property.nit +++ b/src/modelize/modelize_property.nit @@ -42,6 +42,17 @@ redef class ModelBuilder # Public clients need to use `mpropdef2node` to access stuff. private var mpropdef2npropdef = new HashMap[MPropDef, APropdef] + # Associate a `npropdef` with its `mpropdef` + # + # Be careful, this method is unsafe, no checking is done when it's used. + # The safe way to add method it's to use the `build_property` + # + # See `mpropdef2npropdef` + fun unsafe_add_mpropdef2npropdef(mpropdef: MPropDef,npropdef: APropdef) + do + mpropdef2npropdef[mpropdef] = npropdef + end + # Retrieve the associated AST node of a mpropertydef. # This method is used to associate model entity with syntactic entities. # -- 1.7.9.5