42. DECS, AST block to loop¶
The ast_block_to_loop module implements block to loop conversion as part of the DECS infrastructure.
All functions and symbols are in “ast_block_to_loop” module, use require to get access to it.
require daslib/ast_block_to_loop
42.1. Block to loop conversion¶
-
convert_block_to_loop
(blk: smart_ptr<Expression>; failOnReturn: bool const; replaceReturnWithContinue: bool const; requireContinueCond: bool const)¶
argument |
argument type |
---|---|
blk |
smart_ptr< ast::Expression > |
failOnReturn |
bool const |
replaceReturnWithContinue |
bool const |
requireContinueCond |
bool const |
Converts closure block to loop. If failOnReturn is true, then returns are not allowed inside the block. If replaceReturnWithContinue is true, then return cond; are replaced with if cond; continue;. If requireContinueCond is false, then return; is replaced with continue;, otherwise it is an error.