i += 1
end
- add "# Lexer generated by nitcc for the grammar {name}"
+ add "# Lexer generated by nitcc for the grammar {name}\n"
+ add "module {name}_lexer is no_warning \"missing-doc\"\n"
add("import nitcc_runtime\n")
var p = parser
var gram = autom.grammar
add "# Parser generated by nitcc for the grammar {name}"
+ add "module {name}_parser is no_warning(\"missing-doc\",\"old-init\")"
add "import nitcc_runtime"
add "class Parser_{name}"
f = new OFStream.open("{name}_test_parser.nit")
f.write """# Generated by nitcc for the language {{{name}}}
+
+# Standalone parser tester for the language {{{name}}}
+module {{{name}}}_test_parser
import nitcc_runtime
import {{{name}}}_lexer
import {{{name}}}_parser
+
+# Class to test the parser for the language {{{name}}}
class TestParser_{{{name}}}
super TestParser
redef fun name do return \"{{{name}}}\"
# Lexer and its tokens.
# This file was generated by SableCC (http://www.sablecc.org/).
-module lexer
+module lexer is no_warning("missing-doc", "old-init")
intrude import parser_nodes
private import tables
# Parser.
# This file was generated by SableCC (http://www.sablecc.org/).
-module parser
+module parser is no_warning("missing-doc", "old-init")
intrude import parser_prod
import tables
# Raw AST node hierarchy.
# This file was generated by SableCC (http://www.sablecc.org/).
-module parser_nodes
+module parser_nodes is no_warning("missing-doc", "old-init")
import location
# Production AST nodes full definition.
# This file was generated by SableCC (http://www.sablecc.org/).
-module parser_prod
+module parser_prod is no_warning("missing-doc")
import lexer
intrude import parser_nodes
-# Lexer generated by nitcc for the grammar jsonimport nitcc_runtime
+# Lexer generated by nitcc for the grammar json
+module json_lexer is no_warning "missing-doc"
+import nitcc_runtime
import json_parser
class Lexer_json
super Lexer
# Parser generated by nitcc for the grammar json
+module json_parser is no_warning("missing-doc","old-init")
import nitcc_runtime
class Parser_json
super Parser
import ffi_base
redef class ToolContext
- var extern_classes_typing_phase_ast: Phase = new ExternClassesTypingPhaseAst(self, [ffi_language_assignation_phase])
+ var extern_classes_typing_phase_ast: Phase = new ExternClassesTypingPhaseAst(self, [ffi_language_assignation_phase, modelize_class_phase])
var extern_classes_typing_phase_model: Phase = new ExternClassesTypingPhaseModel(self,
[extern_classes_typing_phase_ast, modelize_class_phase, modelize_property_phase])
# SEE `dummy`
private fun do_dummy: Bool
do
+ # Force no warning before analysing classes
+ phases.add_edge(modelize_class_phase, no_warning_phase)
# Force easy warnings after modelbuilder
phases.add_edge(simple_misc_analysis_phase, modelize_property_phase)
# Force easy warnings before intraproc-errors
var modelbuilder = toolcontext.modelbuilder
- # Get all the new annotations
+ var source = nmodule.location.file
+
+ # Disable `missing-doc` for `test_suite`
+ if source != null and not nmoduledecl.get_annotations("test_suite").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
- var source = nmodule.location.file
if source == null then
modelbuilder.warning(annots.first, "file-less-module", "Warning: annotation `{name}` does not currently work on file-less modules.")
return