ExAST.Comments (ExAST v0.12.0)

Copy Markdown View Source

Extracts comments from Elixir source while preserving source positions.

Summary

Functions

associated(source, range, relation \\ :comment)

@spec associated(String.t(), Sourceror.Range.t(), atom()) :: [ExAST.Comment.t()]

Returns comments associated with a source range.

Relations are :comment, :before, :after, :inside, and :inline. :comment includes before, inside, and inline comments.

extract(source)

@spec extract(String.t()) :: [ExAST.Comment.t()]

text(source)

@spec text(String.t()) :: String.t()