Get rid of lager in the compiler

This commit is contained in:
Thomas Arts 2019-01-07 19:54:53 +01:00
parent 4853d386e4
commit b8f4a6b67a
3 changed files with 3 additions and 21 deletions

View File

@ -32,19 +32,6 @@
}. }.
-type type_info() :: [function_type_info()]. -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 %%% API
%%%=================================================================== %%%===================================================================
@ -112,15 +99,12 @@ check_calldata(CallData, TypeInfo) ->
{error, bad_call_data} {error, bad_call_data}
catch catch
_T:_E -> _T:_E ->
?TEST_LOG("Error parsing call data: ~p", [{_T, _E}]),
{error, bad_call_data} {error, bad_call_data}
end; end;
{error, _} -> {error, _} ->
?TEST_LOG("Unknown function hash ~p", [Hash]),
{error, unknown_function} {error, unknown_function}
end; end;
{error, _What} -> {error, _What} ->
?TEST_LOG("Bad call data ~p", [_What]),
{error, bad_call_data} {error, bad_call_data}
end. end.

View File

@ -94,8 +94,8 @@ contract_to_icode([{letrec,_,Defs}|Rest], Icode) ->
%% just to parse a list of (mutually recursive) definitions. %% just to parse a list of (mutually recursive) definitions.
contract_to_icode(Defs++Rest, Icode); contract_to_icode(Defs++Rest, Icode);
contract_to_icode([], Icode) -> Icode; contract_to_icode([], Icode) -> Icode;
contract_to_icode(Code, Icode) -> contract_to_icode(_Code, Icode) ->
lager:debug("Unhandled code ~p~n",[Code]), %% TODO debug output for debug("Unhandled code ~p~n",[Code]),
Icode. Icode.
ast_id({id, _, Id}) -> Id. ast_id({id, _, Id}) -> Id.
@ -446,7 +446,6 @@ ast_body({typed,_,{record,Attrs,Fields},{record_t,DefFields}}, Icode) ->
#tuple{cpts = #tuple{cpts =
[case proplists:get_value(Name, NamedFields) of [case proplists:get_value(Name, NamedFields) of
undefined -> undefined ->
lager:debug("~p not in ~p\n", [Name, NamedFields]),
Line = aeso_syntax:get_ann(line, Attrs), Line = aeso_syntax:get_ann(line, Attrs),
#missing_field{format = "Missing field in record: ~s (on line ~p)\n", #missing_field{format = "Missing field in record: ~s (on line ~p)\n",
args = [Name,Line]}; args = [Name,Line]};

View File

@ -5,7 +5,6 @@
{applications, {applications,
[kernel, [kernel,
stdlib, stdlib,
lager,
aebytecode aebytecode
]}, ]},
{env,[]}, {env,[]},