Current section

Files

Jump to
gserde src ast.erl
Raw

src/ast.erl

-module(ast).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([get_import_path_from_mod_name/2]).
-file("/Users/cdaringe/src/gserde/src/ast.gleam", 6).
-spec get_import_path_from_mod_name(binary(), request:request()) -> binary().
get_import_path_from_mod_name(Module_str, Req) ->
_pipe = gleam@list:find_map(
erlang:element(2, erlang:element(4, Req)),
fun(Imp) ->
Full_module_str = erlang:element(2, erlang:element(3, Imp)),
case (Full_module_str =:= Module_str) orelse gleam_stdlib:string_ends_with(
Full_module_str,
<<"/"/utf8, Module_str/binary>>
) of
true ->
{ok, Full_module_str};
_ ->
{error, nil}
end
end
),
evil:expect(
_pipe,
<<Module_str/binary, ": module not found in import list"/utf8>>
).