Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика TPZ5720

    A labeled break or continue names a loop label that is not in scope.

    Diagnostic and cause

    Ссылка

    Unknown loop label

    Семейство
    topaz
    Этап
    check
    Код
    TPZ5720

    Причина и условия

    A labeled break must name an enclosing loop that is active at the statement. Breaking to an absent label is rejected with TPZ5720 at the break statement.

    Действия

    Declare the intended label immediately after loop, or use the label of an enclosing loop. The repaired program declares the label used by its break.

    Compiler phase: check.

    Compiler explanation: A labeled break or continue names a loop label that is not in scope.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • no loop labeled '⟨value⟩ in scope Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ5720]: no loop labeled 'missing in scope

    A labeled break must name an enclosing loop that is active at the statement. Breaking to an absent label is rejected with TPZ5720 at the break statement.

    Правилоdiagnostics.tpz5720.p5.rule

    Labeled break needs an enclosing loop

    A labeled break must name an enclosing loop that is active at the statement. Breaking to an absent label is rejected with TPZ5720 at the break statement.

    Response

    Ссылка

    Declare the intended label immediately after loop, or use the label of an enclosing loop. The repaired program declares the label used by its break.

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. loop {
    2. break 'missing
    3. }
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    Repaired program

    Ссылка
    example.tpzRepaired program
    1. loop 'missing {
    2. break 'missing
    3. }
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Меню

    Загрузка →