# generate and include its own serialization support module.
module nitserial
-import frontend
-import rapid_type_analysis
import template
+import gen_nit
-# A Nit module
-#
-# TODO add more features and move to lib
-class NitModule
- super Template
-
- var header: nullable Writable = null
-
- # The module's name
- var name: Writable
-
- # Imports from this module
- var imports = new Array[Writable]
-
- # Main content of this module
- var content = new Array[Writable]
-
- redef fun rendering
- do
- var header = header
- if header != null then add header
-
- var name = name
- add "module {name}\n\n"
-
- for i in imports do add "import {i}\n"
- add "\n"
-
- for l in content do add "{l}\n"
- end
-end
+import frontend
+import rapid_type_analysis
redef class ToolContext
# Where do we put a single result?
if importations == null then importations = target_modules
var nit_module = new NitModule(module_name)
+ nit_module.annotations.add """generated"""
+ nit_module.annotations.add """no_warning("property-conflict")"""
nit_module.header = """
# This file is generated by nitserial
# Do not modify, but you can redef