From d272e821b22f01050adc4fe3f82e32d38ff56f2f Mon Sep 17 00:00:00 2001 From: Hans Svensson Date: Tue, 3 Sep 2019 11:00:32 +0200 Subject: [PATCH] Implement aeb_fate_code:strip_init_function/1 --- src/aeb_fate_code.erl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/aeb_fate_code.erl b/src/aeb_fate_code.erl index 829a50d..cdb1b8c 100644 --- a/src/aeb_fate_code.erl +++ b/src/aeb_fate_code.erl @@ -19,6 +19,7 @@ , serialize/3 , serialize_code/1 , serialize_signature/1 + , strip_init_function/1 , symbol_identifier/1 , symbols/1 ]). @@ -92,6 +93,13 @@ insert_annotation(comment =_Type, Line, Comment, FCode) -> Value = aeb_fate_data:make_string(Comment), update_annotations(FCode, #{ Key => Value }). +strip_init_function(#fcode{ functions = Funs, + symbols = Syms } = FCode) -> + Id = symbol_identifier(<<"init">>), + Funs1 = maps:remove(Id, Funs), + Syms1 = maps:remove(Id, Syms), + FCode#fcode{ functions = Funs1, symbols = Syms1 }. + %%%=================================================================== %%% Serialization %%%===================================================================