MQL parses Elixir and Erlang lock files to identify dependencies. Because these files use language-specific term syntax rather than standard formats like JSON, MQL uses regex-based extraction to identify package names and versions.
Elixir mix.lock format
Entries are represented as a map of package names to tuples.
Entry structure: "name": {:hex, :name, "version", "hash", build_tools, deps, "repo", "outer_hash"}
Example:
%{
"jason": {:hex, :jason, "1.4.1", "af1chabc...", [:mix], [], "hexpm", "fdfhash..."}
}
Erlang rebar.lock format
Entries are represented as a list of package tuples.
Entry structure: {<<"name">>, {pkg, <<"name">>, <<"version">>, <<"hash">>}, level}
Example:
[{<<"cowboy">>, {pkg, <<"cowboy">>, <<"2.10.0">>, <<"hash...">>}, 0}]
Package Identification
Both ecosystems use the Hex PURL scheme for identification:
- PURL Pattern:
pkg:hex/<name>@<version>
# Elixir mix.lock example
"jason": {:hex, :jason, "1.4.1", "af1chabc...", [:mix], [], "hexpm", "fdfhash..."}
# Erlang rebar.lock example
{<<"cowboy">>, {pkg, <<"cowboy">>, <<"2.10.0">>, <<"hash...">>}, 0}