Skip to main content

count_instructions

Function count_instructions 

Source
pub fn count_instructions(stmts: &[Stmt]) -> u32
Expand description

Count instructions in a list of statements (AST-based, format-independent).

Every Stmt counts as 1 instruction. Compound statements (if/while/repeat/for) recurse into their body. FnDecl counts as 1 but does NOT recurse into the function body — this rewards defining reusable functions.