mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Make break/next/continue outside loops an error (6.1 deprecation)
This commit is contained in:
parent
9a79b98a1e
commit
0110c15ee2
11 changed files with 15 additions and 17 deletions
|
@ -22,13 +22,11 @@ public:
|
|||
stmt_depths[stmt->Tag()] += 1;
|
||||
|
||||
if ( stmt->Tag() == STMT_BREAK && ! BreakStmtIsValid() )
|
||||
Report(stmt, "break statement used outside of for, while or "
|
||||
"switch statement and not within a hook. "
|
||||
"With v6.1 this will become an error.");
|
||||
Error(stmt, "break statement used outside of for, while or "
|
||||
"switch statement and not within a hook.");
|
||||
|
||||
if ( stmt->Tag() == STMT_NEXT && ! NextStmtIsValid() )
|
||||
Report(stmt, "next statement used outside of for or while statement. "
|
||||
"With v6.1 this will become an error.");
|
||||
Error(stmt, "next statement used outside of for or while statement.");
|
||||
|
||||
return TC_CONTINUE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue