From b8f4a6b67a8285cd2b6fef7e88376ebff50c66b0 Mon Sep 17 00:00:00 2001 From: Thomas Arts Date: Mon, 7 Jan 2019 19:54:53 +0100 Subject: [PATCH] Get rid of lager in the compiler --- src/aeso_abi.erl | 16 ---------------- src/aeso_ast_to_icode.erl | 7 +++---- src/aesophia.app.src | 1 - 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/aeso_abi.erl b/src/aeso_abi.erl index bd7c778..b1df002 100644 --- a/src/aeso_abi.erl +++ b/src/aeso_abi.erl @@ -32,19 +32,6 @@ }. -type type_info() :: [function_type_info()]. --ifdef(COMMON_TEST). --define(TEST_LOG(Format, Data), - try ct:log(Format, Data) - catch - %% Enable setting up node with "test" rebar profile. - error:undef -> ok - end). --define(DEBUG_LOG(Format, Data), begin lager:debug(Format, Data), ?TEST_LOG(Format, Data) end). --else. --define(TEST_LOG(Format, Data), ok). --define(DEBUG_LOG(Format, Data), lager:debug(Format, Data)). --endif. - %%%=================================================================== %%% API %%%=================================================================== @@ -112,15 +99,12 @@ check_calldata(CallData, TypeInfo) -> {error, bad_call_data} catch _T:_E -> - ?TEST_LOG("Error parsing call data: ~p", [{_T, _E}]), {error, bad_call_data} end; {error, _} -> - ?TEST_LOG("Unknown function hash ~p", [Hash]), {error, unknown_function} end; {error, _What} -> - ?TEST_LOG("Bad call data ~p", [_What]), {error, bad_call_data} end. diff --git a/src/aeso_ast_to_icode.erl b/src/aeso_ast_to_icode.erl index 629e700..77508c0 100644 --- a/src/aeso_ast_to_icode.erl +++ b/src/aeso_ast_to_icode.erl @@ -94,8 +94,8 @@ contract_to_icode([{letrec,_,Defs}|Rest], Icode) -> %% just to parse a list of (mutually recursive) definitions. contract_to_icode(Defs++Rest, Icode); contract_to_icode([], Icode) -> Icode; -contract_to_icode(Code, Icode) -> - lager:debug("Unhandled code ~p~n",[Code]), +contract_to_icode(_Code, Icode) -> + %% TODO debug output for debug("Unhandled code ~p~n",[Code]), Icode. ast_id({id, _, Id}) -> Id. @@ -444,9 +444,8 @@ ast_body({typed,_,{record,Attrs,Fields},{record_t,DefFields}}, Icode) -> NamedField = fun({field, _, [{proj, _, {id, _, Name}}], E}) -> {Name, E} end, NamedFields = lists:map(NamedField, Fields), #tuple{cpts = - [case proplists:get_value(Name,NamedFields) of + [case proplists:get_value(Name, NamedFields) of undefined -> - lager:debug("~p not in ~p\n", [Name, NamedFields]), Line = aeso_syntax:get_ann(line, Attrs), #missing_field{format = "Missing field in record: ~s (on line ~p)\n", args = [Name,Line]}; diff --git a/src/aesophia.app.src b/src/aesophia.app.src index 1e43dc3..e796d6a 100644 --- a/src/aesophia.app.src +++ b/src/aesophia.app.src @@ -5,7 +5,6 @@ {applications, [kernel, stdlib, - lager, aebytecode ]}, {env,[]},