Modifier and type | Action and description |
---|---|
void | checkAmbiguousInterpretationMinusUnaryOperator(XUnaryOperation) Check if the call to an unary minus operator may be ambiguous interpretation for the SARL developer. |
void | checkAssertKeywordUse(SarlAssertExpression) Check for usage of assert keyword. |
void | checkAssumeKeywordUse(SarlAssertExpression) Check for usage of assert keyword. |
void | checkBreakKeywordUse(SarlBreakExpression) Check for usage of break inside loops. |
void | checkContinueKeywordUse(SarlContinueExpression) Check for usage of continue inside loops. |
void | checkDiscouragedCalls(XAbstractFeatureCall) Check if the call is discouraged. |
void | checkForbiddenCalls(XAbstractFeatureCall) Check if the call is forbidden. |
void | checkLeftHandSideIsVariable(XAssignment) |
void | checkOperatorSignature(XtendFunction) |
void | checkTernaryExpressionUsed(XIfExpression) |
new
def checkAmbiguousInterpretationMinusUnaryOperator(XUnaryOperation)
-125.abs
that is invoking the function Math.abs
with extension method notation. According to the precedence of the the SARL operator, this expression is interpreted as -abs(125)
and not abs(-125)
. Indeed the minus sign is an operator and not considered as a part of the number literal itself.
To avoid invalid interpretation of the expression by the SARL developper, a warning is generated.
def checkAssertKeywordUse(SarlAssertExpression)
def checkAssumeKeywordUse(SarlAssertExpression)
def checkBreakKeywordUse(SarlBreakExpression)
def checkContinueKeywordUse(SarlContinueExpression)
def checkDiscouragedCalls(XAbstractFeatureCall)
def checkForbiddenCalls(XAbstractFeatureCall)
def checkLeftHandSideIsVariable(XAssignment)
def checkOperatorSignature(XtendFunction)
def checkTernaryExpressionUsed(XIfExpression)