From c6fbaaaf7513cb8e2c0350b0350ed8f73e839499 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Tue, 14 Mar 2023 08:06:32 +0300 Subject: [PATCH] Split complicated code and add comment --- src/aeso_fcode_to_fate.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aeso_fcode_to_fate.erl b/src/aeso_fcode_to_fate.erl index 200e2cf..b8df547 100644 --- a/src/aeso_fcode_to_fate.erl +++ b/src/aeso_fcode_to_fate.erl @@ -118,8 +118,12 @@ function_to_scode(ChildContracts, ContractName, Functions, Name, Attrs0, Args, B Attrs = [ A || A <- Attrs0, A == private orelse A == payable ], Env = init_env(ChildContracts, ContractName, Functions, Name, Args, SavedFreshNames, Options), ArgsNames = [ X || {X, _} <- lists:reverse(Env#env.vars) ], - SCode = dbg_scoped_vars(Env, ArgsNames, dbg_loc(Env, Attrs0) ++ to_scode(Env, Body)), - {Attrs, {ArgTypes, ResType1}, SCode}. + + %% DBG_LOC is added before the function body to make it possible to break + %% at the function signature + SCode = dbg_loc(Env, Attrs0) ++ to_scode(Env, Body), + ScopedSCode = dbg_scoped_vars(Env, ArgsNames, SCode), + {Attrs, {ArgTypes, ResType1}, ScopedSCode}. -define(tvars, '$tvars').