10.7. Boost package for macro manipulations
The MACRO_BOOST module provides utility macros for macro authors, including pattern matching on AST nodes, code generation helpers, and common transformation patterns used when writing compile-time code.
All functions and symbols are in “macro_boost” module, use require to get access to it.
require daslib/macro_boost
10.7.1. Structures
- CapturedVariable
struct CapturedVariable
10.7.2. Function annotations
- MacroVerifyMacro
Function annotation MacroVerifyMacro
10.7.3. Implementation details
- macro_verify(expr: bool; prog: ProgramPtr; at: LineInfo; message: string )
def macro_verify (expr: bool; prog: ProgramPtr; at: LineInfo; message: string)
- Arguments:
expr : bool
prog : ProgramPtr
at : LineInfo
message : string
10.7.4. Block analysis
- capture_block(expr: ExpressionPtr ): array<CapturedVariable>
def capture_block (expr: ExpressionPtr) : array<CapturedVariable>
- Arguments:
expr : ExpressionPtr
- collect_finally(expr: ExpressionPtr; alwaysFor: bool = false ): array<ExprBlock?>
def collect_finally (expr: ExpressionPtr; alwaysFor: bool = false) : array<ExprBlock?>
- Arguments:
expr : ExpressionPtr
alwaysFor : bool
- collect_labels(expr: ExpressionPtr ): array<int>
def collect_labels (expr: ExpressionPtr) : array<int>
- Arguments:
expr : ExpressionPtr
10.7.5. Expression analysis
- has_sideeffects(expr: Expression? ): bool
def has_sideeffects (expr: Expression?) : bool
- Arguments:
expr : Expression?