@ Check public void checkBreakKeywordUse ( SarlBreakExpression expression ) { final EObject container = Utils . getFirstContainerForPredicate ( expression , it -> ! ( it instanceof XExpression ) || it instanceof XAbstractWhileExpression || it instanceof XBasicForLoopExpression || it instanceof XForLoopExpression ) ; if ( container instanceof XExpression ) { if ( ! isIgnored ( DISCOURAGED_LOOP_BREAKING_KEYWORD_USE ) && container instanceof XBasicForLoopExpression ) { addIssue ( MessageFormat . format ( Messages . SARLValidator_17 , this . grammarAccess . getBreakKeyword ( ) ) , expression , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , DISCOURAGED_LOOP_BREAKING_KEYWORD_USE ) ; } } else { error ( MessageFormat . format ( Messages . SARLValidator_18 , this . grammarAccess . getBreakKeyword ( ) ) , expression , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , INVALID_USE_OF_LOOP_BREAKING_KEYWORD ) ; } }
Check for usage of break inside loops .