mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-14 02:27:30 -07:00
Warn about break/continue in subshells and outside loops
This commit is contained in:
parent
e8634a3c27
commit
8ec9fa43fd
2 changed files with 35 additions and 0 deletions
|
@ -342,3 +342,10 @@ doAnalysis f t = analyze f blank id t
|
|||
doStackAnalysis startToken endToken t = analyze startToken endToken id t
|
||||
doTransform i t = runIdentity $ analyze blank blank i t
|
||||
|
||||
isLoop t = case t of
|
||||
T_WhileExpression _ _ _ -> True
|
||||
T_UntilExpression _ _ _ -> True
|
||||
T_ForIn _ _ _ _ -> True
|
||||
T_ForArithmetic _ _ _ _ _ -> True
|
||||
T_SelectIn _ _ _ _ -> True
|
||||
_ -> False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue