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.
Связанное правило · Labeled break needs an enclosing loop →Действия
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
'missingin 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.
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
Ссылкаloop {break 'missing}
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
diagnostic-tpz5720 at
example.tpz:2:3
Repaired program
Ссылкаloop 'missing {break 'missing}
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.