nitc :: NoWarningPhase :: defaultinit
nitc $ NoWarningPhase :: SELF
Type of this instance, automatically specialized in every classnitc $ NoWarningPhase :: process_nmodule
Specific actions to execute on the whole tree of a modulenitc :: Phase :: _in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: _toolcontext
The toolcontext instance attached to the phasecore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: NoWarningPhase :: defaultinit
nitc :: Phase :: defaultinit
core :: Object :: defaultinit
nitc :: Phase :: in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: in_hierarchy=
The dependence relation of the phase with the other phasescore :: 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.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: Phase :: process_annotated_node
Specific actions to execute on annotated nodesnitc :: Phase :: process_mainmodule
Specific action to execute on the whole program.nitc :: Phase :: process_nclassdef
Specific actions to execute on the tree of a class definitionnitc :: Phase :: process_nmodule
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_nmodule_after
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_npropdef
Specific actions to execute on the tree of a propertynitc :: Phase :: toolcontext
The toolcontext instance attached to the phasenitc :: Phase :: toolcontext=
The toolcontext instance attached to the phase
private class NoWarningPhase
super Phase
redef fun process_nmodule(nmodule)
do
# Get the mmodule
var mmodule = nmodule.mmodule
if mmodule == null then return
var source = nmodule.location.file
var nmoduledecl = nmodule.n_moduledecl
if nmoduledecl == null or nmoduledecl.n_doc == null then
# Disable `missing-doc` if there is no `module` clause
# Rationale: the presence of a `module` clause is a good heuristic to
# discriminate quick and dirty prototypes from nice and clean modules
if source != null then toolcontext.warning_blacklist[source].add("missing-doc")
end
# If no decl block then quit
if nmoduledecl == null then return
var modelbuilder = toolcontext.modelbuilder
# Disable `missing-doc` for `test`
if source != null and not nmoduledecl.get_annotations("test").is_empty then
toolcontext.warning_blacklist[source].add("missing-doc")
end
# Get all the `no_warning` annotations
var name = "no_warning"
var annots = nmoduledecl.get_annotations(name)
if annots.is_empty then return
if source == null then
modelbuilder.warning(annots.first, "file-less-module", "Warning: `{name}` does not currently work on file-less modules.")
return
end
for annot in annots do
var args = annot.n_args
if args.is_empty then
modelbuilder.error(annot, "Syntax Error: `{name}` expects a list of warnings. Use `\"all\"` to disable all warnings.")
continue
end
for arg in args do
var tag = arg.as_string
if tag == null then
modelbuilder.error(arg, "Syntax Error: `{name}` expects String as arguments.")
continue
end
toolcontext.warning_blacklist[source].add(tag)
end
end
end
end
src/frontend/no_warning.nit:26,1--84,3