Fate compiler #553

Merged
zxq9 merged 87 commits from fate-compiler into master 2019-05-07 22:48:47 +09:00
Showing only changes of commit c06e032199 - Show all commits

View File

@ -812,10 +812,10 @@ resolve_var(#{ vars := Vars } = Env, [X]) ->
resolve_var(Env, Q) -> resolve_fun(Env, Q).
resolve_fun(#{ fun_env := Funs, builtins := Builtin }, Q) ->
case maps:get(Q, maps:merge(Funs, Builtin), not_found) of
not_found -> fcode_error({unbound_variable, Q});
{B, Ar} -> {builtin, B, Ar};
Fun -> {def, Fun}
case {maps:get(Q, Funs, not_found), maps:get(Q, Builtin, not_found)} of
{not_found, not_found} -> fcode_error({unbound_variable, Q});
{_, {B, Ar}} -> {builtin, B, Ar};
{Fun, _} -> {def, Fun}
end.
init_fresh_names() ->