Firebreak.Source (Firebreak v0.1.0)

Copy Markdown View Source

Parses Elixir source into Firebreak.ModuleInfo structs.

This is pure, best-effort static extraction: we read the AST and recognise the common OTP shapes (use GenServer, Supervisor.init/2, child lists, GenServer.call/2, registered names, …). We never execute the code, so a child spec or call target assembled at runtime won't be resolved — those are reported as unresolved rather than guessed.

Summary

Functions

parse_file(path)

@spec parse_file(Path.t()) :: [Firebreak.ModuleInfo.t()]

parse_files(files)

@spec parse_files([Path.t()]) :: [Firebreak.ModuleInfo.t()]

parse_project(root, opts \\ [])

@spec parse_project(
  Path.t(),
  keyword()
) :: [Firebreak.ModuleInfo.t()]

Parse all source files of a project rooted at root.

parse_string(source, file \\ nil)

@spec parse_string(String.t(), String.t() | nil) :: [Firebreak.ModuleInfo.t()]