From ead7ff7026ea43820979f5e114fc4a6e919c5cf3 Mon Sep 17 00:00:00 2001 From: Florian Deljarry Date: Tue, 13 Aug 2019 12:13:30 -0400 Subject: [PATCH] astbuilder: Add a `create_callsite` method Add a `create_callsite` method to facilitate the construction of callsite. Signed-off-by: Florian Deljarry --- src/astbuilder.nit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/astbuilder.nit b/src/astbuilder.nit index 36f157f..d81ac6b 100644 --- a/src/astbuilder.nit +++ b/src/astbuilder.nit @@ -157,6 +157,14 @@ class ASTBuilder do return new AReturnExpr.make(expr) end + # Create a callsite with the given `mproperty`. Take the current method `actual_method` as a context + fun create_callsite(modelbuilder: ModelBuilder, actual_method : AMethPropdef, mproperty: MMethod, is_self_call: Bool): CallSite + do + var type_visitor = new TypeVisitor(modelbuilder, actual_method.mpropdef.as(not null)) + var callsite = type_visitor.build_callsite_by_property(actual_method, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call) + assert callsite != null + return callsite + end end redef class AExpr -- 1.7.9.5