redef fun process_nmodule(nmodule)
do
# The AST node is not enough, we need also the associated model element
- var mmodule = nmodule.mmodule.as(not null)
+ var mmodule = nmodule.mmodule
+ if mmodule == null then return
# For the specific job we have, the simpler it to launch a visitor on
# all elements of the AST.
var visitor = new DivByZeroVisitor(toolcontext, mmodule)
if not op1.mtype.is_subtype(mmodule, null, int_type) then return
# Error detected
- toolcontext.error(node.location, "Error: Definitely division by zero")
+ toolcontext.warning(node.location, "div-by-zero", "Warning: division by zero.")
end
end