Skip to content
  • Gregor Jasny's avatar
    Track nested loop levels in CMake language with a stack of counters · bae604d9
    Gregor Jasny authored and Brad King's avatar Brad King committed
    
    
    It gets incremented while entering a loop block (e.g. foreach or while)
    and gets decremented when leaving the block. Because scope borders for
    example at function borders must be taken into account the counter is
    put into a stack. With every new scope an empty counter is pushed on the
    stack, when leaving the scope the original value is restored.
    
    This will allow easy querying if the break command is properly nested
    within a loop scope.
    
    Signed-off-by: default avatarGregor Jasny <gjasny@googlemail.com>
    bae604d9