nitc :: SimpleMiscVisitor :: check_do_expr
Issue a warning ifsub
is a standalone do
block.
nitc :: SimpleMiscVisitor :: defaultinit
nitc :: SimpleMiscVisitor :: once_count=
Number of nested oncenitc :: SimpleMiscVisitor :: toolcontext
nitc $ SimpleMiscVisitor :: SELF
Type of this instance, automatically specialized in every classnitc $ SimpleMiscVisitor :: visit
What the visitor do when a node is visitednitc :: SimpleMiscVisitor :: check_do_expr
Issue a warning ifsub
is a standalone do
block.
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: Visitor :: current_node=
The current visited nodecore :: Object :: defaultinit
nitc :: SimpleMiscVisitor :: defaultinit
nitc :: Visitor :: defaultinit
nitc :: Visitor :: enter_visit
Ask the visitor to visit a given node.core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.nitc :: SimpleMiscVisitor :: once_count=
Number of nested oncecore :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: SimpleMiscVisitor :: toolcontext
private class SimpleMiscVisitor
super Visitor
redef fun visit(n)
do
n.accept_simple_misc(self)
end
# Number of nested once
var once_count: Int = 0
var toolcontext: ToolContext
fun warning(node: ANode, tag, msg: String)
do
toolcontext.warning(node.hot_location, tag, msg)
end
# Issue a warning if `sub` is a standalone `do` block.
fun check_do_expr(sub: nullable AExpr)
do
if sub isa ADoExpr then
warning(sub, "useless-do", "Warning: superfluous `do` block.")
end
end
end
src/frontend/simple_misc_analysis.nit:52,1--76,3