@extends(main)

# Test Break Continue

code | result

    @verbatim() {
    @for (int i = 0; i < 5; ++i) {
       current number is: @i
       @if (i > 2) {
           @break
       }
       next number is :@(i + 1)
    }
    }
| @for (int i = 0; i < 5; ++i) { current number is: @i @if (i > 2) { @break } next number is :@(i + 1) }

    @verbatim() {
    @for (int i = 0; i < 5; ++i) {
       current number is: @i
       @if (i < 2) {
           @continue
       }
       next number is :@(i + 1)
    }
    }
| @for (int i = 0; i < 5; ++i) { current number is: @i @if (i < 2) { @continue } next number is :@(i + 1) }

@{Integer[] ia = {1, 2, 3, 4, 5}}

code | result

    @verbatim() {
    @for (Integer i : ia) {
       current number is: @i
        @if (i > 2) {
            @break
        }
        next number is :@(i + 1)
    }
    }
| @for (Integer i : ia) { current number is: @i @if (i > 2) { @break } next number is :@(i + 1) }

    @verbatim() {
    @for (Integer i : ia) {
       current number is: @i
        @if (i < 2) {
            @continue
        }
        next number is :@(i + 1)
    }
    }
| @for (Integer i : ia) { current number is: @i @if (i < 2) { @continue } next number is :@(i + 1) }

@include(tmpl_src)