Shared helper functions for Choreo Lab DSL compilers.
This module encapsulates AST parsing and utility operations used during macro expansion of the experimental diagram DSLs.
Summary
Functions
Recursively compiles all statements in a block using a provided processor function.
Extracts a do block from a constructor statement (assigned or inline).
Returns {block, stripped_statement} or {nil, nil}.
Extracts line metadata from an AST node.
Formats a line number suffix for error messages.
Pops a do block from an argument list.
Pops trailing options (a keyword list) from an argument list.
Derives a snake_case atom from a string or atom label.
Unwraps a block or single statement into a list of statements.
Unwraps a pipeline of modifications.
Functions
@spec compile_block_statements(Macro.t(), any(), (Macro.t(), any() -> {any(), any()})) :: {any(), any()}
Recursively compiles all statements in a block using a provided processor function.
Extracts a do block from a constructor statement (assigned or inline).
Returns {block, stripped_statement} or {nil, nil}.
Extracts line metadata from an AST node.
Formats a line number suffix for error messages.
Pops a do block from an argument list.
Pops trailing options (a keyword list) from an argument list.
Derives a snake_case atom from a string or atom label.
Unwraps a block or single statement into a list of statements.
Unwraps a pipeline of modifications.