Snex.Code (Snex v0.4.1)

Copy Markdown View Source

Struct representing a Python code snippet.

The location metadata is used for accurate stacktraces on Python side. Usually created automatically by ~p"my code" sigil from Snex.Sigils.

Summary

Functions

Ensures a code snippet is wrapped in a Snex.Code struct.

Types

t()

@type t() :: %Snex.Code{file: String.t(), line: non_neg_integer(), src: iodata()}

Functions

wrap(code)

@spec wrap(nil) :: nil
@spec wrap(iodata() | t()) :: t()

Ensures a code snippet is wrapped in a Snex.Code struct.