33. Boost package for the miscelanious macro manipulations

Apply module implements miscellaneous infrastructure which simplifies writing of macros.

All functions and symbols are in “macro_boost” module, use require to get access to it.

require daslib/macro_boost
CapturedVariable

CapturedVariable fields are

variable

ast::Variable ?

expression

ast::ExprVar ?

Stored captured variable together with the ExprVar which uses it

33.1. Function annotations

MacroVerifyMacro

This macro implements macro_verify macro. It’s equivalent to a function call:

def macro_verify ( expr:bool; prog:ProgramPtr; at:LineInfo; message:string )

However, result will be substituted with:

if !expr
    macro_error( prog, at, message )
    return [[ExpressionPtr]]

33.2. Call macros

return_skip_lockcheck

this is similar to regular return <-, but it does not check for locks

33.3. Implementation details

macro_verify(expr: bool const; prog: ProgramPtr; at: LineInfo const; message: string const)

argument

argument type

expr

bool const

prog

ProgramPtr

at

rtti::LineInfo const

message

string const

Same as verify, only the check will produce macro error, followed by return [[ExpressionPtr]]

33.4. Uncategorized

capture_block(expr: ExpressionPtr)

capture_block returns array< macro_boost::CapturedVariable >

argument

argument type

expr

ExpressionPtr

Collect all captured variables in the expression.

collect_finally(expr: ExpressionPtr)

collect_finally returns array< ast::ExprBlock ?>

argument

argument type

expr

ExpressionPtr

Collect all finally blocks in the expression. Returns array of ExprBlock? with all the blocks which have finally section Does not go into ‘make_block’ expression, such as lambda, or ‘block’ expressions

collect_labels(expr: ExpressionPtr)

collect_labels returns array<int>

argument

argument type

expr

ExpressionPtr

Collect all labels in the expression. Returns array of integer with label indices Does not go into ‘make_block’ expression, such as lambda, or ‘block’ expressions