Warn about break/continue in subshells and outside loops

This commit is contained in:
Vidar Holen
2014-02-01 23:45:26 -08:00
parent e8634a3c27
commit 8ec9fa43fd
2 changed files with 35 additions and 0 deletions

View File

@@ -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