Merge: gamnit: bug fixes, updated doc and prepare iOS support
authorJean Privat <jean@pryen.org>
Fri, 12 Jan 2018 13:34:37 +0000 (08:34 -0500)
committerJean Privat <jean@pryen.org>
Fri, 12 Jan 2018 13:34:37 +0000 (08:34 -0500)
This PR brings miscellaneous improvements to the `gamnit` graphics framework, see each commit description for more details.

Pull-Request: #2597
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

110 files changed:
lib/android/audio.nit
lib/core/README.md
lib/popcorn/pop_json.nit
share/man/nitx.md
share/nitweb/directives/entity/card.html
share/nitweb/directives/entity/defcard.html
share/nitweb/directives/entity/link.html
share/nitweb/directives/entity/location.html
share/nitweb/directives/entity/signature.html
share/nitweb/directives/ui/pagination.html
share/nitweb/javascripts/catalog.js
share/nitweb/javascripts/entities.js
share/nitweb/javascripts/ui.js
share/nitweb/views/catalog/index.html
share/nitweb/views/catalog/tag.html
share/nitweb/views/doc/code.html
share/nitweb/views/doc/defs.html
share/nitweb/views/doc/doc.html
share/nitweb/views/doc/graph.html
share/nitweb/views/doc/lin.html
src/doc/api/api.nit [moved from src/web/web.nit with 95% similarity]
src/doc/api/api_auth.nit [moved from src/web/api_auth.nit with 98% similarity]
src/doc/api/api_base.nit [new file with mode: 0644]
src/doc/api/api_docdown.nit [new file with mode: 0644]
src/doc/api/api_feedback.nit [moved from src/web/api_feedback.nit with 93% similarity]
src/doc/api/api_light.nit [moved from src/web/api_light.nit with 95% similarity]
src/doc/api/api_metrics.nit [moved from src/web/api_metrics.nit with 99% similarity]
src/doc/api/api_model.nit [new file with mode: 0644]
src/doc/commands/commands_json.nit
src/doc/commands/commands_model.nit
src/doc/commands/commands_parser.nit
src/doc/commands/tests/test_commands_json.sav/test_cmd_ancestors.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_call.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_children.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_descendants.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_entity.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_features.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_lin.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_mentities.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_parents.res
src/doc/commands/tests/test_commands_json.sav/test_cmd_search.res
src/doc/console_templates/console_model.nit [deleted file]
src/doc/console_templates/console_templates.nit [deleted file]
src/doc/doc_phases/doc_console.nit [deleted file]
src/doc/templates/templates_json.nit [new file with mode: 0644]
src/doc/templates/templates_term.nit [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.nit [moved from src/model/test_model_json.nit with 79% similarity]
src/doc/templates/tests/test_templates_json.sav/test_classdefs_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_classes_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_groups_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_modules_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_packages_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_propdefs_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_props_to_full_json.res [new file with mode: 0644]
src/doc/templates/tests/test_templates_json.sav/test_refs_to_full_json.res [new file with mode: 0644]
src/doc/term/term.nit [new file with mode: 0644]
src/doc/term/tests/test_term.nit [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_ancestors.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_ancestors_without_parents.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_call.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_children.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_code.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_comment.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_comment_no_fallback.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_comment_short.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_descendants.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_descendants_without_children.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_features.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_init.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_lin.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_lin_no_lin.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_mentity_conflict.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_mentity_empty.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_mentity_full_name.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_mentity_name.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_mentity_not_found.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_param.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_parents.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_return.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_search.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_search_no_query.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog_contrib.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog_maintain.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog_search.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog_stats.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog_tag.res [new file with mode: 0644]
src/doc/term/tests/test_term.sav/test_term_catalog_tags.res [new file with mode: 0644]
src/model/model.nit
src/model/model_json.nit [deleted file]
src/model/test_model_json.sav/test_classdefs_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_classes_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_groups_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_modules_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_packages_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_propdefs_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_props_to_full_json.res [deleted file]
src/model/test_model_json.sav/test_refs_to_full_json.res [deleted file]
src/nitweb.nit
src/nitx.nit
src/web/api_catalog.nit [deleted file]
src/web/api_docdown.nit [deleted file]
src/web/api_graph.nit [deleted file]
src/web/api_model.nit [deleted file]
src/web/web_base.nit [deleted file]
tests/nitx.args
tests/sav/nitx.res
tests/sav/nitx_args1.res
tests/sav/nitx_args2.res
tests/sav/nitx_args3.res

index 19fac5a..6d4fe1a 100644 (file)
@@ -28,8 +28,8 @@
 #
 # ~~~nitish
 # # Note that you need to specify the path from "assets" folder and the extension
-# var s = app.load_sound("sounds/test_sound.ogg")
-# var m = app.load_music("sounds/test_music.ogg")
+# var s = new Sound("sounds/test_sound.ogg")
+# var m = new Music("sounds/test_music.ogg")
 # s.play
 # m.play
 # ~~~
@@ -542,14 +542,22 @@ redef class Sound
 
        redef fun load do
                if is_loaded then return
-               var retval_resources = app.default_soundpool.load_name_rid(app.resource_manager, app.native_activity, path.strip_extension)
-               if retval_resources == -1 then
-                       self.error = new Error("Failed to load " + path)
+
+               # Try resources (res)
+               var rid = app.default_soundpool.load_name_rid(app.resource_manager, app.native_activity, path.strip_extension)
+               if rid > 0 then
+                       self.soundpool_id = rid
+                       self.soundpool = app.default_soundpool
+                       self.error = null
+                       self.soundpool.error = null
+               else
+                       # Try assets
                        var nam = app.asset_manager.open_fd(path)
                        if nam.is_java_null then
                                self.error = new Error("Failed to get file descriptor for " + path)
                        else
                                var retval_assets = app.default_soundpool.load_asset_fd_rid(nam)
+                               nam.close
                                if retval_assets == -1 then
                                        self.error = new Error("Failed to load " + path)
                                else
@@ -559,11 +567,6 @@ redef class Sound
                                        self.soundpool.error = null
                                end
                        end
-               else
-                       self.soundpool_id = retval_resources
-                       self.soundpool = app.default_soundpool
-                       self.error = null
-                       self.soundpool.error = null
                end
                is_loaded = true
 
@@ -611,14 +614,25 @@ redef class Music
 
        redef fun load do
                if is_loaded then return
-               var mp_sound_resources = app.default_mediaplayer.load_sound(app.resource_manager.raw_id(path.strip_extension), app.native_activity)
-               if mp_sound_resources.error != null then
+
+               # Try resources (res)
+               var rid = app.resource_manager.raw_id(path.strip_extension)
+               if rid > 0 then
+                       var mp_sound_resources = app.default_mediaplayer.load_sound(rid, app.native_activity)
+                       if mp_sound_resources.error != null then
+                               self.media_player = app.default_mediaplayer
+                               self.error = null
+                               self.media_player.error = null
+                       end
                        self.error = mp_sound_resources.error
+               else
+                       # Try assets
                        var nam = app.asset_manager.open_fd(path)
                        if nam.is_java_null then
                                self.error = new Error("Failed to get file descriptor for " + path)
                        else
                                var mp_sound_assets = app.default_mediaplayer.data_source_fd(nam)
+                               nam.close
                                if mp_sound_assets.error != null then
                                        self.error = mp_sound_assets.error
                                else
@@ -627,10 +641,6 @@ redef class Music
                                        self.media_player.error = null
                                end
                        end
-               else
-                       self.media_player = app.default_mediaplayer
-                       self.error = null
-                       self.media_player.error = null
                end
                is_loaded = true
 
index f394594..2501758 100644 (file)
@@ -35,12 +35,12 @@ Core classes and methods used by default by Nit programs and libraries.
 
 ### Other
 
-[[list: kernel]]
+[[defs: kernel]]
 
 ## Core Collections
 
-[[doc: collection]]
+[[doc: core::collection]]
 
 ## String and Text manipulation
 
-[[doc: text]]
+[[doc: core::text]]
index 8b14fc8..8a5ba58 100644 (file)
@@ -167,12 +167,12 @@ end
 redef class HttpResponse
 
        # Write data as JSON and set the right content type header.
-       fun json(json: nullable Serializable, status: nullable Int) do
+       fun json(json: nullable Serializable, status: nullable Int, plain, pretty: nullable Bool) do
                header["Content-Type"] = media_types["json"].as(not null)
                if json == null then
                        send(null, status)
                else
-                       send(json.to_json, status)
+                       send(json.serialize_to_json(plain or else true, pretty or else false), status)
                end
        end
 
index fc2f8e6..755649e 100644 (file)
@@ -57,6 +57,11 @@ Ignore the attributes.
 ### `--private`
 Also generate private API.
 
+### `--catalog`
+Use catalog.
+
+Allow queries to catalog data (can be long on large code base).
+
 # SEE ALSO
 
 The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>
index 18675a0..9b295be 100644 (file)
@@ -6,29 +6,28 @@
                <h5 class='card-heading'>
                        <entity-signature mentity='mentity' />
                        <small ng-if='mentity.class_name == "MPackage"'>
-                               <span ng-repeat='tag in mentity.metadata.tags'>
+                               <span ng-repeat='tag in mentity.tags'>
                                        <a ui-sref='tag({id: tag})' class='text-muted'>{{tag}}</a>
                                        <span ng-if='!$last'>,</span>
                                </span>
                        </small>
                </h5>
-               <span class='synopsis' ng-bind-html='mentity.mdoc.html_synopsis' />
+               <span class='synopsis' ng-bind-html='mentity.html_synopsis' />
        </div>
        <div class='card-body' ng-if='mentity.class_name != "MPackage"'>
                <h5 class='card-heading'>
                        <entity-signature mentity='mentity' />
                </h5>
-               <span class='synopsis' ng-bind-html='mentity.mdoc.html_synopsis' />
+               <span class='synopsis' ng-bind-html='mentity.html_synopsis' />
        </div>
        <div class='card-right' ng-if='mentity.class_name == "MPackage"' style='width: 25%'>
-               <span ng-repeat='maintainer in mentity.metadata.maintainers'>
-                       <img class='avatar' src='https://secure.gravatar.com/avatar/{{maintainer.gravatar}}?size=14&amp;default=retro' />
-                       <a ui-sref='person({id: maintainer.name})'>{{maintainer.name}}</a>
+                       <img class='avatar' src='https://secure.gravatar.com/avatar/{{mentity.maintainer.gravatar}}?size=14&amp;default=retro' />
+                       <a ui-sref='person({id: mentity.maintainer.name})'>{{mentity.maintainer.name}}</a>
                </span>
                <br>
-               <span ng-if='mentity.metadata.license'>
+               <span ng-if='mentity.license'>
                        <span class='text-muted'>
-                               <a href='http://opensource.org/licenses/{{mentity.license}}' class='text-muted'>{{mentity.metadata.license}}</a>
+                               <a href='http://opensource.org/licenses/{{mentity.license}}' class='text-muted'>{{mentity.license}}</a>
                        </span>
                </span>
        </div>
index 2d14d83..cff100d 100644 (file)
@@ -19,8 +19,8 @@
                        </div>
                </h5>
                <div id='{{codeId}}' class='collapse'>
-                       <pre ng-bind-html='code' />
-                       <entity-location mentity='definition' />
+                       <pre ng-bind-html='code.code' />
+                       <entity-location loc='code.location' />
                </div>
        </div>
 </div>
index 740ea8b..60b9348 100644 (file)
@@ -1,3 +1 @@
-<span>
-       <a ng-href='{{mentity.web_url}}'>{{mentity.name}}</a>
-</span>
+<span><a ng-href='{{mentity.web_url}}' title='{{mentity.synopsis}}'>{{mentity.name}}</a></span>
index 05f8ccb..8e058fc 100644 (file)
@@ -1,4 +1,3 @@
-<span ng-if='mentity.location' class='text-muted'>
-       {{mentity.location.file}}
-       <span ng-if='mentity.location.line_start'>:{{mentity.location.line_start}}</span>
+<span class='text-muted'>
+       {{vm.loc.file}}<span ng-if='vm.loc.line_start'>:{{vm.loc.line_start}}</span>
 </span>
index f3f2dc6..28de5e7 100644 (file)
@@ -14,7 +14,7 @@
                                        <span>: </span>
                                        <entity-signature mentity='mparam.mtype' />
                                </span>
-                               <span ng-if='$middle'>, </span>
+                               <span ng-if='!$last'>, </span>
                        </span>
                        <span>]</span>
                </span>
@@ -22,7 +22,7 @@
        <span ng-if='mentity.msignature'>
                <span ng-if='mentity.msignature.arity > 0'>
                        <span>(</span>
-                       <span ng-repeat='mparam in mentity.msignature.mparams'>
+                       <span ng-repeat='mparam in mentity.msignature.mparameters'>
                                <span>
                                        <span>{{mparam.name}}</span>
                                        <span ng-if='mentity.is_intro !== false'>
index 4af87d2..3b7d62d 100644 (file)
@@ -1,14 +1,16 @@
 <nav>
-       <ul class='pagination' ng-if='pagination.pagination.max > 1'>
-               <li ng-class='{disabled: pagination.pagination.page <= 1}'>
-                       <a ng-click='pagination.changePage(pagination.pagination.page - 1, pagination.pagination.limit)'><span>&laquo;</span></a>
+       <ul class='pagination' ng-if='vm.pagination.max > 1'>
+               <li ng-class='{disabled: vm.pagination.page <= 1}'>
+                       <a ng-click='vm.changePage(vm.pagination.page - 1, vm.pagination.limit)'>
+                               <span>&laquo;</span></a>
                </li>
-               <li ng-repeat='page in pagination.pages'
-                       ng-class='{disabled: pagination.pagination.page == page}'>
-                       <a ng-click='pagination.changePage(page, pagination.pagination.limit)'>{{page}}</a>
+               <li ng-repeat='page in vm.pages'
+                       ng-class='{disabled: vm.pagination.page == page}'>
+                       <a ng-click='vm.changePage(page, vm.pagination.limit)'>{{page}}</a>
                </li>
-               <li ng-class='{disabled: pagination.pagination.page >= pagination.pagination.max}'>
-                       <a ng-click='pagination.changePage(pagination.pagination.page + 1, pagination.pagination.limit)'><span>&raquo;</span></a>
+               <li ng-class='{disabled: vm.pagination.page >= vm.pagination.max}'>
+                       <a ng-click='vm.changePage(vm.pagination.page + 1, vm.pagination.limit)'>
+                               <span>&raquo;</span></a>
                </li>
        </ul>
 </nav>
index 2667db3..9926712 100644 (file)
                                        .success(cb)
                                        .error(cbErr);
                        },
-                       packages: function(p, n, cb, cbErr) {
-                               $http.get('/api/catalog/packages?p=' + p + '&n=' + n)
+                       packages: function(p, l, cb, cbErr) {
+                               $http.get('/api/catalog/packages?p=' + p + '&l=' + l)
                                        .success(cb)
                                        .error(cbErr);
                        },
                                        .success(cb)
                                        .error(cbErr);
                        },
-                       personMaintaining: function(id, p, n, cb, cbErr) {
-                               $http.get('/api/catalog/person/' + id + '/maintaining?p=' + p + '&n=' + n)
+                       personMaintaining: function(id, p, l, cb, cbErr) {
+                               $http.get('/api/catalog/person/' + id + '/maintaining?p=' + p + '&l=' + l)
                                        .success(cb)
                                        .error(cbErr);
                        },
-                       personContributing: function(id, p, n, cb, cbErr) {
-                               $http.get('/api/catalog/person/' + id + '/contributing?p=' + p + '&n=' + n)
+                       personContributing: function(id, p, l, cb, cbErr) {
+                               $http.get('/api/catalog/person/' + id + '/contributing?p=' + p + '&l=' + l)
                                        .success(cb)
                                        .error(cbErr);
                        },
-                       tag: function(id, p, n, cb, cbErr) {
-                               $http.get('/api/catalog/tag/' + id + '?p=' + p + '&n=' + n)
+                       tag: function(id, p, l, cb, cbErr) {
+                               $http.get('/api/catalog/tag/' + id + '?p=' + p + '&l=' + l)
                                        .success(cb)
                                        .error(cbErr);
                        }
                vm.packages = packages;
                vm.tags = tags;
                vm.stats = stats;
-
                $scope.$on('change-page', function(e, page, limit) {
                        $state.go('catalog', {p: page, l: limit});
                })
                vm.contributing = contributing;
 
                var p1 = $stateParams.p1 ? $stateParams.p1 : 1;
-               var n1 = $stateParams.n1 ? $stateParams.n1 : 10;
+               var l1 = $stateParams.l1 ? $stateParams.l1 : 10;
                var p2 = $stateParams.p2 ? $stateParams.p2 : 1;
-               var n2 = $stateParams.n2 ? $stateParams.n2 : 10;
+               var l2 = $stateParams.l2 ? $stateParams.l2 : 10;
 
                $scope.$on('change-page1', function(e, page, limit) {
-                       $state.go('person', {id: $stateParams.id, p1: page, n1: limit, p2: p2, n2: n2});
+                       $state.go('person', {id: $stateParams.id, p1: page, l1: limit, p2: p2, l2: l2});
                })
 
                $scope.$on('change-page2', function(e, page, limit) {
-                       $state.go('person', {id: $stateParams.id, p1: p1, n1: n1, p2: page, n2: limit});
+                       $state.go('person', {id: $stateParams.id, p1: p1, l1: l1, p2: page, l2: limit});
                })
        })
 
        .controller('TagCtrl', function($state, $scope, tag) {
                var vm = this;
                vm.tag = tag;
-
                $scope.$on('change-page', function(e, page, limit) {
                        $state.go('tag', {id: vm.tag.tag, p: page, l: limit});
                })
index 545e487..2ca4e04 100644 (file)
                                                                        $state.go('404', null, { location: false })
                                                                });
                                                        return d.promise;
+                                               },
+                                               parents: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityParents($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
+                                               children: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityChildren($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
+                                               intros: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityIntros($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
+                                               redefs: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityRedefs($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
+                                               meta: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityMeta($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
                                                }
                                        },
-                                       controller: function(mentity, doc) {
+                                       controller: function(mentity, doc, parents, children, intros, redefs, meta) {
                                                this.mentity = mentity;
                                                this.doc = doc;
+                                               this.parents = parents;
+                                               this.children = children;
+                                               this.intros = intros;
+                                               this.redefs = redefs;
+                                               this.meta = meta;
 
                                                this.date = function(date) {
                                                        return new Date(date);
                                                                });
                                                        return d.promise;
                                                },
-                                               inh: function(Model, $q, $stateParams, $state) {
+                                               ancestors: function(Model, $q, $stateParams, $state) {
                                                        var d = $q.defer();
-                                                       Model.loadEntityInh($stateParams.id, d.resolve,
+                                                       Model.loadEntityAncestors($stateParams.id, d.resolve,
                                                                function() {
                                                                        $state.go('404', null, { location: false })
                                                                });
                                                        return d.promise;
-                                               }
+                                               },
+                                               parents: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityParents($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
+                                               children: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityChildren($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
+                                               descendants: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityDescendants($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               },
                                        },
-                                       controller: function(inh, graph, $sce) {
-                                               this.graph = $sce.trustAsHtml(graph);
-                                               this.inh = inh;
+                                       controller: function(ancestors, parents, children, descendants, graph, $sce) {
+                                               this.graph = $sce.trustAsHtml(graph.graph);
+                                               this.ancestors = ancestors;
+                                               this.parents = parents;
+                                               this.children = children;
+                                               this.descendants = descendants;
                                        },
                                        controllerAs: 'vm',
                                })
                                        resolve: {
                                                lin: function(Model, $q, $stateParams, $state) {
                                                        var d = $q.defer();
-                                                       Model.loadEntityLinearization($stateParams.id, d.resolve,
+                                                       Model.loadEntityLin($stateParams.id, d.resolve,
                                                                function() {
                                                                        $state.go('404', null, { location: false })
                                                                });
                                        controller: function(mentity, lin, $scope, $location, $anchorScroll) {
                                                var vm = this;
                                                vm.focus = $location.hash() ?
-                                                       $location.hash() : mentity.intro.full_name;
+                                                       $location.hash() : lin.results[0].full_name;
                                                vm.mentity = mentity;
                                                vm.linearization = lin;
                                                setTimeout(function() {
                                                        return $location.hash();
                                                }, function (value) {
                                                        vm.focus = $location.hash() ?
-                                                               $location.hash() : mentity.intro.full_name;
+                                                               $location.hash() : lin.results[0].full_name;
                                                        $anchorScroll();
                                                });
                                        },
                                })
                                .state('doc.entity.all', {
                                        url: '/all',
-                                       templateUrl: 'views/doc/all.html',
-                                       controller: function(mentity) {
+                                       templateUrl: 'views/doc/defs.html',
+                                       resolve: {
+                                               defs: function(Model, $q, $stateParams, $state) {
+                                                       var d = $q.defer();
+                                                       Model.loadEntityAll($stateParams.id, d.resolve,
+                                                               function() {
+                                                                       $state.go('404', null, { location: false })
+                                                               });
+                                                       return d.promise;
+                                               }
+                                       },
+                                       controller: function(mentity, defs) {
                                                this.mentity = mentity;
+                                               this.defs = defs;
                                        },
                                        controllerAs: 'vm',
                                })
                                },
 
                                loadEntityDoc: function(id, cb, cbErr) {
-                                       $http.get('/api/entity/' + id + '/doc')
+                                       $http.get('/api/doc/' + id + '?format=html')
                                                .success(cb)
                                                .error(cbErr);
                                },
 
-                               loadEntityLinearization: function(id, cb, cbErr) {
-                                       $http.get('/api/linearization/' + id)
+                               loadEntityLin: function(id, cb, cbErr) {
+                                       $http.get('/api/lin/' + id)
                                                .success(cb)
                                                .error(cbErr);
                                },
                                                .error(cbErr);
                                },
 
+                               loadEntityIntros: function(id, cb, cbErr) {
+                                       $http.get('/api/intros/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
+                               loadEntityRedefs: function(id, cb, cbErr) {
+                                       $http.get('/api/redefs/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
+                               loadEntityAll: function(id, cb, cbErr) {
+                                       $http.get('/api/all/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
                                loadEntityCode: function(id, cb, cbErr) {
-                                       $http.get('/api/code/' + id)
+                                       $http.get('/api/code/' + id + '?format=html')
                                                .success(cb)
                                                .error(cbErr);
                                },
 
-                               loadEntityGraph: function(id, cb, cbErr) {
-                                       $http.get('/api/graph/inheritance/' + id + '?cdepth=3')
+                               loadEntityAncestors: function(id, cb, cbErr) {
+                                       $http.get('/api/ancestors/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
+                               loadEntityParents: function(id, cb, cbErr) {
+                                       $http.get('/api/parents/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
+                               loadEntityChildren: function(id, cb, cbErr) {
+                                       $http.get('/api/children/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
+                               loadEntityDescendants: function(id, cb, cbErr) {
+                                       $http.get('/api/descendants/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+
+                               loadEntityMeta: function(id, cb, cbErr) {
+                                       $http.get('/api/meta/' + id)
                                                .success(cb)
                                                .error(cbErr);
                                },
 
-                               loadEntityInh: function(id, cb, cbErr) {
-                                       $http.get('/api/inheritance/' + id)
+                               loadEntityGraph: function(id, cb, cbErr) {
+                                       $http.get('/api/graph/inheritance/' + id + '?format=svg&cdepth=3')
                                                .success(cb)
                                                .error(cbErr);
                                },
+
                                search: function(q, p, n, cb, cbErr) {
-                                       $http.get('/api/search?q=' + q + '&p=' + p + '&n=' + n)
+                                       $http.get('/api/search?q=' + q + '&p=' + p + '&l=' + n)
                                                .success(cb)
                                                .error(cbErr);
                                }
                                scope: {
                                        mentity: '='
                                },
+                               replace: true,
                                templateUrl: '/directives/entity/link.html'
                        };
                })
                .directive('entityLocation', function() {
                        return {
                                restrict: 'E',
-                               scope: {
-                                       mentity: '='
+                               replace: true,
+                               scope: {},
+                               bindToController: {
+                                       loc: '='
                                },
+                               controller: function() {},
+                               controllerAs: 'vm',
                                templateUrl: '/directives/entity/location.html'
                        };
                })
index 5327782..e3d13d7 100644 (file)
                        return {
                                restrict: 'E',
                                replace: true,
+                               scope: {},
                                bindToController: {
                                        pagination: '=',
                                        suffix: '=?'
                                controller: function($scope) {
                                        var vm = this;
 
-                                       $scope.$watch('pagination.pagination', function(pagination) {
+                                       $scope.$watch('vm.pagination', function(pagination) {
                                                if(!pagination) return;
                                                vm.computePages(pagination);
                                        })
                                                $scope.$emit('change-page' + suffix, page, limit);
                                        }
                                },
-                               controllerAs: 'pagination',
+                               controllerAs: 'vm',
                                templateUrl: 'directives/ui/pagination.html'
                        };
                })
index 2333a0a..c45e0dc 100644 (file)
@@ -29,7 +29,7 @@
                        <entity-card mentity='package' ng-repeat='package in vm.packages.results' />
                </div>
                <div class='container text-center' ng-if='vm.packages'>
-                       <ui-pagination pagination='vm.packages'/>
+                       <ui-pagination pagination='vm.packages' />
                </div>
        </div>
 </div>
index 6c0a37e..e4bc086 100644 (file)
@@ -1,16 +1,16 @@
 <div class='container'>
        <h1>
                {{vm.tag.tag}}
-               <small>{{vm.tag.packages.total}} packages</small>
+               <small>{{vm.tag.count}} packages</small>
        </h1>
        <hr/>
 
-       <div class='container-fluid no-padding' ng-if='vm.tag.packages.results.length > 0'>
+       <div class='container-fluid no-padding' ng-if='vm.tag.results.length > 0'>
                <div class='card-list'>
-                       <entity-card mentity='package' ng-repeat='package in vm.tag.packages.results' />
+                       <entity-card mentity='package' ng-repeat='package in vm.tag.results' />
                </div>
-               <div class='container text-center' ng-if='vm.tag.packages'>
-                       <ui-pagination pagination='vm.tag.packages'/>
+               <div class='container text-center' ng-if='vm.tag'>
+                       <ui-pagination pagination='vm.tag'/>
                </div>
        </div>
 </div>
index 48f4282..517bf47 100644 (file)
@@ -1,6 +1,6 @@
 <div class='card'>
        <div class='card-body'>
-               <pre ng-bind-html='vm.code' />
-               <entity-location mentity='vm.mentity' />
+               <pre ng-bind-html='vm.code.code' />
+               <entity-location loc='vm.code.location' />
        </div>
 </div>
index 7cd0ea2..17d9a92 100644 (file)
@@ -1,10 +1,13 @@
 <div>
        <entity-list list-title='Groups' ng-if='vm.mentity.class_name == "MPackage"'
-               list-entities='vm.defs' list-object-filter='{}' />
+               list-entities='vm.defs.results' list-object-filter='{}' />
 
        <entity-list list-title='Groups & Modules' ng-if='vm.mentity.class_name == "MGroup"'
-               list-entities='vm.defs' list-object-filter='{}' />
+               list-entities='vm.defs.results' list-object-filter='{}' />
 
        <entity-list list-title='Class definitions' ng-if='vm.mentity.class_name == "MModule"'
-               list-entities='vm.defs' list-object-filter='{}' />
+               list-entities='vm.defs.results' list-object-filter='{}' />
+
+       <entity-list list-title='All properties' ng-if='vm.mentity.class_name == "MClass"'
+               list-entities='vm.defs.results' list-object-filter='{}' />
 </div>
index eadcf37..d29b2cd 100644 (file)
@@ -7,32 +7,30 @@
        }'>
                <div class='card'>
                        <div class='card-body'>
-                               <div ng-if='vm.doc'>
+                               <div ng-if='vm.doc.documentation'>
                                        <div ng-bind-html='vm.doc.documentation'></div>
                                </div>
-                               <div ng-if='!vm.doc'>
+                               <div ng-if='!vm.doc.documentation'>
                                        <i class='text-muted'>No documentation for this entity.</i>
                                </div>
                        </div>
                </div>
 
-               <entity-list list-title='Introduced classes' list-entities='vm.mentity.intro_mclasses'
-                       list-object-filter='{}' />
+               <entity-list list-title='Introduced classes' list-entities='vm.intros.results'
+                       list-object-filter='{}' ng-if='vm.mentity.class_name == "MModule"' />
 
-               <entity-list list-title='Class redefinitions' list-entities='vm.mentity.redef_mclassdefs'
-                       list-object-filter='{}' />
+               <entity-list list-title='Class redefinitions' list-entities='vm.redefs.results'
+                       list-object-filter='{}' ng-if='vm.mentity.class_name == "MModule"' />
 
                <entity-list list-title='Constructors'
                        list-entities='vm.mentity.all_mproperties'
                        list-object-filter='{is_init: true}' />
 
-               <entity-list list-title='Introduced properties'
-                       list-entities='vm.mentity.intro_mproperties'
-                       list-object-filter='{is_init: "!true"}' />
+               <entity-list list-title='Introduced properties' list-entities='vm.intros.results'
+                       list-object-filter='{is_init: "!true"}' ng-if='vm.mentity.class_name == "MClass"' />
 
-               <entity-list list-title='Redefined properties'
-                       list-entities='vm.mentity.redef_mproperties'
-                       list-object-filter='{is_init: "!true"}' />
+               <entity-list list-title='Redefined properties' list-entities='vm.redefs.results'
+                       list-object-filter='{is_init: "!true"}' ng-if='vm.mentity.class_name == "MClass"' />
 
        </div>
 
                "hidden": vm.mentity.class_name != "MPackage"
        }'>
                <br>
-               <p ng-repeat='maintainer in vm.mentity.metadata.maintainers' class='lead'>
+               <p ng-repeat='maintainer in vm.meta.maintainers' class='lead'>
                        <img class='avatar' src='https://secure.gravatar.com/avatar/{{maintainer.gravatar}}?size=20&default=retro' />
                        <span>
                                <a ui-sref='person({id: maintainer.name})'>{{maintainer.name}}</a>
                        </span>
                        <br>
                </p>
-               <span ng-if='vm.mentity.metadata.license'>
+               <span ng-if='vm.meta.license'>
                        <span class='text-muted'>
-                               <a href='http://opensource.org/licenses/{{vm.mentity.metadata.license}}'>{{vm.mentity.metadata.license}}</a>
+                               <a href='http://opensource.org/licenses/{{vm.meta.license}}'>{{vm.meta.license}}</a>
                                license
                        </span>
                        <br>
                </span>
 
-               <div ng-if='vm.mentity.metadata.homepage || vm.mentity.metadata.issues'>
+               <div ng-if='vm.meta.homepage || vm.meta.issues'>
                        <h3>Links</h3>
                        <ul class='list-unstyled'>
-                               <li ng-if='vm.mentity.metadata.homepage'>
-                                       <a href='{{vm.mentity.metadata.homepage}}'>Homepage</a>
+                               <li ng-if='vm.meta.homepage'>
+                                       <a href='{{vm.meta.homepage}}'>Homepage</a>
                                </li>
-                               <li ng-if='vm.mentity.metadata.browse'>
-                                       <a href='{{vm.mentity.metadata.browse}}'>Source Code</a>
+                               <li ng-if='vm.meta.browse'>
+                                       <a href='{{vm.meta.browse}}'>Source Code</a>
                                </li>
-                               <li ng-if='vm.mentity.metadata.issues'>
-                                       <a href='{{vm.mentity.metadata.issues}}'>Issues</a>
+                               <li ng-if='vm.meta.issues'>
+                                       <a href='{{vm.meta.issues}}'>Issues</a>
                                </li>
                        </ul>
                </div>
 
-               <div ng-if='vm.mentity.metadata.git || vm.mentity.stats.commits'>
+               <div ng-if='vm.meta.git || vm.mentity.stats.commits'>
                        <h3>Git</h3>
                        <ul class='list-unstyled' style='white-space: nowrap; overflow: hidden; text-overflow: ellipsis;'>
-                               <li ng-if='vm.mentity.metadata.git'>
-                                       <a href='{{vm.mentity.metadata.git}}'>{{vm.mentity.metadata.git}}</a>
+                               <li ng-if='vm.meta.git'>
+                                       <a href='{{vm.meta.git}}'>{{vm.meta.git}}</a>
                                </li>
                                <li ng-if='vm.mentity.stats.commits' class='text-muted'>
                                        <br><b>{{vm.mentity.stats.commits}} commits</b>
                                </li>
-                               <li ng-if='vm.mentity.metadata.last_date'><b class='text-muted'>Last:</b> {{vm.date(vm.mentity.metadata.last_date) | date: 'medium'}}</li>
-                               <li ng-if='vm.mentity.metadata.first_date'><b class='text-muted'>First: </b>{{vm.date(vm.mentity.metadata.first_date) | date: 'medium'}}</li>
+                               <li ng-if='vm.meta.last_date'><b class='text-muted'>Last:</b> {{vm.date(vm.meta.last_date) | date: 'medium'}}</li>
+                               <li ng-if='vm.meta.first_date'><b class='text-muted'>First: </b>{{vm.date(vm.meta.first_date) | date: 'medium'}}</li>
                        </ul>
                </div>
 
                        </ul>
                </div>
 
-               <div ng-if='vm.mentity.metadata.tags.length > 0'>
+               <div ng-if='vm.meta.tags.length > 0'>
                        <h3>Tags</h3>
-                       <span ng-repeat='tag in vm.mentity.metadata.tags'>
+                       <span ng-repeat='tag in vm.meta.tags'>
                                <a ui-sref='tag({id: tag})'>{{tag}}</a><span ng-if='!$last'>,</span>
                        </span>
                </div>
 
-               <div ng-if='vm.mentity.dependencies.length > 0'>
+               <div ng-if='vm.parents.results.length > 0'>
                        <h3>Requirements</h3>
-                       <span ng-repeat='parent in vm.mentity.dependencies'>
-                               <a ui-sref='mentity({id: parent.name})' title='{{parent.synopsis}}'>{{parent.name}}</a><span ng-if='!$last'>,</span>
+                       <span ng-repeat='parent in vm.parents.results'>
+                               <entity-link mentity='parent' /><span ng-if='!$last'>,</span>
                        </span>
                </div>
 
-               <div ng-if='vm.mentity.clients.length > 0'>
+               <div ng-if='vm.children.results.length > 0'>
                        <h3>Clients</h3>
-                       <span ng-repeat='client in vm.mentity.clients'>
-                               <a ui-sref='mentity({id: client.name})' title='{{client.synopsis}}'>{{client.name}}</a><span ng-if='!$last'>,</span>
+                       <span ng-repeat='client in vm.children.results'>
+                               <entity-link mentity='client' /><span ng-if='!$last'>,</span>
                        </span>
                </div>
 
-               <div ng-if='vm.mentity.metadata.contributors.length > 1'>
+               <div ng-if='vm.meta.contributors.length > 1'>
                        <h3>Contributors</h3>
                        <ul class='list-unstyled'>
-                               <li ng-repeat='contributor in vm.mentity.metadata.contributors'>
+                               <li ng-repeat='contributor in vm.meta.contributors'>
                                        <img class='avatar' src='https://secure.gravatar.com/avatar/{{contributor.gravatar}}?size=20&default=retro' />
                                        <a ui-sref='person({id: contributor.name})'>
                                        {{contributor.name}}</a>
index 2968cce..fdd9668 100644 (file)
@@ -7,9 +7,9 @@
 
        <!-- Parents -->
        <entity-list list-title='Parents'
-               list-entities='vm.inh.direct_greaters' list-object-filter='{}' />
+               list-entities='vm.parents.results' list-object-filter='{}' />
 
        <!-- Children -->
        <entity-list list-title='Children'
-               list-entities='vm.inh.direct_smallers' list-object-filter='{}' />
+               list-entities='vm.children.results' list-object-filter='{}' />
 </div>
index 96d9b82..f99473c 100644 (file)
@@ -1,6 +1,6 @@
 <div>
        <entity-linearization
                list-title='Class definitions'
-               list-entities='vm.linearization'
+               list-entities='vm.linearization.results'
                list-focus='vm.focus' />
 </div>
similarity index 95%
rename from src/web/web.nit
rename to src/doc/api/api.nit
index 2bbd690..2835985 100644 (file)
 # limitations under the License.
 
 # Components required to build a web server about the nit model.
-module web
+module api
 
 import api_auth
 import api_model
-import api_catalog
-import api_graph
 import api_docdown
 import api_metrics
 import api_feedback
similarity index 98%
rename from src/web/api_auth.nit
rename to src/doc/api/api_auth.nit
index 80cce5d..e9d066f 100644 (file)
@@ -14,7 +14,7 @@
 
 module api_auth
 
-import web_base
+import api_base
 import popcorn::pop_auth
 
 redef class NitwebConfig
diff --git a/src/doc/api/api_base.nit b/src/doc/api/api_base.nit
new file mode 100644 (file)
index 0000000..e14cf3b
--- /dev/null
@@ -0,0 +1,254 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Base classes used by `nitweb`.
+module api_base
+
+import popcorn
+import popcorn::pop_config
+import popcorn::pop_repos
+import popcorn::pop_json
+
+import commands::commands_http
+import commands::commands_json
+import commands::commands_html
+
+# Nitweb config file.
+class NitwebConfig
+       super AppConfig
+
+       redef fun default_db_name do return "nitweb"
+
+       # Model to use.
+       var model: Model
+
+       # MModule used to flatten model.
+       var mainmodule: MModule
+
+       # Modelbuilder used to access sources.
+       var modelbuilder: ModelBuilder
+
+       # The JSON API does not filter anything by default.
+       #
+       # So we can cache the model view.
+       var view: ModelView
+
+       # Catalog to pass to handlers.
+       var catalog: Catalog is noinit
+
+       # Build the catalog
+       #
+       # This method should be called at nitweb startup.
+       # TODO move to nitweb
+       fun build_catalog do
+               var catalog = new Catalog(modelbuilder)
+               # Compute the poset
+               for p in view.mpackages do
+                       var g = p.root
+                       assert g != null
+                       modelbuilder.scan_group(g)
+
+                       catalog.deps.add_node(p)
+                       for gg in p.mgroups do for m in gg.mmodules do
+                               for im in m.in_importation.direct_greaters do
+                                       var ip = im.mpackage
+                                       if ip == null or ip == p then continue
+                                       catalog.deps.add_edge(p, ip)
+                               end
+                       end
+               end
+               # Build the catalog
+               for mpackage in view.mpackages do
+                       catalog.package_page(mpackage)
+                       catalog.git_info(mpackage)
+                       catalog.mpackage_stats(mpackage)
+               end
+               self.catalog = catalog
+       end
+end
+
+# Specific handler for the nitweb API.
+abstract class APIHandler
+       super Handler
+
+       # App config.
+       var config: NitwebConfig
+
+       # Find the MEntity ` with `full_name`.
+       fun find_mentity(model: ModelView, full_name: nullable String): nullable MEntity do
+               if full_name == null then return null
+               var mentity = model.mentity_by_full_name(full_name.from_percent_encoding)
+               if mentity == null then return null
+               if config.view.accept_mentity(mentity) then return mentity
+               return null
+       end
+
+       # Try to load the mentity from uri with `/:id`.
+       #
+       # Send 400 if `:id` is null.
+       # Send 404 if no entity is found.
+       # Return null in both cases.
+       fun mentity_from_uri(req: HttpRequest, res: HttpResponse): nullable MEntity do
+               var id = req.param("id")
+               if id == null then
+                       res.api_error(400, "Expected mentity full name")
+                       return null
+               end
+               var mentity = find_mentity(config.view, id)
+               if mentity == null then
+                       res.api_error(404, "MEntity `{id}` not found")
+               end
+               return mentity
+       end
+
+       # Paginate a json array
+       #
+       # Returns only a subset of `results` depending on the current `page` and the
+       # number of elements to return set by `limit`.
+       #
+       # Transforms the json array into an object:
+       # ~~~json
+       # {
+       #       "page": 2,
+       #       "limit": 10,
+       #       "results: [ ... ],
+       #       "max": 5,
+       #       "total": 49
+       # }
+       # ~~~
+       fun paginate(results: JsonArray, count: Int, page, limit: nullable Int): JsonObject do
+               if page == null or page <= 0 then page = 1
+               if limit == null or limit <= 0 then limit = 20
+
+               var max = count / limit
+               if max == 0 then
+                       page = 1
+                       max = 1
+               else if page > max then
+                       page = max
+               end
+
+               var lstart = (page - 1) * limit
+               var lend = limit
+               if lstart + lend > count then lend = count - lstart
+
+               var res = new JsonObject
+               res["page"] = page
+               res["limit"] = limit
+               res["results"] = new JsonArray.from(results.subarray(lstart, lend))
+               res["max"] = max
+               res["total"] = count
+               return res
+       end
+end
+
+# A Rooter dedicated to APIHandlers.
+class APIRouter
+       super Router
+
+       # App config
+       var config: NitwebConfig
+end
+
+redef class HttpResponse
+
+       # Return an HTTP error response with `status`
+       #
+       # Like the rest of the API, errors are formated as JSON:
+       # ~~~json
+       # { "status": 404, "message": "Not found" }
+       # ~~~
+       fun api_error(status: Int, message: String) do
+               json(new APIError(status, message), status)
+       end
+
+       # Return `serializable` as a json string
+       #
+       # Uses `req` to define serialization options.
+       fun api_json(req: HttpRequest, serializable: nullable Serializable, status: nullable Int, plain, pretty: nullable Bool) do
+               json(serializable, status, plain, req.bool_arg("pretty"))
+       end
+end
+
+# An error returned by the API.
+#
+# Can be serialized to json.
+class APIError
+       serialize
+
+       # Reponse status
+       var status: Int
+
+       # Response error message
+       var message: String
+end
+
+redef class MEntity
+
+       # URL to `self` within the web interface.
+       fun web_url: String do return "/doc/" / full_name
+
+       # URL to `self` within the JSON api.
+       fun api_url: String do return "/api/entity/" / full_name
+
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("web_url", web_url)
+               v.serialize_attribute("api_url", api_url)
+       end
+end
+
+redef class MEntityRef
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("web_url", mentity.web_url)
+               v.serialize_attribute("api_url", mentity.api_url)
+       end
+end
+
+redef class MClassDef
+       redef fun web_url do return "{mclass.web_url}/lin#{full_name}"
+end
+
+redef class MPropDef
+       redef fun web_url do return "{mproperty.web_url}/lin#{full_name}"
+end
+
+redef class MType
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("web_url", web_url)
+               v.serialize_attribute("api_url", api_url)
+       end
+end
+
+redef class MClassType
+       redef var web_url = mclass.web_url is lazy
+       redef var api_url = mclass.api_url is lazy
+end
+
+redef class MNullableType
+       redef var web_url = mtype.web_url is lazy
+       redef var api_url = mtype.api_url is lazy
+end
+
+redef class MParameterType
+       redef var web_url = mclass.web_url is lazy
+       redef var api_url = mclass.api_url is lazy
+end
+
+redef class MVirtualType
+       redef var web_url = mproperty.web_url is lazy
+       redef var api_url = mproperty.api_url is lazy
+end
diff --git a/src/doc/api/api_docdown.nit b/src/doc/api/api_docdown.nit
new file mode 100644 (file)
index 0000000..0a23542
--- /dev/null
@@ -0,0 +1,45 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Nitdoc specific Markdown format handling for Nitweb
+module api_docdown
+
+import api_model
+import commands::commands_docdown
+
+redef class NitwebConfig
+       # Specific Markdown processor to use within Nitweb
+       var md_processor: MarkdownProcessor is lazy do
+               var parser = new CommandParser(view, modelbuilder)
+               var proc = new CmdMarkdownProcessor(parser)
+               proc.decorator = new CmdDecorator(view)
+               return proc
+       end
+end
+
+redef class APIRouter
+       redef init do
+               super
+               use("/docdown/", new APIDocdown(config))
+       end
+end
+
+# Docdown handler accept docdown as POST data and render it as HTML
+class APIDocdown
+       super APIHandler
+
+       redef fun post(req, res) do
+               res.html config.md_processor.process(req.body)
+       end
+end
similarity index 93%
rename from src/web/api_feedback.nit
rename to src/doc/api/api_feedback.nit
index 6a356c3..81faaeb 100644 (file)
@@ -15,7 +15,7 @@
 # Feedback related features
 module api_feedback
 
-import web_base
+import api_base
 import popcorn::pop_auth
 
 redef class NitwebConfig
@@ -65,7 +65,7 @@ class APIStarsMost
        super APIFeedBack
 
        redef fun get(req, res) do
-               res.json new JsonArray.from(config.stars.most_rated)
+               res.api_json(req, new JsonArray.from(config.stars.most_rated))
        end
 end
 
@@ -74,7 +74,7 @@ class APIStarsBest
        super APIFeedBack
 
        redef fun get(req, res) do
-               res.json new JsonArray.from(config.stars.best_rated)
+               res.api_json(req, new JsonArray.from(config.stars.best_rated))
        end
 end
 
@@ -83,7 +83,7 @@ class APIStarsWorst
        super APIFeedBack
 
        redef fun get(req, res) do
-               res.json new JsonArray.from(config.stars.worst_rated)
+               res.api_json(req, new JsonArray.from(config.stars.worst_rated))
        end
 end
 
@@ -92,7 +92,7 @@ class APIStarsUsers
        super APIFeedBack
 
        redef fun get(req, res) do
-               res.json new JsonArray.from(config.stars.users_ratings)
+               res.api_json(req, new JsonArray.from(config.stars.users_ratings))
        end
 end
 
@@ -103,7 +103,7 @@ class APIUserStars
        redef fun get(req, res) do
                var user = get_session_user(req)
                if user == null then return
-               res.json new JsonArray.from(user.ratings(config))
+               res.api_json(req, new JsonArray.from(user.ratings(config)))
        end
 end
 
@@ -115,7 +115,7 @@ class APIStars
                var login = get_session_login(req)
                var mentity = mentity_from_uri(req, res)
                if mentity == null then return
-               res.json mentity.ratings(config, login)
+               res.api_json(req, mentity.ratings(config, login))
        end
 end
 
@@ -129,7 +129,7 @@ class APIStarsDimension
                if mentity == null then return
                var dimension = req.param("dimension")
                if dimension == null then return
-               res.json mentity.ratings_by_dimension(config, dimension, login)
+               res.api_json(req, mentity.ratings_by_dimension(config, dimension, login))
        end
 
        redef fun post(req, res) do
@@ -166,7 +166,7 @@ class APIStarsDimension
                else
                        config.stars.save new StarRating(login, mentity.full_name, dimension, rating)
                end
-               res.json mentity.ratings_by_dimension(config, dimension, login)
+               res.api_json(req, mentity.ratings_by_dimension(config, dimension, login))
        end
 end
 
similarity index 95%
rename from src/web/api_light.nit
rename to src/doc/api/api_light.nit
index 10f0694..b6b2657 100644 (file)
@@ -15,8 +15,7 @@
 # Highlight and collect messages from a piece of code
 module api_light
 
-import web_base
-import htmlight
+import api_base
 
 redef class APIRouter
        redef init do
@@ -32,6 +31,6 @@ class APILight
        redef fun post(req, res) do
                var hl = new HtmlightVisitor
                var hlcode = hl.highlightcode(req.body)
-               res.json(hlcode)
+               res.api_json(req, hlcode)
        end
 end
similarity index 99%
rename from src/web/api_metrics.nit
rename to src/doc/api/api_metrics.nit
index 21f84b4..4fcdb9e 100644 (file)
@@ -14,7 +14,7 @@
 
 module api_metrics
 
-import web_base
+import api_base
 import metrics
 
 redef class APIRouter
@@ -72,7 +72,7 @@ class APIStructuralMetrics
                        res.api_error(404, "No metric for mentity `{mentity.full_name}`")
                        return
                end
-               res.json metrics
+               res.api_json(req, metrics)
        end
 end
 
diff --git a/src/doc/api/api_model.nit b/src/doc/api/api_model.nit
new file mode 100644 (file)
index 0000000..9619892
--- /dev/null
@@ -0,0 +1,301 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module api_model
+
+import api_base
+
+redef class APIRouter
+       redef init do
+               super
+               use("/list", new APIList(config))
+               use("/random", new APIRandom(config))
+               use("/search", new APISearch(config))
+
+               use("/entity/:id", new APIEntity(config))
+               use("/doc/:id", new APIEntityDoc(config))
+               use("/code/:id", new APIEntityCode(config))
+               use("/lin/:id", new APIEntityLinearization(config))
+               use("/defs/:id", new APIEntityDefs(config))
+               use("/intros/:id", new APIEntityIntros(config))
+               use("/redefs/:id", new APIEntityRedefs(config))
+               use("/meta/:id", new APIEntityMetadata(config))
+               use("/all/:id", new APIEntityAll(config))
+
+               use("/ancestors/:id", new APIEntityAncestors(config))
+               use("/parents/:id", new APIEntityParents(config))
+               use("/children/:id", new APIEntityChildren(config))
+               use("/descendants/:id", new APIEntityDescendants(config))
+
+               use("/uml/:id", new APIEntityUML(config))
+               use("/graph/inheritance/:id", new APIInheritanceGraph(config))
+
+               use("/catalog/packages/", new APICatalogPackages(config))
+               use("/catalog/stats", new APICatalogStats(config))
+               use("/catalog/tags", new APICatalogTags(config))
+               use("/catalog/tag/:tid", new APICatalogTag(config))
+               use("/catalog/person/:pid", new APICatalogPerson(config))
+               use("/catalog/person/:pid/maintaining", new APICatalogMaintaining(config))
+               use("/catalog/person/:pid/contributing", new APICatalogContributing(config))
+       end
+end
+
+# An API Handler that use a DocCommand to respond
+abstract class APICommand
+       super APIHandler
+
+       # Return the doc command to apply for self
+       fun command: DocCommand is abstract
+
+       redef fun get(req, res) do
+               var command = self.command
+               var status = command.http_init(req)
+               if status isa CmdError then
+                       res.api_error(status.http_status_code, status.to_s)
+                       return
+               end
+               res.api_json(req, command.to_json)
+       end
+end
+
+# CmdModel
+
+# List all mentities.
+#
+# Example: `GET /list?kind=modules?limit=10`
+class APIList
+       super APICommand
+
+       redef fun command do return new CmdModelEntities(config.view)
+end
+
+# Return a random list of MEntities.
+#
+# Example: `GET /random?kind=modules&limit=10`
+class APIRandom
+       super APICommand
+
+       redef fun command do return new CmdRandomEntities(config.view)
+end
+
+# Search mentities from a cmd string.
+#
+# Example: `GET /search?q=Arr`
+class APISearch
+       super APIList
+
+       redef fun command do return new CmdCatalogSearch(config.view, config.catalog)
+end
+
+# CmdEntity
+
+# Return the JSON representation of a MEntity.
+#
+# Example: `GET /entity/core::Array`
+class APIEntity
+       super APICommand
+
+       redef fun command do return new CmdEntity(config.view)
+end
+
+# Return the full MDoc of a MEntity.
+#
+# Example: `GET /entity/core::Array/doc`
+class APIEntityDoc
+       super APICommand
+
+       redef fun command do return new CmdComment(config.view)
+end
+
+# List MEntity ancestors
+#
+# Example: `GET /ancestors/core::Array`
+class APIEntityAncestors
+       super APICommand
+
+       redef fun command do return new CmdAncestors(config.view)
+end
+
+# List MEntity parents
+#
+# Example: `GET /parents/core::Array`
+class APIEntityParents
+       super APICommand
+
+       redef fun command do return new CmdParents(config.view)
+end
+
+# List MEntity children
+#
+# Example: `GET /children/core::Array`
+class APIEntityChildren
+       super APICommand
+
+       redef fun command do return new CmdChildren(config.view)
+end
+
+# List MEntity descendants
+#
+# Example: `GET /descendants/core::Array`
+class APIEntityDescendants
+       super APICommand
+
+       redef fun command do return new CmdDescendants(config.view)
+end
+
+# Linearize super definitions of a MClassDef or a MPropDef if any.
+#
+# Example: `GET /linearization/core::Array`
+class APIEntityLinearization
+       super APICommand
+
+       redef fun command do return new CmdLinearization(config.view)
+end
+
+# List definitions of a MEntity.
+#
+# Example: `GET /defs/core::Array`
+class APIEntityDefs
+       super APICommand
+
+       redef fun command do return new CmdFeatures(config.view)
+end
+
+# List intro definitions of a MEntity.
+#
+# Example: `GET /intros/core::Array`
+class APIEntityIntros
+       super APICommand
+
+       redef fun command do return new CmdIntros(config.view)
+end
+
+# List redef definitions of a MEntity.
+#
+# Example: `GET /redefs/core::Array`
+class APIEntityRedefs
+       super APICommand
+
+       redef fun command do return new CmdRedefs(config.view)
+end
+
+# List all definitions accessible from a MEntity.
+#
+# Example: `GET /all/core::Array`
+class APIEntityAll
+       super APICommand
+
+       redef fun command do return new CmdAllProps(config.view)
+end
+
+# Return the source code of MEntity.
+#
+# Example: `GET /code/core::Array`
+class APIEntityCode
+       super APICommand
+
+       redef fun command do return new CmdCode(config.view, config.modelbuilder)
+end
+
+# Return the UML diagram for MEntity.
+#
+# Example: `GET /uml/core::Array`
+class APIEntityUML
+       super APICommand
+
+       redef fun command do return new CmdUML(config.view)
+end
+
+# Return the inheritance graph for MEntity.
+#
+# Example: `GET /inheritance/core::Array`
+class APIInheritanceGraph
+       super APICommand
+
+       redef fun command do return new CmdInheritanceGraph(config.view)
+end
+
+# CmdCatalog
+
+# Get all the packages from the catalog using pagination
+#
+# `GET /packages?p=1&n=10`: get the list of catalog by page
+class APICatalogPackages
+       super APICommand
+
+       redef fun command do return new CmdCatalogPackages(config.view, config.catalog)
+end
+
+# Get the catalog statistics
+#
+# `GET /stats`: return the catalog statistics
+class APICatalogStats
+       super APICommand
+
+       redef fun command do return new CmdCatalogStats(config.view, config.catalog)
+end
+
+# Get the package metadata
+#
+# `GET /:id/metadata`: return a paginated list of packages
+class APIEntityMetadata
+       super APICommand
+
+       redef fun command do return new CmdMetadata(config.view)
+end
+
+# Get all the tags from the catalog
+#
+# `GET /tags`: the list of tags associated with their number of packages
+class APICatalogTags
+       super APICommand
+
+       redef fun command do return new CmdCatalogTags(config.view, config.catalog)
+end
+
+# Get the packages related to a tag
+#
+# `GET /tag/:tid?p=1&n=10`: return a paginated list of packages
+class APICatalogTag
+       super APICommand
+
+       redef fun command do return new CmdCatalogTag(config.view, config.catalog)
+end
+
+# Get a person existing in the catalog
+#
+# `GET /person/:pid`: get the person with `pid`
+class APICatalogPerson
+       super APICommand
+
+       redef fun command do return new CmdCatalogPerson(config.view, config.catalog)
+end
+
+# Get the list of mpackages maintained by a person
+#
+# `GET /person/:pid/maintaining?p=1&n=10`: return a paginated list of packages
+class APICatalogMaintaining
+       super APICommand
+
+       redef fun command do return new CmdCatalogMaintaining(config.view, config.catalog)
+end
+
+# Get the list of mpackages contributed by a person
+#
+# `GET /person/:pid/contributing?p=1&n=10`: return a paginated list of packages
+class APICatalogContributing
+       super APICommand
+
+       redef fun command do return new CmdCatalogContributing(config.view, config.catalog)
+end
index 05fcf95..018a028 100644 (file)
@@ -20,9 +20,8 @@ import commands::commands_graph
 import commands::commands_usage
 import commands::commands_catalog
 
-import model::model_json
+import templates::templates_json
 import catalog::catalog_json
-import doc::doc_down
 
 redef class DocCommand
        # Return a JSON Serializable representation of `self` results
index 230bf81..1e88381 100644 (file)
@@ -398,7 +398,7 @@ class CmdCode
        # Rendering format
        #
        # Set the output format for this piece of code.
-       # Can be "raw" or "html".
+       # Can be "raw", "html" or "ansi".
        # Default is "raw".
        #
        # This format can be different than the format used in the command response.
@@ -431,9 +431,14 @@ class CmdCode
                        var hl = new HtmlightVisitor
                        hl.highlight_node node
                        return hl.html
+               else if format == "ansi" then
+                       var hl = new AnsiHighlightVisitor
+                       hl.highlight_node node
+                       return hl.result
                end
-               # TODO make a raw visitor
-               return node.to_s
+               var mentity = self.mentity
+               if mentity == null then return null
+               return mentity.location.text
        end
 end
 
index af75cbe..182ca53 100644 (file)
@@ -41,6 +41,35 @@ class CommandParser
        "param", "return", "new", "call", "defs", "list", "random",
        "catalog", "stats", "tags", "tag", "person", "contrib", "maintain"] is writable
 
+       # List of commands usage and documentation
+       var commands_usage: Map[String, String] do
+               var usage = new ArrayMap[String, String]
+               usage["search: <string>"] = "list entities matching `string`"
+               usage["doc: <name>"] = "display the documentation for `name`"
+               usage["defs: <name>"] = "list all definitions for `name`"
+               usage["code: <name>"] = "display the code for `name`"
+               usage["lin: <name>"] = "display the linearization for `name`"
+               usage["uml: <name>"] = "display the UML diagram for `name`"
+               usage["graph: <name>"] = "display the inheritance graph for `name`"
+               usage["parents: <name>"] = "list the direct parents of `name`"
+               usage["ancestors: <name>"] = "list all ancestors of `name`"
+               usage["children: <name>"] = "list direct children of `name`"
+               usage["descendants: <name>"] = "list all descendants of `name`"
+               usage["param: <type>"] = "list all methods accepting `type` as parameter"
+               usage["return: <type>"] = "list all methods returning `type`"
+               usage["new: <class>"] = "list all methods initializing `class`"
+               usage["call: <property>"] = "list all methods calling `property`"
+               usage["list: <kind>"] = "list all entities of `kind` from the model"
+               usage["random: <kind>"] = "list random entities of `kind` from the model"
+               usage["catalog:"] = "list packages from catalog"
+               usage["stats:"] = "display catalog statistics"
+               usage["tags:"] = "list all tabs from catalog"
+               usage["tag: <tag>"] = "list all packages with `tag`"
+               usage["maintain: <person>"] = "list all packages maintained by `person`"
+               usage["contrib: <person>"] = "list all packages contributed by `person`"
+               return usage
+       end
+
        # Parse `string` as a DocCommand
        #
        # Returns `null` if the string cannot be parsed.
index fcf2f01..26a3c60 100644 (file)
@@ -1,28 +1,19 @@
 {
        "results": [{
                "name": "Object",
+               "synopsis": "Root of everything.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Object",
-               "mdoc": {
-                       "content": "Root of everything.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 21,
-                               "line_start": 20,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["interface"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 30,
-                       "line_start": 20,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>",
+               "modifiers": ["interface"]
        }],
        "page": null,
        "count": null,
index 9dbc03c..b49877d 100644 (file)
@@ -1,56 +1,54 @@
 {
        "results": [{
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Character",
+                       "synopsis": "Characters can be played by both the human or the machine."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Character$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 68,
-                       "line_start": 21,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "total_strengh",
+               "synopsis": "The actual strength of the character.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Character",
+                       "synopsis": "Characters can be played by both the human or the machine."
+               }, "$", {
+                       "name": "total_strengh",
+                       "synopsis": "The actual strength of the character."
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Character$total_strengh",
-               "mdoc": {
-                       "content": "The actual strength of the character.\n\nReturns `race.base_strength + career.strength_bonus` or just `race.base_strength` is unemployed.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 2,
-                               "line_end": 42,
-                               "line_start": 39,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">The actual strength of the character.</span>",
                "modifiers": ["fun"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 45,
-                       "line_start": 39,
-                       "file": "test_location"
-               },
                "is_intro": true,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
+                       "mparameters": [],
                        "return_mtype": {
-                               "full_name": "test_prog::Int"
-                       },
-                       "vararg_rank": -1
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
                }
        }],
        "page": null,
index 6106b9b..0f1dd96 100644 (file)
@@ -1,76 +1,49 @@
 {
        "results": [{
                "name": "Alcoholic",
+               "synopsis": "Alcoholics are good to nothing escept taking punches.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Alcoholic",
+                       "synopsis": "Alcoholics are good to nothing escept taking punches."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Alcoholic",
-               "mdoc": {
-                       "content": "Alcoholics are good to nothing escept taking punches.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 61,
-                               "line_start": 60,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 69,
-                       "line_start": 60,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Alcoholics are good to nothing escept taking punches.</span>",
+               "modifiers": ["class"]
        }, {
                "name": "Magician",
+               "synopsis": "Magicians know magic and how to use it.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Magician",
+                       "synopsis": "Magicians know magic and how to use it."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Magician",
-               "mdoc": {
-                       "content": "Magicians know magic and how to use it.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 50,
-                               "line_start": 49,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 58,
-                       "line_start": 49,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Magicians know magic and how to use it.</span>",
+               "modifiers": ["class"]
        }, {
                "name": "Warrior",
+               "synopsis": "Warriors are good for fighting.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Warrior",
+                       "synopsis": "Warriors are good for fighting."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Warrior",
-               "mdoc": {
-                       "content": "Warriors are good for fighting.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 39,
-                               "line_start": 38,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 47,
-                       "line_start": 38,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Warriors are good for fighting.</span>",
+               "modifiers": ["class"]
        }],
        "page": null,
        "count": null,
index 6106b9b..0f1dd96 100644 (file)
@@ -1,76 +1,49 @@
 {
        "results": [{
                "name": "Alcoholic",
+               "synopsis": "Alcoholics are good to nothing escept taking punches.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Alcoholic",
+                       "synopsis": "Alcoholics are good to nothing escept taking punches."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Alcoholic",
-               "mdoc": {
-                       "content": "Alcoholics are good to nothing escept taking punches.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 61,
-                               "line_start": 60,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 69,
-                       "line_start": 60,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Alcoholics are good to nothing escept taking punches.</span>",
+               "modifiers": ["class"]
        }, {
                "name": "Magician",
+               "synopsis": "Magicians know magic and how to use it.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Magician",
+                       "synopsis": "Magicians know magic and how to use it."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Magician",
-               "mdoc": {
-                       "content": "Magicians know magic and how to use it.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 50,
-                               "line_start": 49,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 58,
-                       "line_start": 49,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Magicians know magic and how to use it.</span>",
+               "modifiers": ["class"]
        }, {
                "name": "Warrior",
+               "synopsis": "Warriors are good for fighting.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Warrior",
+                       "synopsis": "Warriors are good for fighting."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Warrior",
-               "mdoc": {
-                       "content": "Warriors are good for fighting.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 39,
-                               "line_start": 38,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 47,
-                       "line_start": 38,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Warriors are good for fighting.</span>",
+               "modifiers": ["class"]
        }],
        "page": null,
        "count": null,
index 63035b5..e229fc7 100644 (file)
@@ -1,25 +1,16 @@
 {
        "name": "Character",
+       "synopsis": "Characters can be played by both the human or the machine.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }],
        "class_name": "MClass",
        "full_name": "test_prog::Character",
-       "mdoc": {
-               "content": "Characters can be played by both the human or the machine.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 22,
-                       "line_start": 21,
-                       "file": "test_location"
-               }
-       },
        "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 68,
-               "line_start": 21,
-               "file": "test_location"
-       },
-       "mparameters": []
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters can be played by both the human or the machine.</span>",
+       "modifiers": ["class"]
 }
index 402b350..e483a2e 100644 (file)
 {
        "results": [{
                "name": "_endurance_bonus",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "careers",
+                       "synopsis": "Careers of the game."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "_endurance_bonus"
+               }],
                "class_name": "MAttribute",
                "full_name": "test_prog::careers::Career::_endurance_bonus",
-               "mdoc": null,
                "visibility": "private",
                "modifiers": ["private", "var"],
-               "location": {
-                       "column_end": 25,
-                       "column_start": 2,
-                       "line_end": 32,
-                       "line_start": 32,
-                       "file": "test_location"
-               },
                "static_mtype": {
-                       "full_name": "test_prog::Int"
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
                }
        }, {
                "name": "_intelligence_bonus",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "careers",
+                       "synopsis": "Careers of the game."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "_intelligence_bonus"
+               }],
                "class_name": "MAttribute",
                "full_name": "test_prog::careers::Career::_intelligence_bonus",
-               "mdoc": null,
                "visibility": "private",
                "modifiers": ["private", "var"],
-               "location": {
-                       "column_end": 28,
-                       "column_start": 2,
-                       "line_end": 33,
-                       "line_start": 33,
-                       "file": "test_location"
-               },
                "static_mtype": {
-                       "full_name": "test_prog::Int"
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
                }
        }, {
                "name": "_strength_bonus",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "careers",
+                       "synopsis": "Careers of the game."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "_strength_bonus"
+               }],
                "class_name": "MAttribute",
                "full_name": "test_prog::careers::Career::_strength_bonus",
-               "mdoc": null,
                "visibility": "private",
                "modifiers": ["private", "var"],
-               "location": {
-                       "column_end": 24,
-                       "column_start": 2,
-                       "line_end": 31,
-                       "line_start": 31,
-                       "file": "test_location"
-               },
                "static_mtype": {
-                       "full_name": "test_prog::Int"
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
                }
        }, {
                "name": "endurance_bonus",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "endurance_bonus"
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Career::endurance_bonus",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["fun"],
-               "location": {
-                       "column_end": 25,
-                       "column_start": 2,
-                       "line_end": 32,
-                       "line_start": 32,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
+                       "mparameters": [],
                        "return_mtype": {
-                               "full_name": "test_prog::Int"
-                       },
-                       "vararg_rank": -1
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
                }
        }, {
                "name": "endurance_bonus=",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "endurance_bonus="
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Career::endurance_bonus=",
-               "mdoc": null,
                "visibility": "protected",
                "modifiers": ["protected", "fun"],
-               "location": {
-                       "column_end": 25,
-                       "column_start": 2,
-                       "line_end": 32,
-                       "line_start": 32,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 1,
-                       "mparams": [{
+                       "mparameters": [{
                                "is_vararg": false,
                                "name": "endurance_bonus",
                                "mtype": {
-                                       "full_name": "test_prog::Int"
+                                       "name": "Int",
+                                       "synopsis": "Some services about Integers.",
+                                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
                                }
                        }],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Career$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 12,
-                       "column_start": 2,
-                       "line_end": 35,
-                       "line_start": 35,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "intelligence_bonus",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "intelligence_bonus"
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Career::intelligence_bonus",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["fun"],
-               "location": {
-                       "column_end": 28,
-                       "column_start": 2,
-                       "line_end": 33,
-                       "line_start": 33,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
+                       "mparameters": [],
                        "return_mtype": {
-                               "full_name": "test_prog::Int"
-                       },
-                       "vararg_rank": -1
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
                }
        }, {
                "name": "intelligence_bonus=",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "intelligence_bonus="
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Career::intelligence_bonus=",
-               "mdoc": null,
                "visibility": "protected",
                "modifiers": ["protected", "fun"],
-               "location": {
-                       "column_end": 28,
-                       "column_start": 2,
-                       "line_end": 33,
-                       "line_start": 33,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 1,
-                       "mparams": [{
+                       "mparameters": [{
                                "is_vararg": false,
                                "name": "intelligence_bonus",
                                "mtype": {
-                                       "full_name": "test_prog::Int"
+                                       "name": "Int",
+                                       "synopsis": "Some services about Integers.",
+                                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
                                }
                        }],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "return_mtype": null
                }
        }, {
                "name": "strength_bonus",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "strength_bonus"
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Career::strength_bonus",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["fun"],
-               "location": {
-                       "column_end": 24,
-                       "column_start": 2,
-                       "line_end": 31,
-                       "line_start": 31,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
+                       "mparameters": [],
                        "return_mtype": {
-                               "full_name": "test_prog::Int"
-                       },
-                       "vararg_rank": -1
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
                }
        }, {
                "name": "strength_bonus=",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "::", {
+                       "name": "strength_bonus="
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Career::strength_bonus=",
-               "mdoc": null,
                "visibility": "protected",
                "modifiers": ["protected", "fun"],
-               "location": {
-                       "column_end": 24,
-                       "column_start": 2,
-                       "line_end": 31,
-                       "line_start": 31,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 1,
-                       "mparams": [{
+                       "mparameters": [{
                                "is_vararg": false,
                                "name": "strength_bonus",
                                "mtype": {
-                                       "full_name": "test_prog::Int"
+                                       "name": "Int",
+                                       "synopsis": "Some services about Integers.",
+                                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
                                }
                        }],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "return_mtype": null
                }
        }],
        "page": null,
index ae8f477..c7ddd5a 100644 (file)
 {
        "results": [{
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "$", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Object$init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["init"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 30,
-                       "line_start": 20,
-                       "file": "test_location"
-               },
                "is_intro": true,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Race",
+                       "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Race$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 12,
-                       "column_start": 2,
-                       "line_end": 44,
-                       "line_start": 44,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Career$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 12,
-                       "column_start": 2,
-                       "line_end": 35,
-                       "line_start": 35,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Human",
+                       "synopsis": "Humans are able to do everithing."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Human$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 55,
-                       "line_start": 51,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Elf",
+                       "synopsis": "Elves make good magicians."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Elf$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 77,
-                       "line_start": 73,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Warrior",
+                       "synopsis": "Warriors are good for fighting."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Warrior$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 46,
-                       "line_start": 42,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Magician",
+                       "synopsis": "Magicians know magic and how to use it."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Magician$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 57,
-                       "line_start": 53,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Alcoholic",
+                       "synopsis": "Alcoholics are good to nothing escept taking punches."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Alcoholic$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 68,
-                       "line_start": 64,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Character",
+                       "synopsis": "Characters can be played by both the human or the machine."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Character$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 68,
-                       "line_start": 21,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }, {
                "name": "init",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "$", {
+                       "name": "Dwarf",
+                       "synopsis": "Dwarves make strong warriors."
+               }, "$", {
+                       "name": "Object",
+                       "synopsis": "Root of everything."
+               }, "::", {
+                       "name": "init"
+               }],
                "class_name": "MMethodDef",
                "full_name": "test_prog$Dwarf$Object::init",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["redef", "init"],
-               "location": {
-                       "column_end": 4,
-                       "column_start": 2,
-                       "line_end": 66,
-                       "line_start": 62,
-                       "file": "test_location"
-               },
-               "is_intro": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
-                       "return_mtype": null,
-                       "vararg_rank": -1
+                       "mparameters": [],
+                       "return_mtype": null
                }
        }],
        "page": null,
index 866e31f..07d815d 100644 (file)
 {
        "results": [{
                "name": "careers",
+               "synopsis": "Careers of the game.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "careers",
+                       "synopsis": "Careers of the game."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::careers",
-               "mdoc": {
-                       "content": "Careers of the game.\n\nAll characters can have a `Career`.\nA character can also quit its current career and start a new one.\n\nAvailable careers:\n\n * `Warrior`\n * `Magician`\n * `Alcoholic`",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 25,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 69,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Careers of the game.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "character",
+               "synopsis": "Characters are playable entity in the world.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "character",
+                       "synopsis": "Characters are playable entity in the world."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::character",
-               "mdoc": {
-                       "content": "Characters are playable entity in the world.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 68,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Characters are playable entity in the world.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "combat",
+               "synopsis": "COmbat interactions between characters.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "combat",
+                       "synopsis": "COmbat interactions between characters."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::combat",
-               "mdoc": {
-                       "content": "COmbat interactions between characters.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 67,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">COmbat interactions between characters.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "excluded",
+               "namespace": [{
+                       "name": "excluded"
+               }, "::", {
+                       "name": "excluded"
+               }],
                "class_name": "MModule",
                "full_name": "excluded::excluded",
-               "mdoc": null,
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 0,
-                       "line_start": 0,
-                       "file": "test_location"
-               }
+               "modifiers": ["module"]
        }, {
                "name": "game",
+               "synopsis": "A game abstraction for RPG.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "game",
+                       "synopsis": "A game abstraction for RPG."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::game",
-               "mdoc": {
-                       "content": "A game abstraction for RPG.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 45,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A game abstraction for RPG.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "game_examples",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "game_examples"
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::game_examples",
-               "mdoc": null,
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 32,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "modifiers": ["module"]
        }, {
                "name": "platform",
+               "synopsis": "Declares base types allowed on the platform.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "platform",
+                       "synopsis": "Declares base types allowed on the platform."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::platform",
-               "mdoc": {
-                       "content": "Declares base types allowed on the platform.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 17,
-                       "column_start": 1,
-                       "line_end": 59,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Declares base types allowed on the platform.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "races",
+               "synopsis": "Races of the game.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "races",
+                       "synopsis": "Races of the game."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::races",
-               "mdoc": {
-                       "content": "Races of the game.\n\nAll characters belong to a `Race`.\n\nAvailable races:\n\n * `Human`\n * `Dwarf`\n * `Elf`",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 24,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 78,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Races of the game.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "rpg",
+               "synopsis": "A worlg RPG abstraction.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "rpg",
+                       "synopsis": "A worlg RPG abstraction."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::rpg",
-               "mdoc": {
-                       "content": "A worlg RPG abstraction.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 13,
-                       "column_start": 1,
-                       "line_end": 21,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A worlg RPG abstraction.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "test_prog",
+               "synopsis": "A test program with a fake model to check model tools.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "test_prog",
+                       "synopsis": "A test program with a fake model to check model tools."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::test_prog",
-               "mdoc": {
-                       "content": "A test program with a fake model to check model tools.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 13,
-                       "column_start": 1,
-                       "line_end": 26,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A test program with a fake model to check model tools.</span>",
+               "modifiers": ["module"]
        }],
        "page": null,
        "count": null,
index a746bec..5e2fe63 100644 (file)
@@ -1,28 +1,19 @@
 {
        "results": [{
                "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Career",
-               "mdoc": {
-                       "content": "A `Career` gives a characteristic bonus or malus to the character.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 30,
-                               "line_start": 29,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["abstract class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 36,
-                       "line_start": 29,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>",
+               "modifiers": ["abstract class"]
        }],
        "page": null,
        "count": null,
index d84a73b..c392050 100644 (file)
 {
        "results": [{
                "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Career",
-               "mdoc": {
-                       "content": "A `Career` gives a characteristic bonus or malus to the character.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 30,
-                               "line_start": 29,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["abstract class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 36,
-                       "line_start": 29,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>",
+               "modifiers": ["abstract class"]
        }, {
                "name": "career",
+               "synopsis": "The current `Career` of the character.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Character",
+                       "synopsis": "Characters can be played by both the human or the machine."
+               }, "::", {
+                       "name": "career",
+                       "synopsis": "The current `Career` of the character."
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Character::career",
-               "mdoc": {
-                       "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 2,
-                               "line_end": 29,
-                               "line_start": 27,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
                "modifiers": ["fun"],
-               "location": {
-                       "column_end": 47,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
+                       "mparameters": [],
                        "return_mtype": {
-                               "full_name": "nullable test_prog::Career"
-                       },
-                       "vararg_rank": -1
+                               "name": "nullable Career",
+                               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+                       }
                }
        }, {
                "name": "game",
+               "synopsis": "Gaming group",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, ">", {
+                       "name": "game",
+                       "synopsis": "Gaming group"
+               }, ">"],
                "class_name": "MGroup",
                "full_name": "test_prog>game>",
-               "mdoc": {
-                       "content": "Gaming group",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 0,
-                               "line_end": 1,
-                               "line_start": 1,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["group"],
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 0,
-                       "line_start": 0,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Gaming group</span>",
+               "modifiers": ["group"]
        }, {
                "name": "game",
+               "synopsis": "A game abstraction for RPG.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "game",
+                       "synopsis": "A game abstraction for RPG."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::game",
-               "mdoc": {
-                       "content": "A game abstraction for RPG.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 16,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 45,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A game abstraction for RPG.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "races",
+               "synopsis": "Races of the game.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "races",
+                       "synopsis": "Races of the game."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::races",
-               "mdoc": {
-                       "content": "Races of the game.\n\nAll characters belong to a `Race`.\n\nAvailable races:\n\n * `Human`\n * `Dwarf`\n * `Elf`",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 24,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 78,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Races of the game.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "careers",
+               "synopsis": "Careers of the game.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "careers",
+                       "synopsis": "Careers of the game."
+               }],
                "class_name": "MModule",
                "full_name": "test_prog::careers",
-               "mdoc": {
-                       "content": "Careers of the game.\n\nAll characters can have a `Career`.\nA character can also quit its current career and start a new one.\n\nAvailable careers:\n\n * `Warrior`\n * `Magician`\n * `Alcoholic`",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 25,
-                               "line_start": 15,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["module"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 69,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Careers of the game.</span>",
+               "modifiers": ["module"]
        }, {
                "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Game",
+                       "synopsis": "This is the interface you have to implement to use ure gaming platform."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Game",
-               "mdoc": {
-                       "content": "This is the interface you have to implement to use ure gaming platform.\n\nsee http://our.platform.com",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 23,
-                               "line_start": 20,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["interface"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 45,
-                       "line_start": 20,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">This is the interface you have to implement to use ure gaming platform.</span>",
+               "modifiers": ["interface"]
        }, {
                "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Race",
+                       "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Race",
-               "mdoc": {
-                       "content": "Race determines basic characteristics and what the character will be able to do in life.\n\nThese are base characteristics, they cannot be changed\nbut you can add new ones if needed using refinement.\nObjects and spells cannot change those characteristics.",
-                       "location": {
-                               "column_end": 0,
-                               "column_start": 1,
-                               "line_end": 33,
-                               "line_start": 28,
-                               "file": "test_location"
-                       }
-               },
                "visibility": "public",
-               "modifiers": ["abstract class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 45,
-                       "line_start": 28,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>",
+               "modifiers": ["abstract class"]
        }, {
                "name": "Starter",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Starter"
+               }],
                "class_name": "MClass",
                "full_name": "test_prog::Starter",
-               "mdoc": null,
                "visibility": "public",
-               "modifiers": ["class"],
-               "location": {
-                       "column_end": 3,
-                       "column_start": 1,
-                       "line_end": 23,
-                       "line_start": 21,
-                       "file": "test_location"
-               },
-               "mparameters": []
+               "modifiers": ["class"]
        }, {
                "name": "age",
+               "namespace": [{
+                       "name": "test_prog",
+                       "synopsis": "Test program for model tools."
+               }, "::", {
+                       "name": "Character",
+                       "synopsis": "Characters can be played by both the human or the machine."
+               }, "::", {
+                       "name": "age"
+               }],
                "class_name": "MMethod",
                "full_name": "test_prog::Character::age",
-               "mdoc": null,
                "visibility": "public",
                "modifiers": ["fun"],
-               "location": {
-                       "column_end": 13,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 36,
-                       "file": "test_location"
-               },
-               "is_init": false,
                "msignature": {
                        "arity": 0,
-                       "mparams": [],
+                       "mparameters": [],
                        "return_mtype": {
-                               "full_name": "test_prog::Int"
-                       },
-                       "vararg_rank": -1
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
                }
        }],
        "page": 1,
diff --git a/src/doc/console_templates/console_model.nit b/src/doc/console_templates/console_model.nit
deleted file mode 100644 (file)
index cacac49..0000000
+++ /dev/null
@@ -1,668 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Console templates for Nit model MEntities.
-#
-# This module introduces console rendering services in model entities.
-module console_model
-
-import console
-import doc_base
-import ordered_tree
-
-redef class MDoc
-       # Returns the full comment formatted for the console.
-       fun cs_comment: String do
-               var res = new FlatBuffer
-               for line in content do
-                       res.append "    {line}\n"
-               end
-               return res.write_to_string
-       end
-
-       # Returns the synopsys formatted for the console.
-       fun cs_short_comment: String do return content.first
-end
-
-redef class MEntity
-
-       # Returns the mentity name with short signature.
-       #
-       # * MPackage: `foo`
-       # * MGroup: `foo`
-       # * MModule: `foo`
-       # * MClass: `Foo[E]`
-       # * MClassDef: `Foo[E]`
-       # * MProperty: `foo(e)`
-       # * MPropdef: `foo(e)`
-       var cs_name: String is lazy do return name
-
-       # Returns the list of keyword used in `self` declaration.
-       fun cs_modifiers: Array[String] is abstract
-
-       # Returns the complete MEntity declaration (modifiers + name + signature).
-       #
-       # * MPackage: `package foo`
-       # * MGroup: `group foo`
-       # * MModule: `module foo`
-       # * MClass: `private abstract class Foo[E: Object]`
-       # * MClassDef: `redef class Foo[E]`
-       # * MProperty: `private fun foo(e: Object): Int`
-       # * MPropdef: `redef fun foo(e)`
-       var cs_declaration: String is lazy do
-               var tpl = new FlatBuffer
-               tpl.append cs_modifiers.join(" ")
-               tpl.append " "
-               tpl.append cs_name
-               return tpl.write_to_string
-       end
-
-       # Returns `self` namespace formatted for console.
-       #
-       # * MPackage: `mpackage`
-       # * MGroup: `mpackage(::group)`
-       # * MModule: `mgroup::mmodule`
-       # * MClass: `mpackage::mclass`
-       # * MClassDef: `mmodule::mclassdef`
-       # * MProperty: `mclass::mprop`
-       # * MPropdef: `mclassdef:mpropdef`
-       fun cs_namespace: String is abstract
-
-       # Returns the comment of this MEntity formatted for console.
-       var cs_comment: nullable String is lazy do
-               var mdoc = mdoc_or_fallback
-               if mdoc == null then return null
-               # FIXME add markdown for console
-               return mdoc.cs_comment
-       end
-
-       # Returns the comment of this MEntity formatted for console.
-       var cs_short_comment: nullable String is lazy do
-               var mdoc = mdoc_or_fallback
-               if mdoc == null then return null
-               return mdoc.cs_short_comment
-       end
-
-       # Returns `self` as a list element that can be displayed in console.
-       #
-       # Displays `cs_icon`, `cs_name`, `cs_short_comment, `cs_namespace`,
-       # `cs_declaration` and `cs_location`.
-       fun cs_list_item: String do
-               var tpl = new FlatBuffer
-               tpl.append " {cs_visibility_color(cs_icon).bold} {cs_name.blue.bold}"
-               var comment = cs_short_comment
-               if comment != null then
-                       tpl.append " # {comment}".green
-               end
-               tpl.append "\n   "
-               tpl.append cs_namespace.gray.bold
-               tpl.append "\n   "
-               tpl.append cs_declaration
-               tpl.append "\n   "
-               tpl.append cs_location.gray
-               return tpl.write_to_string
-       end
-
-       # Returns `self` as a short list element that can be displayed in console.
-       # Displays `cs_icon`, `cs_name`, and `cs_short_comment.
-       fun cs_short_list_item: String do
-               var tpl = new FlatBuffer
-               tpl.append " {cs_visibility_color(cs_icon).bold} {cs_name.blue.bold}"
-               var comment = cs_short_comment
-               if comment != null then
-                       tpl.append " # {comment}".green
-               end
-               return tpl.write_to_string
-       end
-
-       # ASCII icon to be displayed in front of the list item.
-       fun cs_icon: String do return "*"
-
-       # Source code location of this MEntity formatted for console.
-       fun cs_location: String is abstract
-
-       # Sets text color depending on visibility.
-       #
-       # See module `console`.
-       fun cs_visibility_color(string: String): String do return string.green
-
-       # Source code associated to this MEntity.
-       #
-       # Uses `cs_location` to locate the source code.
-       fun cs_source_code: String do
-               # FIXME up location to mentity
-               var loc = new Location.from_string(cs_location)
-               var fr = new FileReader.open(loc.file.filename)
-               var content = new FlatBuffer
-               var i = 0
-               while not fr.eof do
-                       i += 1
-                       var line = fr.read_line
-                       if i < loc.line_start or i > loc.line_end then continue
-                       # FIXME add nitlight for console
-                       content.append "{line}\n"
-               end
-               fr.close
-               return content.write_to_string
-       end
-end
-
-redef class MPackage
-       redef var cs_modifiers = ["package"]
-       redef fun cs_namespace do return cs_name
-       redef fun cs_icon do return "P"
-       redef fun cs_location do return root.mmodules.first.location.to_s
-end
-
-redef class MGroup
-       redef var cs_modifiers = ["group"]
-       redef fun cs_icon do return "G"
-
-       # Depends if `self` is root or not.
-       #
-       # * If root `mpackage`.
-       # * Else `mpackage::self`.
-       redef fun cs_namespace do
-               var tpl = new FlatBuffer
-               tpl.append mpackage.cs_namespace
-               if mpackage.root != self then
-                       tpl.append "::"
-                       tpl.append cs_name
-               end
-               return tpl.write_to_string
-       end
-
-       redef fun cs_location do return mmodules.first.location.to_s
-end
-
-redef class MModule
-       redef var cs_modifiers = ["module"]
-       redef fun cs_icon do return "M"
-
-       # Depends if `self` belongs to a MGroup.
-       #
-       # * If mgroup `mgroup::self`.
-       # * Else `self`.
-       redef fun cs_namespace do
-               var tpl = new FlatBuffer
-               if mgroup != null then
-                       tpl.append mgroup.cs_namespace
-                       tpl.append "::"
-               end
-               tpl.append cs_name
-               return tpl.write_to_string
-       end
-
-       redef fun cs_location do return location.to_s
-end
-
-redef class MClass
-       redef fun cs_icon do return intro.cs_icon
-
-       # Format: `Foo[E]`
-       redef var cs_name is lazy do
-               var tpl = new FlatBuffer
-               tpl.append name
-               if arity > 0 then
-                       tpl.append "["
-                       var parameter_names = new Array[String]
-                       for p in mparameters do
-                               parameter_names.add(p.cs_name)
-                       end
-                       tpl.append parameter_names.join(", ")
-                       tpl.append "]"
-               end
-               return tpl.write_to_string
-       end
-
-       redef fun cs_modifiers do return intro.cs_modifiers
-       redef fun cs_declaration do return intro.cs_declaration
-
-       # Returns `mpackage::self`.
-       redef fun cs_namespace do
-               var tpl = new FlatBuffer
-               tpl.append intro_mmodule.mgroup.mpackage.cs_namespace
-               tpl.append "::"
-               tpl.append cs_name
-               return tpl.write_to_string
-       end
-
-       # Returns `intro.cs_short_signature`.
-       fun cs_short_signature: String do return intro.cs_short_signature
-
-       # Returns `intro.cs_signature`.
-       fun cs_signature: String do return intro.cs_signature
-
-       redef fun cs_visibility_color(string) do
-               if visibility == private_visibility then
-                       return string.red
-               else if visibility == protected_visibility then
-                       return string.yellow
-               end
-               return string.green
-       end
-
-       redef fun cs_location do return intro.location.to_s
-end
-
-redef class MClassDef
-       redef fun cs_icon do return "C"
-
-       # Depends if `self` is an intro or not.
-       #
-       # * If intro contains the visibility and kind.
-       # * If redef contains the `redef` keyword and kind.
-       redef fun cs_modifiers do
-               var res = new Array[String]
-               if not is_intro then
-                       res.add "redef"
-               else
-                       if mclass.visibility != public_visibility then
-                               res.add mclass.visibility.to_s
-                       end
-               end
-               res.add mclass.kind.to_s
-               return res
-       end
-
-       # Depends if `self` is an intro or not.
-       #
-       # For intro: `private abstract class Foo[E: Object]`
-       # For redef: `redef class Foo[E]`
-       redef fun cs_declaration do
-               var tpl = new FlatBuffer
-               tpl.append cs_modifiers.join(" ")
-               tpl.append " "
-               tpl.append cs_name
-               if is_intro then
-                       tpl.append cs_signature
-               else
-                       tpl.append cs_short_signature
-               end
-               return tpl.write_to_string.write_to_string.write_to_string
-       end
-
-       # Returns `mmodule::self`
-       redef fun cs_namespace do
-               var tpl = new FlatBuffer
-               tpl.append mmodule.cs_namespace
-               tpl.append "::"
-               tpl.append mclass.cs_name
-               return tpl.write_to_string.write_to_string
-       end
-
-       # Returns the MClassDef generic signature without static bounds.
-       fun cs_short_signature: String do
-               var tpl = new FlatBuffer
-               var mparameters = mclass.mparameters
-               if not mparameters.is_empty then
-                       tpl.append "["
-                       for i in [0..mparameters.length[ do
-                               tpl.append mparameters[i].cs_name
-                               if i < mparameters.length - 1 then tpl.append ", "
-                       end
-                       tpl.append "]"
-               end
-               return tpl.write_to_string
-       end
-
-       # Returns the MClassDef generic signature with static bounds.
-       fun cs_signature: String do
-               var tpl = new FlatBuffer
-               var mparameters = mclass.mparameters
-               if not mparameters.is_empty then
-                       tpl.append "["
-                       for i in [0..mparameters.length[ do
-                               tpl.append "{mparameters[i].cs_name}: "
-                               tpl.append bound_mtype.arguments[i].cs_signature
-                               if i < mparameters.length - 1 then tpl.append ", "
-                       end
-                       tpl.append "]"
-               end
-               return tpl.write_to_string
-       end
-
-       redef fun cs_location do return location.to_s
-end
-
-redef class MProperty
-       redef fun cs_modifiers do return intro.cs_modifiers
-       redef fun cs_declaration do return intro.cs_declaration
-       redef fun cs_icon do return intro.cs_icon
-
-       # Returns `mclass::self`.
-       redef fun cs_namespace do
-               var tpl = new FlatBuffer
-               tpl.append intro_mclassdef.mclass.cs_namespace
-               tpl.append "::"
-               tpl.append intro.cs_name
-               return tpl.write_to_string
-       end
-
-       # Returns `intro.cs_short_signature`.
-       fun cs_short_signature: String do return intro.cs_short_signature
-
-       # Returns `intro.cs_signature`.
-       fun cs_signature: String do return intro.cs_signature
-
-       redef fun cs_visibility_color(string) do
-               if visibility == private_visibility then
-                       return string.red
-               else if visibility == protected_visibility then
-                       return string.yellow
-               end
-               return string.green
-       end
-
-       # Returns `intro.cs_location`.
-       redef fun cs_location do return intro.location.to_s
-end
-
-redef class MPropDef
-       # Depends if `self` is an intro or not.
-       #
-       # * If intro contains the visibility and kind.
-       # * If redef contains the `redef` keyword and kind.
-       redef fun cs_modifiers do
-               var res = new Array[String]
-               if not is_intro then
-                       res.add "redef"
-               else
-                       if mproperty.visibility != public_visibility then
-                               res.add mproperty.visibility.to_s
-                       end
-               end
-               return res
-       end
-
-       # Depends if `self` is an intro or not.
-       #
-       # For intro: `private fun foo(e: Object): Bar is abstract`
-       # For redef: `redef fun foo(e) is cached`
-       redef fun cs_declaration do
-               var tpl = new FlatBuffer
-               tpl.append cs_modifiers.join(" ")
-               tpl.append " "
-               if is_intro then
-                       tpl.append cs_name
-                       tpl.append cs_signature
-               else
-                       tpl.append mproperty.intro.cs_name
-                       tpl.append cs_short_signature
-               end
-               return tpl.write_to_string
-       end
-
-       # Returns `mclassdef::self`
-       redef fun cs_namespace do
-               var tpl = new FlatBuffer
-               tpl.append mclassdef.cs_namespace
-               tpl.append "::"
-               tpl.append cs_name
-               return tpl.write_to_string
-       end
-
-       redef fun cs_location do return location.to_s
-
-       # Returns the MPropdDef signature without static types.
-       fun cs_short_signature: String is abstract
-
-       # Returns the MPropDef signature with static types.
-       fun cs_signature: String is abstract
-end
-
-redef class MAttributeDef
-
-       redef fun cs_modifiers do
-               var res = super
-               res.add "var"
-               return res
-       end
-
-       redef fun cs_short_signature do return ""
-
-       redef fun cs_signature do
-               var tpl = new FlatBuffer
-               if static_mtype != null then
-                       tpl.append ": "
-                       tpl.append static_mtype.cs_signature
-               end
-               return tpl.write_to_string
-       end
-
-       redef fun cs_icon do return "A"
-end
-
-redef class MMethodDef
-
-       redef fun cs_modifiers do
-               if mproperty.is_init then
-                       var res = new Array[String]
-                       if mproperty.visibility != public_visibility then
-                               res.add mproperty.visibility.to_s
-                       end
-                       return res
-               end
-               var res = super
-               if is_abstract then
-                       res.add "abstract"
-               else if is_intern then
-                       res.add "intern"
-               end
-               res.add "fun"
-               return res
-       end
-
-       redef fun cs_declaration do
-               if mproperty.is_init then
-                       var tpl = new FlatBuffer
-                       if not cs_modifiers.is_empty then
-                               tpl.append cs_modifiers.join(" ")
-                               tpl.append " "
-                       end
-                       tpl.append cs_name
-                       tpl.append cs_signature
-                       return tpl.write_to_string
-               end
-               return super
-       end
-
-       redef fun cs_short_signature do
-               if mproperty.is_root_init then
-                       return new_msignature.cs_short_signature
-               end
-               return msignature.cs_short_signature
-       end
-
-       redef fun cs_signature do
-               if mproperty.is_root_init then
-                       return new_msignature.cs_signature
-               end
-               return msignature.cs_signature
-       end
-
-       redef fun cs_icon do
-               if mproperty.is_init then
-                       return "I"
-               end
-               return "F"
-       end
-end
-
-redef class MVirtualTypeDef
-
-       redef fun cs_modifiers do
-               var res = super
-               res.add "type"
-               return res
-       end
-
-       # Short signature for `MVirtualType` is always empty.
-       redef fun cs_short_signature do return ""
-
-       redef fun cs_signature do
-               var tpl = new FlatBuffer
-               if bound == null then return tpl.write_to_string
-               tpl.append ": "
-               tpl.append bound.cs_signature
-               return tpl.write_to_string
-       end
-       redef fun cs_icon do return "V"
-end
-
-redef class MType
-       # Returns the signature of this type whithout bounds.
-       fun cs_short_signature: String is abstract
-
-       # Returns the signature of this type.
-       fun cs_signature: String is abstract
-
-       redef fun cs_icon do return "T"
-end
-
-redef class MClassType
-       redef fun cs_short_signature do return cs_name
-       redef fun cs_signature do return cs_name
-end
-
-redef class MNullableType
-
-       redef fun cs_short_signature do
-               var tpl = new FlatBuffer
-               tpl.append "nullable "
-               tpl.append mtype.cs_short_signature
-               return tpl.write_to_string
-       end
-
-       redef fun cs_signature do
-               var tpl = new FlatBuffer
-               tpl.append "nullable "
-               tpl.append mtype.cs_signature
-               return tpl.write_to_string
-       end
-end
-
-redef class MGenericType
-       redef fun cs_short_signature do
-               var tpl = new FlatBuffer
-               tpl.append name
-               tpl.append "["
-               for i in [0..arguments.length[ do
-                       tpl.append arguments[i].cs_short_signature
-                       if i < arguments.length - 1 then tpl.append ", "
-               end
-               tpl.append "]"
-               return tpl.write_to_string
-       end
-
-       redef fun cs_signature do
-               var tpl = new FlatBuffer
-               tpl.append mclass.name
-               tpl.append "["
-               for i in [0..arguments.length[ do
-                       tpl.append arguments[i].cs_signature
-                       if i < arguments.length - 1 then tpl.append ", "
-               end
-               tpl.append "]"
-               return tpl.write_to_string
-       end
-end
-
-redef class MParameterType
-       redef fun cs_short_signature do return cs_name
-       redef fun cs_signature do return cs_name
-end
-
-redef class MVirtualType
-       redef fun cs_signature do return cs_name
-end
-
-redef class MSignature
-
-       redef fun cs_short_signature do
-               var tpl = new FlatBuffer
-               if not mparameters.is_empty then
-                       tpl.append "("
-                       for i in [0..mparameters.length[ do
-                               tpl.append mparameters[i].cs_short_signature
-                               if i < mparameters.length - 1 then tpl.append ", "
-                       end
-                       tpl.append ")"
-               end
-               return tpl.write_to_string
-       end
-
-       redef fun cs_signature do
-               var tpl = new FlatBuffer
-               if not mparameters.is_empty then
-                       tpl.append "("
-                       for i in [0..mparameters.length[ do
-                               tpl.append mparameters[i].cs_signature
-                               if i < mparameters.length - 1 then tpl.append ", "
-                       end
-                       tpl.append ")"
-               end
-               if return_mtype != null then
-                       tpl.append ": "
-                       tpl.append return_mtype.cs_signature
-               end
-               return tpl.write_to_string
-       end
-end
-
-redef class MParameter
-
-       # Returns `self` name and ellipsys if any.
-       fun cs_short_signature: String do
-               var tpl = new FlatBuffer
-               tpl.append name
-               if is_vararg then tpl.append "..."
-               return tpl.write_to_string
-       end
-
-       # Returns `self` name with it's static type and ellipsys if any.
-       fun cs_signature: String do
-               var tpl = new FlatBuffer
-               tpl.append "{name}: "
-               tpl.append mtype.cs_signature
-               if is_vararg then tpl.append "..."
-               return tpl.write_to_string
-       end
-end
-
-################################################################################
-# Additions to `model_ext`.
-
-redef class MRawType
-       redef fun cs_signature do
-               var tpl = new FlatBuffer
-
-               for part in parts do
-                       if part.target != null then
-                               tpl.append part.target.as(not null).cs_name
-                       else
-                               tpl.append part.text
-                       end
-               end
-               return tpl.write_to_string
-       end
-end
-
-redef class MInnerClass
-       redef fun cs_signature do return inner.cs_signature
-end
-
-redef class MInnerClassDef
-       redef fun cs_signature do return inner.cs_signature
-end
diff --git a/src/doc/console_templates/console_templates.nit b/src/doc/console_templates/console_templates.nit
deleted file mode 100644 (file)
index fbeea29..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Introduces templates that compose the documentation in console rendering.
-module console_templates
-
-import console_model
-import doc_phases::doc_structure
-
-# Renders the page displayable as ASCII.
-redef class DocPage
-       super Template
-
-       # Renders the footer and content.
-       private fun render_content do add root
-
-       # Renders the whole page
-       redef fun rendering do render_content
-end
-
-redef class DocComposite
-       super Template
-
-       # Title that can be decorated for console display.
-       #
-       # Set as `null` if you don't want to display a title.
-       var cs_title: nullable String is writable, lazy do return title
-
-       # Subtitle that can be decorated for console display.
-       #
-       # Set as `null` if you don't want to display a subtitle.
-       var cs_subtitle: nullable String is noinit, writable
-
-       # Renders the element `cs_title` and `cs_subtitle` as any.
-       fun render_title do
-               if cs_title != null then
-                       add "{"#" * depth} ".blue.bold
-                       addn cs_title.blue.bold
-               end
-               if cs_subtitle != null then
-                       addn cs_subtitle.gray.bold
-               end
-               if cs_title != null or cs_subtitle != null then addn ""
-       end
-
-       # Renders the element body.
-       fun render_body do for child in children do add child.write_to_string
-
-       redef fun rendering do
-               render_title
-               render_body
-       end
-end
-
-redef class DocRoot
-       redef fun rendering do render_body
-end
-
-redef class ConcernSection
-       redef var cs_title is lazy do return "in {mentity.cs_namespace}"
-       redef var cs_subtitle is lazy do return mentity.cs_declaration
-
-       redef fun rendering do
-               var mentity = self.mentity
-               if mentity isa MGroup and mentity.mpackage.root == mentity then
-                       render_body
-               else
-                       super
-               end
-       end
-end
-
-redef class MEntityComposite
-       redef var cs_title is lazy do return mentity.cs_name
-       redef var cs_subtitle is lazy do return mentity.cs_namespace
-end
-
-redef class IntroArticle
-       redef fun render_body do
-               addn "    {mentity.cs_declaration.bold}"
-               addn "    {mentity.cs_location.gray.bold}"
-               addn ""
-               var comment = mentity.cs_comment
-               if comment != null then
-                       add comment
-               end
-               addn ""
-               super
-       end
-end
-
-redef class ConcernsArticle
-       redef fun render_body do
-               var w = new StringWriter
-               concerns.write_to(w)
-               addn w.to_s
-       end
-end
-
-redef class DefinitionArticle
-       # If short, displays only synopsyses.
-       var is_short = false is writable
-
-       redef fun render_body do
-               addn "    {mentity.cs_visibility_color(mentity.cs_declaration).bold}"
-               addn "    {mentity.cs_location.gray.bold}"
-               addn ""
-               var comment
-               if is_short then
-                       comment = mentity.cs_short_comment
-               else
-                       comment = mentity.cs_comment
-               end
-               if comment != null then
-                       add comment
-               end
-               addn ""
-               super
-       end
-end
-
-redef class MEntitiesListArticle
-       redef fun render_body do
-               for mentity in mentities do
-                       addn mentity.cs_short_list_item
-               end
-       end
-end
diff --git a/src/doc/doc_phases/doc_console.nit b/src/doc/doc_phases/doc_console.nit
deleted file mode 100644 (file)
index 6a5d045..0000000
+++ /dev/null
@@ -1,549 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Nitx related components
-#
-# This module is a place holder for `nitx` related services.
-# No `doc_phase` can be found here, only components used by Nitx tool.
-module doc_console
-
-import semantize
-import doc_commands
-import doc_poset
-import doc::console_templates
-import model::model_index
-
-# Nitx handles console I/O.
-#
-# Using `prompt`, the command line can be turned on an interactive tool.
-class Nitx
-
-       # ToolContext used to access options.
-       var ctx: ToolContext
-
-       # DocModel that contains the informations to display.
-       var doc: DocModel
-
-       # Comparator used to sort MEntities.
-       var sorter = new MEntityNameSorter
-
-       # Displays the welcome message and start prompt.
-       fun start do
-               welcome
-               prompt
-       end
-
-       # Displays the welcome message and the list of loaded modules.
-       fun welcome do
-               print "Welcome in the Nit Index."
-               print ""
-               print "Loaded modules:"
-               var mmodules = doc.mmodules.to_a
-               sorter.sort(mmodules)
-               for m in mmodules do
-                       print "\t{m.name}"
-               end
-               print ""
-               help
-       end
-
-       # Displays the list of available commands.
-       fun help do
-               print "\nCommands:\n"
-               print "\tname\t\t\tlookup module, class and property with the corresponding 'name'"
-               print "\tdoc: <name::space>\tdisplay the documentation page of 'namespace'"
-               print "\nType lookup:"
-               print "\tparam: <Type>\t\tlookup methods using the corresponding 'Type' as parameter"
-               print "\treturn: <Type>\t\tlookup methods returning the corresponding 'Type'"
-               print "\tnew: <Type>\t\tlookup methods creating new instances of 'Type'"
-               print "\tcall: <name>\t\tlookup methods calling 'name'"
-               print "\nHierarchy lookup:"
-               print "\tparents: <Class>\tlist direct parents of 'Class'"
-               print "\tancestors: <Class>\tlist all ancestors of 'Class'"
-               print "\tchildren: <Class>\tlist direct children of 'Class'"
-               print "\tdescendants: <Class>\tlist all descendants of 'Class'"
-               print "\nCode lookup:"
-               print "\tcode: <name>\t\tdisplay the source code associated to the 'name' entity"
-               print "\n"
-               print "\t:h\t\t\tdisplay this help message"
-               print "\t:q\t\t\tquit interactive mode"
-               print ""
-       end
-
-       # Prompts the user for a command.
-       fun prompt do
-               printn ">> "
-               do_query(sys.stdin.read_line)
-               prompt
-       end
-
-       # Parser used to process doc commands
-       var parser: DocCommandParser is lazy do
-               var parser = new DocCommandParser
-               parser.allowed_commands = ["doc", "comment", "list", "param", "return",
-                       "new", "call", "code"]
-               return parser
-       end
-
-       # Processes the query string and performs it.
-       fun do_query(str: String) do
-               if str == ":q" then
-                       exit 0
-               else if str == ":h" then
-                       help
-                       return
-               end
-               var query = parser.parse(str)
-               if query == null then
-                       query = new CommentCommand(str)
-                       query.arg = str
-               end
-               var res = query.perform(self, doc)
-               var suggest = null
-               if res.is_empty then
-                       suggest = query.suggest(self, doc)
-               end
-               var page = query.make_results(self, res, suggest)
-               print page.write_to_string
-       end
-end
-
-redef class DocCommand
-
-       # Looks up the `doc` model and returns possible matches.
-       fun perform(nitx: Nitx, doc: DocModel): Array[NitxMatch] is abstract
-
-       # Looks up the `doc` model and returns possible suggestions.
-       fun suggest(nitx: Nitx, doc: DocModel): nullable Array[MEntity] do
-               return find_suggestions(doc, arg)
-       end
-
-       # Pretty prints the results for the console.
-       fun make_results(nitx: Nitx, results: Array[NitxMatch], suggest: nullable Array[MEntity]): DocPage do
-               var page = new DocPage("results", "Results")
-               page.root.add_child(new QueryResultArticle("results", "Results", self, results, suggest))
-               return page
-       end
-
-       # Lookup mentities based on a `query` string.
-       #
-       # 1- lookup by first name (returns always one value)
-       # 2- lookup by name (can return conflicts)
-       fun find_mentities(doc: DocModel, query: String): Array[MEntityMatch] do
-               var res = new Array[MEntityMatch]
-
-               # First lookup by full_name
-               var mentity = doc.mentity_by_full_name(query)
-               if mentity != null then
-                       res.add new MEntityMatch(self, mentity)
-                       return res
-               end
-
-               # If no results, lookup by name
-               for m in doc.mentities_by_name(query) do
-                       res.add new MEntityMatch(self, m)
-               end
-
-               return res
-       end
-
-       # Suggest some mentities based on a `query` string.
-       fun find_suggestions(doc: DocModel, query: String): Array[MEntity] do
-               return doc.find(query, 3)
-       end
-end
-
-# Something that matches a `DocCommand`.
-abstract class NitxMatch
-
-       # Query matched by `self`.
-       var query: DocCommand
-
-       # Pretty prints `self` for console.
-       fun make_list_item: String is abstract
-end
-
-# A match between a `DocCommand` and a `MEntity`.
-class MEntityMatch
-       super NitxMatch
-
-       # MEntity matched.
-       var mentity: MEntity
-
-       redef fun make_list_item do return mentity.cs_list_item
-end
-
-redef class CommentCommand
-       redef fun perform(nitx, doc) do return find_mentities(doc, arg)
-
-       redef fun make_results(nitx, results, suggest) do
-               var len = results.length
-               if len == 1 then
-                       var res = results.first.as(MEntityMatch)
-                       var mentity = res.mentity
-                       var page = new DocPage("resultats", "Results")
-                       var article = new DefinitionArticle("results", "Results", mentity)
-                       article.cs_title = mentity.name
-                       article.cs_subtitle = mentity.cs_declaration
-                       page.root.add_child article
-                       return page
-               else
-                       return super
-               end
-       end
-end
-
-# A query to search signatures using a specific `MType` as parameter.
-redef class ParamCommand
-       redef fun perform(nitx, doc) do
-               var res = new Array[NitxMatch]
-               var mtype_name = arg
-               for mproperty in doc.mproperties do
-                       if not mproperty isa MMethod then continue
-                       var msignature = mproperty.intro.msignature
-                       if msignature != null then
-                               for mparam in msignature.mparameters do
-                                       if mparam.mtype.name == mtype_name then
-                                               res.add new MEntityMatch(self, mproperty)
-                                       end
-                               end
-                       end
-               end
-               return res
-       end
-end
-
-# A query to search signatures using a specific `MType` as return.
-redef class ReturnCommand
-       redef fun perform(nitx, doc) do
-               var res = new Array[NitxMatch]
-               var mtype_name = arg
-               for mproperty in doc.mproperties do
-                       if not mproperty isa MMethod then continue
-                       var msignature = mproperty.intro.msignature
-                       if msignature != null then
-                               var mreturn = msignature.return_mtype
-                               if mreturn != null and mreturn.name == mtype_name then
-                                       res.add new MEntityMatch(self, mproperty)
-                               end
-                       end
-               end
-               return res
-       end
-end
-
-# A query to search methods creating new instances of a specific `MType`.
-redef class NewCommand
-       redef fun perform(nitx, doc) do
-               var res = new Array[NitxMatch]
-               var mtype_name = arg
-               for mpropdef in doc.mpropdefs do
-                       var visitor = new TypeInitVisitor(mtype_name)
-                       var npropdef = nitx.ctx.modelbuilder.mpropdef2node(mpropdef)
-                       if npropdef == null then continue
-                       visitor.enter_visit(npropdef)
-                       for i in visitor.inits do
-                               res.add new MEntityMatch(self, mpropdef)
-                       end
-               end
-               return res
-       end
-end
-
-# A query to search methods calling a specific `MProperty`.
-redef class CallCommand
-       redef fun perform(nitx, doc) do
-               var res = new Array[NitxMatch]
-               var mprop_name = arg
-               for mpropdef in doc.mpropdefs do
-                       var visitor = new MPropertyCallVisitor
-                       var npropdef = nitx.ctx.modelbuilder.mpropdef2node(mpropdef)
-                       if npropdef == null then continue
-                       visitor.enter_visit(npropdef)
-                       for mprop in visitor.calls do
-                               if mprop.name != mprop_name then continue
-                               res.add new MEntityMatch(self, mpropdef)
-                       end
-               end
-               return res
-       end
-end
-
-# A match between a `DocPage` and a `MEntity`.
-class PageMatch
-       super NitxMatch
-
-       # `DocPage` matched.
-       var page: DocPage
-
-       redef fun make_list_item do
-               var page = self.page
-               if page isa MEntityPage then
-                       return page.mentity.cs_list_item
-               end
-               return " * {page.title}"
-       end
-end
-
-# Search in class or module hierarchy of a `MEntity`.
-#
-# It actually searches for pages about the mentity and extracts the
-# pre-calculated hierarchies by the `doc_post` phase.
-abstract class HierarchiesQuery
-       super DocCommand
-
-       redef fun make_results(nitx, results, suggest) do
-               var page = new DocPage("hierarchy", "Hierarchy")
-               for result in results do
-                       if not result isa PageMatch then continue
-                       var rpage = result.page
-                       if not rpage isa MClassPage then continue
-                       page.root.add_child build_article(rpage)
-               end
-               return page
-       end
-
-       # Build an article containing the hierarchy list depending on subclasses.
-       private fun build_article(page: MClassPage): DocArticle is abstract
-end
-
-# List all parents of a `MClass`.
-class AncestorsQuery
-       super HierarchiesQuery
-
-       redef fun build_article(page) do
-               return new MEntitiesListArticle(
-                       "ancerstors",
-                       "Ancestors for {page.mentity.name}",
-                       page.ancestors.to_a)
-       end
-end
-
-# List direct parents of a `MClass`.
-class ParentsQuery
-       super HierarchiesQuery
-
-       redef fun build_article(page) do
-               return new MEntitiesListArticle(
-                       "parents",
-                       "Parents for {page.mentity.name}",
-                       page.parents.to_a)
-       end
-end
-
-# List direct children of a `MClass`.
-class ChildrenQuery
-       super HierarchiesQuery
-
-       redef fun build_article(page) do
-               return new MEntitiesListArticle(
-                       "children",
-                       "Children for {page.mentity.name}",
-                       page.children.to_a)
-       end
-end
-
-# List all descendants of a `MClass`.
-class DescendantsQuery
-       super HierarchiesQuery
-
-       redef fun build_article(page) do
-               return new MEntitiesListArticle(
-                       "descendants",
-                       "Descendants for {page.mentity.name}",
-                       page.children.to_a)
-       end
-end
-
-# A query to search source code from a file name.
-redef class CodeCommand
-       # FIXME refactor this!
-       redef fun perform(nitx, doc) do
-               var res = new Array[NitxMatch]
-               var name = arg
-               # if name is an existing sourcefile, opens it
-               if name.file_exists then
-                       var fr = new FileReader.open(name)
-                       var content = fr.read_all
-                       fr.close
-                       res.add new CodeMatch(self, name, content)
-                       return res
-               end
-               # else, lookup the model by name
-               for match in find_mentities(doc, name) do
-                       if match.mentity isa MClass then continue
-                       if match.mentity isa MProperty then continue
-                       res.add new CodeMatch(self, match.mentity.cs_location, match.mentity.cs_source_code)
-               end
-               return res
-       end
-
-       redef fun make_results(nitx, results, suggest) do
-               var page = new DocPage("results", "Code Results")
-               for res in results do
-                       page.add new CodeQueryArticle("results", "Results", self, res.as(CodeMatch))
-               end
-               return page
-       end
-end
-
-# A match between a piece of code and a string.
-class CodeMatch
-       super NitxMatch
-
-       # Location of the code match.
-       var location: String
-
-       # Piece of code matched.
-       var content: String
-
-       redef fun make_list_item do return "* {location}"
-end
-
-## exploration
-
-# Visitor looking for initialized `MType` (new T).
-#
-# See `NewQuery`.
-private class TypeInitVisitor
-       super Visitor
-
-       # `MType` name to look for.
-       var mtype_name: String
-
-       var inits = new HashSet[MType]
-       redef fun visit(node)
-       do
-               node.visit_all(self)
-               # look for init
-               if not node isa ANewExpr then return
-               var mtype = node.n_type.mtype
-               if mtype != null and mtype.name == mtype_name then inits.add(mtype)
-       end
-end
-
-# Visitor looking for calls to a `MProperty` (new T).
-#
-# See `CallQuery`.
-private class MPropertyCallVisitor
-       super Visitor
-
-       var calls = new HashSet[MProperty]
-       redef fun visit(node)
-       do
-               node.visit_all(self)
-               if not node isa ASendExpr then return
-               calls.add node.callsite.as(not null).mproperty
-       end
-end
-
-# display
-
-# A `DocArticle` that displays query results.
-private class QueryResultArticle
-       super DocArticle
-
-       # Query linked to the results to display.
-       var query: DocCommand
-
-       # Results to display.
-       var results: Array[NitxMatch]
-
-       # Optional suggestion when no matches where found
-       var suggest: nullable Array[MEntity] = null is optional
-
-       redef fun render_title do
-               var len = results.length
-               if len == 0 then
-                       addn "No result found for '{query.string}'..."
-                       var suggest = self.suggest
-                       if suggest != null and suggest.not_empty then
-                               add "\nDid you mean "
-                               var i = 0
-                               for s in suggest do
-                                       add "`{s.full_name}`"
-                                       if i == suggest.length - 2 then add ", "
-                                       if i == suggest.length - 1 then add " or "
-                                       i += 1
-                               end
-                               add "?"
-                       end
-               else
-                       add "# {len} result(s) for '{query.string}'".green.bold
-               end
-       end
-
-       redef fun render_body do
-               addn ""
-               for result in results do
-                       addn ""
-                       addn result.make_list_item
-               end
-       end
-end
-
-# An article that displays a piece of code.
-private class CodeQueryArticle
-       super DocArticle
-
-       # The query linked to the result to display.
-       var query: DocCommand
-
-       # The result to display.
-       var result: CodeMatch
-
-       redef fun render_body do
-               addn ""
-               addn "in {result.location}".gray.bold
-               addn ""
-               add result.content
-       end
-end
-
-# A Pager is used to display data into a unix `less` container.
-private class Pager
-
-       # Content to display.
-       var content = new FlatBuffer
-
-       # Adds text to the pager.
-       fun add(text: String) do
-               content.append(escape(text))
-       end
-
-       fun render do sys.system("echo \"{content}\" | less -r")
-
-       fun escape(str: String): String
-       do
-               var b = new FlatBuffer
-               for c in str.chars do
-                       if c == '\n' then
-                               b.append("\\n")
-                       else if c == '\0' then
-                               b.append("\\0")
-                       else if c == '"' then
-                               b.append("\\\"")
-                       else if c == '\\' then
-                               b.append("\\\\")
-                       else if c == '`' then
-                               b.append("'")
-                       else if c.code_point < 32 then
-                               b.append("\\{c.code_point.to_base(8)}")
-                       else
-                               b.add(c)
-                       end
-               end
-               return b.to_s
-       end
-end
diff --git a/src/doc/templates/templates_json.nit b/src/doc/templates/templates_json.nit
new file mode 100644 (file)
index 0000000..a75dc49
--- /dev/null
@@ -0,0 +1,378 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Make model entities Serializable.
+#
+# To avoid cycles, every reference from a MEntity to another is replaced by a
+# MEntityRef.
+#
+# How subobjects are retrieved using the MEntityRef is the responsability of the
+# client. Json objects can be returned as this or inflated with concrete objet
+# rather than the refs.
+#
+# TODO consider serialization module?
+module templates_json
+
+import model::model_collect
+import json::static
+import json::serialization_write
+import catalog
+import doc_down
+
+redef class MEntity
+       serialize
+
+       private fun core_serialize_base(v: Serializer) do
+               v.serialize_attribute("name", name)
+               var mdoc = mdoc_or_fallback
+               if mdoc != null then
+                       v.serialize_attribute("synopsis", mdoc.synopsis)
+               end
+       end
+
+       redef fun core_serialize_to(v) do
+               core_serialize_base(v)
+
+               v.serialize_attribute("namespace", json_namespace)
+               v.serialize_attribute("class_name", class_name)
+               v.serialize_attribute("full_name", full_name)
+               v.serialize_attribute("visibility", visibility.to_s)
+               var mdoc = mdoc_or_fallback
+               if mdoc != null then
+                       v.serialize_attribute("html_synopsis", mdoc.html_synopsis.write_to_string)
+               end
+
+               var modifiers = collect_modifiers
+               if modifiers.not_empty then
+                       v.serialize_attribute("modifiers", modifiers)
+               end
+       end
+
+       # Return `self.full_name` as an object that can be serialized to json.
+       fun json_namespace: JsonNamespace is abstract
+
+       # Return a new MEntityRef to `self`.
+       fun to_json_ref: MEntityRef do return new MEntityRef(self)
+end
+
+redef class MDoc
+       serialize
+
+       redef fun core_serialize_to(v) do
+               var doc = html_documentation.write_to_string.trim
+               if not doc.is_empty then
+                       v.serialize_attribute("html_documentation", doc)
+               end
+       end
+end
+
+redef class nitc::Location
+       serialize
+
+       redef fun core_serialize_to(v) do
+               v.serialize_attribute("column_end", column_end)
+               v.serialize_attribute("column_start", column_start)
+               v.serialize_attribute("line_end", line_end)
+               v.serialize_attribute("line_start", line_start)
+               var file = self.file
+               if file != null then
+                       v.serialize_attribute("file", file.filename)
+               end
+       end
+end
+
+redef class MPackage
+       redef fun core_serialize_to(v) do
+               super
+
+               var metadata = self.metadata
+               if metadata.license != null then
+                       v.serialize_attribute("license", metadata.license)
+               end
+               if metadata.maintainers.not_empty then
+                       v.serialize_attribute("maintainer", metadata.maintainers.first)
+               end
+               if metadata.tags.not_empty then
+                       v.serialize_attribute("tags", metadata.tags)
+               end
+       end
+
+       redef fun json_namespace do
+               var ns = new JsonNamespace
+               ns.add to_json_ref
+               return ns
+       end
+end
+
+redef class MGroup
+       redef fun json_namespace do
+               var ns = new JsonNamespace
+               if parent != null then
+                       ns.prepend parent.as(not null).json_namespace
+               end
+               ns.add to_json_ref
+               ns.add ">"
+               return ns
+       end
+end
+
+redef class MModule
+       redef fun json_namespace do
+               var ns = new JsonNamespace
+               if mgroup != null then
+                       ns.add_all mgroup.as(not null).mpackage.json_namespace
+                       ns.add "::"
+               end
+               ns.add to_json_ref
+               return ns
+       end
+
+       private fun ns_for(visibility: MVisibility): JsonNamespace do
+               if visibility <= private_visibility then return json_namespace
+               var mgroup = self.mgroup
+               if mgroup == null then return json_namespace
+               return mgroup.mpackage.json_namespace
+       end
+end
+
+redef class MClass
+       redef fun core_serialize_to(v) do
+               super
+
+               if mparameters.not_empty then
+                       v.serialize_attribute("mparameters", mparameters)
+               end
+       end
+
+       redef fun json_namespace do
+               var ns = new JsonNamespace
+               ns.add_all intro_mmodule.ns_for(visibility)
+               ns.add "::"
+               ns.add to_json_ref
+               return ns
+       end
+end
+
+redef class MClassDef
+       redef fun core_serialize_to(v) do
+               super
+               if is_intro then
+                       v.serialize_attribute("is_intro", true)
+               end
+               if mclass.mparameters.not_empty then
+                       v.serialize_attribute("mparameters", mclass.mparameters)
+               end
+       end
+
+       redef fun json_namespace do
+               var ns = new JsonNamespace
+               if is_intro then
+                       ns.add_all mmodule.ns_for(mclass.visibility)
+                       ns.add "$"
+                       ns.add mclass.to_json_ref
+               else if mclass.intro_mmodule.mpackage != mmodule.mpackage then
+                       ns.add_all mmodule.json_namespace
+                       ns.add "$"
+                       ns.add_all mclass.json_namespace
+               else if mclass.visibility > private_visibility then
+                       ns.add_all mmodule.json_namespace
+                       ns.add "$"
+                       ns.add mclass.to_json_ref
+               else
+                       ns.add_all mmodule.json_namespace
+                       ns.add "$::"
+                       ns.add mclass.intro_mmodule.to_json_ref
+                       ns.add "::"
+                       ns.add mclass.to_json_ref
+               end
+               return ns
+       end
+end
+
+redef class MProperty
+       redef fun json_namespace do
+               var ns = new JsonNamespace
+               if intro_mclassdef.is_intro then
+                       ns.add_all intro_mclassdef.mmodule.ns_for(visibility)
+                       ns.add "::"
+                       ns.add intro_mclassdef.mclass.to_json_ref
+                       ns.add "::"
+                       ns.add to_json_ref
+               else
+                       ns.add_all intro_mclassdef.mmodule.json_namespace
+                       ns.add "::"
+                       ns.add intro_mclassdef.mclass.to_json_ref
+                       ns.add "::"
+                       ns.add to_json_ref
+               end
+               return ns
+       end
+end
+
+redef class MMethod
+       redef fun core_serialize_to(v) do
+               super
+               if is_init then
+                       v.serialize_attribute("is_init", true)
+               end
+               v.serialize_attribute("msignature", intro.msignature)
+       end
+end
+
+redef class MAttribute
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("static_mtype", intro.static_mtype)
+       end
+end
+
+redef class MVirtualTypeProp
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("bound", intro.bound)
+       end
+end
+
+redef class MPropDef
+       redef fun core_serialize_to(v) do
+               super
+               if is_intro then
+                       v.serialize_attribute("is_intro", true)
+               end
+       end
+
+       redef fun json_namespace do
+               var res = new JsonNamespace
+               res.add_all mclassdef.json_namespace
+               res.add "$"
+
+               if mclassdef.mclass == mproperty.intro_mclassdef.mclass then
+                       res.add to_json_ref
+               else
+                       if mclassdef.mmodule.mpackage != mproperty.intro_mclassdef.mmodule.mpackage then
+                               res.add_all mproperty.intro_mclassdef.mmodule.ns_for(mproperty.visibility)
+                               res.add "::"
+                       else if mproperty.visibility <= private_visibility then
+                               if mclassdef.mmodule.namespace_for(mclassdef.mclass.visibility) != mproperty.intro_mclassdef.mmodule.mpackage then
+                                       res.add "::"
+                                       res.add mproperty.intro_mclassdef.mmodule.to_json_ref
+                                       res.add "::"
+                               end
+                       end
+                       if mclassdef.mclass != mproperty.intro_mclassdef.mclass then
+                               res.add mproperty.intro_mclassdef.to_json_ref
+                               res.add "::"
+                       end
+                       res.add to_json_ref
+               end
+               return res
+       end
+end
+
+redef class MMethodDef
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("msignature", msignature)
+       end
+end
+
+redef class MAttributeDef
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("static_mtype", static_mtype)
+       end
+end
+
+redef class MVirtualTypeDef
+       redef fun core_serialize_to(v) do
+               super
+               v.serialize_attribute("bound", bound)
+       end
+end
+
+redef class MType
+       redef fun core_serialize_to(v) do
+               v.serialize_attribute("name", name)
+
+               var mdoc = mdoc_or_fallback
+               if mdoc != null then
+                       v.serialize_attribute("synopsis", mdoc.synopsis)
+                       v.serialize_attribute("html_synopsis", mdoc.html_synopsis.write_to_string)
+               end
+       end
+end
+
+
+redef class MSignature
+       redef fun core_serialize_to(v) do
+               v.serialize_attribute("arity", arity)
+               v.serialize_attribute("mparameters", mparameters)
+               v.serialize_attribute("return_mtype", return_mtype)
+       end
+end
+
+redef class MParameterType
+       redef fun core_serialize_to(v) do
+               v.serialize_attribute("name", name)
+               v.serialize_attribute("mtype", mclass.intro.bound_mtype.arguments[rank])
+       end
+end
+
+redef class MParameter
+       redef fun core_serialize_to(v) do
+               v.serialize_attribute("is_vararg", is_vararg)
+               v.serialize_attribute("name", name)
+               v.serialize_attribute("mtype", mtype)
+       end
+end
+
+# Fullname representation that can be used to build decorated links
+#
+# * MPackage: `mpackage_name`
+# * MGroup: `(mpackage_name::)mgroup_name`
+class JsonNamespace
+       super Array[nullable JsonRef]
+       serialize
+
+       redef fun to_s do return self.join("")
+       redef fun serialize_to(v) do to_a.serialize_to(v)
+end
+
+# Something that goes in a JsonNamespace
+#
+# Can be either:
+# * a `RefToken` for tokens like `::`, `>` and `$`
+# * a `MEntityRef` for references to mentities
+interface JsonRef
+       super Serializable
+end
+
+# A reference to another mentity.
+class MEntityRef
+       super JsonRef
+
+       # MEntity to link to.
+       var mentity: MEntity
+
+       redef fun core_serialize_to(v) do
+               mentity.core_serialize_base(v)
+       end
+end
+
+# A namespace token representation
+#
+# Used for namespace tokens like `::`, `>` and `$`
+redef class String
+       super JsonRef
+end
diff --git a/src/doc/templates/templates_term.nit b/src/doc/templates/templates_term.nit
new file mode 100644 (file)
index 0000000..b4fc2fe
--- /dev/null
@@ -0,0 +1,311 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Markdown templates for Nit model MEntities.
+#
+# This module introduces Markdown rendering services in model entities.
+# With the `no_color` option set to `false`, the output can be highlighted for console.
+module templates_term
+
+import model_collect
+import console
+
+redef class MDoc
+       # Returns the full comment formatted for the console
+       fun cs_comment(no_color: nullable Bool, indent: nullable Int): String do
+               var res = new FlatBuffer
+               indent = indent or else 0
+               for line in content do
+                       res.append "{" " * indent}{line}\n"
+               end
+               if no_color == null or not no_color then
+                       return res.write_to_string.green
+               end
+               return res.write_to_string
+       end
+
+       # Returns the synopsys formatted for the console
+       fun cs_short_comment(no_color: nullable Bool): String do
+               if no_color == null or not no_color then
+                       return content.first.green
+               end
+               return content.first
+       end
+end
+
+redef class MEntity
+
+       # Text icon to be displayed in front of the entity
+       fun cs_icon(no_color: nullable Bool): String do
+               return public_visibility.cs_icon(no_color)
+       end
+
+       # Source code location of this MEntity formatted for console
+       fun cs_location(no_color: nullable Bool): String do
+               if no_color == null or not no_color then
+                       return location.to_s.bold.gray
+               end
+               return location.to_s
+       end
+
+       # Returns `self.full_name` formatted for console
+       fun cs_full_name(no_color: nullable Bool): String do
+               if no_color == null or not no_color then
+                       return full_name.bold.blue
+               end
+               return full_name
+       end
+
+       # Returns `self` signature formatted for console.
+       fun cs_signature(no_color: nullable Bool): String do return ""
+
+       # Returns the comment of this MEntity formatted for console.
+       fun cs_comment(no_color: nullable Bool): nullable String do
+               var mdoc = mdoc_or_fallback
+               if mdoc == null then return null
+               # FIXME add markdown for console
+               return mdoc.cs_comment(no_color)
+       end
+
+       # Returns the comment of this MEntity formatted for console.
+       fun cs_short_comment(no_color: nullable Bool): nullable String do
+               var mdoc = mdoc_or_fallback
+               if mdoc == null then return null
+               return mdoc.cs_short_comment(no_color)
+       end
+
+       # Returns the complete MEntity declaration (modifiers + name + signature).
+       #
+       # * MPackage: `package foo`
+       # * MGroup: `group foo`
+       # * MModule: `module foo`
+       # * MClass: `private abstract class Foo[E: Object]`
+       # * MClassDef: `redef class Foo[E]`
+       # * MProperty: `private fun foo(e: Object): Int`
+       # * MPropdef: `redef fun foo(e)`
+       fun cs_declaration(no_color: nullable Bool): String do
+               var tpl = new FlatBuffer
+               tpl.append collect_modifiers.join(" ")
+               tpl.append " "
+               tpl.append name
+               tpl.append cs_signature(no_color)
+               if no_color == null or not no_color then
+                       return tpl.write_to_string.bold
+               end
+               return tpl.write_to_string
+       end
+
+       # Returns `self` as a list element that can be displayed in console.
+       #
+       # Displays `cs_icon`, `cs_name`, `cs_short_comment, `cs_namespace`,
+       # `cs_declaration` and `cs_location`.
+       fun cs_list_item(no_color: nullable Bool): String do
+               var tpl = new FlatBuffer
+               tpl.append " "
+               tpl.append cs_icon(no_color)
+               tpl.append " "
+               tpl.append cs_full_name(no_color)
+               var comment = cs_short_comment(no_color)
+               if comment != null then
+                       tpl.append "\n   "
+                       if no_color == null or not no_color then
+                               tpl.append "# ".green
+                       else
+                               tpl.append "# "
+                       end
+                       tpl.append comment
+               end
+               tpl.append "\n   "
+               tpl.append cs_declaration(no_color)
+               tpl.append "\n   "
+               tpl.append cs_location(no_color)
+               return tpl.write_to_string
+       end
+
+       # Source code associated to this MEntity.
+       #
+       # Uses `cs_location` to locate the source code.
+       fun cs_source_code: String do
+               var tpl = new Buffer
+               tpl.append "\n~~~\n"
+               tpl.append location.text
+               tpl.append "\n~~~\n"
+               return tpl.write_to_string
+       end
+end
+
+redef class MClass
+       redef fun cs_icon(no_color) do return intro.cs_icon(no_color)
+       redef fun cs_signature(no_color) do return intro.cs_signature(no_color)
+end
+
+redef class MClassDef
+       redef fun cs_icon(no_color) do
+               if is_intro then return visibility.cs_icon(no_color)
+               return visibility.cs_visibility_color("*")
+       end
+
+       # Returns the MClassDef generic signature with static bounds.
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               var mparameters = mclass.mparameters
+               if not mparameters.is_empty then
+                       tpl.append "["
+                       for i in [0..mparameters.length[ do
+                               tpl.append "{mparameters[i].name}: "
+                               tpl.append bound_mtype.arguments[i].cs_signature(no_color)
+                               if i < mparameters.length - 1 then tpl.append ", "
+                       end
+                       tpl.append "]"
+               end
+               return tpl.write_to_string
+       end
+end
+
+redef class MProperty
+       redef fun cs_icon(no_color) do return intro.cs_icon(no_color)
+       redef fun cs_signature(no_color) do return intro.cs_signature(no_color)
+end
+
+redef class MPropDef
+       redef fun cs_icon(no_color) do
+               if is_intro then return visibility.cs_icon(no_color)
+               return visibility.cs_visibility_color("*", no_color)
+       end
+end
+
+redef class MAttributeDef
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               var static_mtype = self.static_mtype
+               if static_mtype != null then
+                       tpl.append ": "
+                       tpl.append static_mtype.cs_signature(no_color)
+               end
+               return tpl.write_to_string
+       end
+end
+
+redef class MMethodDef
+       redef fun cs_signature(no_color) do
+               if mproperty.is_root_init then
+                       return new_msignature.as(not null).cs_signature(no_color)
+               end
+               return msignature.as(not null).cs_signature(no_color)
+       end
+end
+
+redef class MVirtualTypeDef
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               var bound = self.bound
+               if bound == null then return tpl.write_to_string
+               tpl.append ": "
+               tpl.append bound.cs_signature(no_color)
+               return tpl.write_to_string
+       end
+end
+
+redef class MClassType
+       redef fun cs_signature(no_color) do return name
+end
+
+redef class MNullableType
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               tpl.append "nullable "
+               tpl.append mtype.cs_signature(no_color)
+               return tpl.write_to_string
+       end
+end
+
+redef class MGenericType
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               tpl.append mclass.name
+               tpl.append "["
+               for i in [0..arguments.length[ do
+                       tpl.append arguments[i].cs_signature(no_color)
+                       if i < arguments.length - 1 then tpl.append ", "
+               end
+               tpl.append "]"
+               return tpl.write_to_string
+       end
+end
+
+redef class MParameterType
+       redef fun cs_signature(no_color) do return name
+end
+
+redef class MVirtualType
+       redef fun cs_signature(no_color) do return name
+end
+
+redef class MSignature
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               if not mparameters.is_empty then
+                       tpl.append "("
+                       for i in [0..mparameters.length[ do
+                               tpl.append mparameters[i].cs_signature(no_color)
+                               if i < mparameters.length - 1 then tpl.append ", "
+                       end
+                       tpl.append ")"
+               end
+               var return_mtype = self.return_mtype
+               if return_mtype != null then
+                       tpl.append ": "
+                       tpl.append return_mtype.cs_signature(no_color)
+               end
+               return tpl.write_to_string
+       end
+end
+
+redef class MParameter
+       redef fun cs_signature(no_color) do
+               var tpl = new FlatBuffer
+               tpl.append "{name}: "
+               tpl.append mtype.cs_signature(no_color)
+               if is_vararg then tpl.append "..."
+               return tpl.write_to_string
+       end
+end
+
+redef class MVisibility
+       # Visibility icon
+       fun cs_icon(no_color: nullable Bool): String do
+               var icon
+               if self == private_visibility then
+                       icon = cs_visibility_color("-", no_color)
+               else if self == protected_visibility then
+                       icon = cs_visibility_color("#", no_color)
+               else
+                       icon = cs_visibility_color("+", no_color)
+               end
+               if no_color != null and no_color then return icon
+               return icon.bold
+       end
+
+       # Colorize `string` depending on the visibility
+       fun cs_visibility_color(string: String, no_color: nullable Bool): String do
+               if no_color != null and no_color then return string
+               if self == private_visibility then
+                       return string.red
+               else if self == protected_visibility then
+                       return string.yellow
+               else
+                       return string.green
+               end
+       end
+end
similarity index 79%
rename from src/model/test_model_json.nit
rename to src/doc/templates/tests/test_templates_json.nit
index cc10f48..f1ba536 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_model_json is test
+module test_templates_json is test
 
-import model_json
+import templates_json
 import frontend
 
 class TestModelSerialization
        test
 
        var suite_path: String = "NIT_TESTING_PATH".environ
-       var lib_path: String = "{suite_path.dirname}/../../tests/test_prog"
+       var lib_path: String = "{suite_path.dirname}/../../../../tests/test_prog"
 
        var mainmodule: MModule is noinit
 
@@ -43,54 +43,54 @@ class TestModelSerialization
                mentities.add model.mmodules.first
                mentities.add model.mclasses.first
                for mentity in mentities do
-                       print ((new MEntityRef(mentity)).to_pretty_full_json(mainmodule))
+                       print ((new MEntityRef(mentity)).serialize_to_json(pretty = true, plain = true))
                end
        end
 
        fun test_packages_to_full_json is test do
                for mentity in model.mpackages do
-                       print mentity.to_pretty_full_json(mainmodule)
+                       print mentity.serialize_to_json(pretty = true, plain = true)
                end
        end
 
        fun test_groups_to_full_json is test do
                for mpackage in model.mpackages do
                        for mentity in mpackage.mgroups do
-                               print mentity.to_pretty_full_json(mainmodule)
+                               print mentity.serialize_to_json(pretty = true, plain = true)
                        end
                end
        end
 
        fun test_modules_to_full_json is test do
                for mentity in model.mmodules do
-                       print mentity.to_pretty_full_json(mainmodule)
+                       print mentity.serialize_to_json(pretty = true, plain = true)
                end
        end
 
        fun test_classes_to_full_json is test do
                for mentity in model.mclasses do
-                       print mentity.to_pretty_full_json(mainmodule)
+                       print mentity.serialize_to_json(pretty = true, plain = true)
                end
        end
 
        fun test_classdefs_to_full_json is test do
                for mclass in model.mclasses do
                        for mentity in mclass.mclassdefs do
-                               print mentity.to_pretty_full_json(mainmodule)
+                               print mentity.serialize_to_json(pretty = true, plain = true)
                        end
                end
        end
 
        fun test_props_to_full_json is test do
                for mentity in model.mproperties do
-                       print mentity.to_pretty_full_json(mainmodule)
+                       print mentity.serialize_to_json(pretty = true, plain = true)
                end
        end
 
        fun test_propdefs_to_full_json is test do
                for mprop in model.mproperties do
                        for mentity in mprop.mpropdefs do
-                               print mentity.to_pretty_full_json(mainmodule)
+                               print mentity.serialize_to_json(pretty = true, plain = true)
                        end
                end
        end
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_classdefs_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_classdefs_to_full_json.res
new file mode 100644 (file)
index 0000000..241e975
--- /dev/null
@@ -0,0 +1,397 @@
+{
+       "name": "Object",
+       "synopsis": "Root of everything.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Object",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>",
+       "modifiers": ["interface"],
+       "is_intro": true
+}
+{
+       "name": "Int",
+       "synopsis": "Some services about Integers.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Int",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Float",
+       "synopsis": "Some services about Floats.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Float",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Bool",
+       "synopsis": "Booleans, `true` or `false`.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Bool",
+               "synopsis": "Booleans, `true` or `false`."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Bool",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "String",
+       "synopsis": "Strings (there is no chars...).",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "String",
+               "synopsis": "Strings (there is no chars...)."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$String",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "List",
+       "synopsis": "List of things.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "List",
+               "synopsis": "List of things."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$List",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>",
+       "modifiers": ["class"],
+       "is_intro": true,
+       "mparameters": [{
+               "name": "E",
+               "mtype": {
+                       "name": "nullable Object",
+                       "synopsis": "Root of everything.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>"
+               }
+       }]
+}
+{
+       "name": "Career",
+       "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Career",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>",
+       "modifiers": ["abstract class"],
+       "is_intro": true
+}
+{
+       "name": "Warrior",
+       "synopsis": "Warriors are good for fighting.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Warrior",
+               "synopsis": "Warriors are good for fighting."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Warrior",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Warriors are good for fighting.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Magician",
+       "synopsis": "Magicians know magic and how to use it.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Magician",
+               "synopsis": "Magicians know magic and how to use it."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Magician",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Magicians know magic and how to use it.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Alcoholic",
+       "synopsis": "Alcoholics are good to nothing escept taking punches.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Alcoholic",
+               "synopsis": "Alcoholics are good to nothing escept taking punches."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Alcoholic",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Alcoholics are good to nothing escept taking punches.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Race",
+       "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Race",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>",
+       "modifiers": ["abstract class"],
+       "is_intro": true
+}
+{
+       "name": "Human",
+       "synopsis": "Humans are able to do everithing.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Human",
+               "synopsis": "Humans are able to do everithing."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Human",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Humans are able to do everithing.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Dwarf",
+       "synopsis": "Dwarves make strong warriors.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Dwarf",
+               "synopsis": "Dwarves make strong warriors."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Dwarf",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Dwarves make strong warriors.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Dwarf",
+       "synopsis": "Dwarves can be used as weapons.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "combat",
+               "synopsis": "COmbat interactions between characters."
+       }, "$", {
+               "name": "Dwarf",
+               "synopsis": "Dwarves make strong warriors."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog::combat$Dwarf",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Dwarves can be used as weapons.</span>",
+       "modifiers": ["redef", "class"]
+}
+{
+       "name": "Elf",
+       "synopsis": "Elves make good magicians.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Elf",
+               "synopsis": "Elves make good magicians."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Elf",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Elves make good magicians.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Character",
+       "synopsis": "Characters can be played by both the human or the machine.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Character",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters can be played by both the human or the machine.</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Character",
+       "synopsis": "Characters are now `Comabatable`",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "combat",
+               "synopsis": "COmbat interactions between characters."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog::combat$Character",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters are now <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Comabatable</span></span></span></code></span>",
+       "modifiers": ["redef", "class"]
+}
+{
+       "name": "Weapon",
+       "synopsis": "Something that can be used to attack someone and inflict damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Weapon",
+               "synopsis": "Something that can be used to attack someone and inflict damage."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Weapon",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be used to attack someone and inflict damage.</span>",
+       "modifiers": ["interface"],
+       "is_intro": true
+}
+{
+       "name": "Combatable",
+       "synopsis": "Something that can be combatted, it can `attack` and `defend`.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Combatable",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be combatted, it can <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> and <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">defend</span></span></span></code>.</span>",
+       "modifiers": ["interface"],
+       "is_intro": true
+}
+{
+       "name": "Game",
+       "synopsis": "This is the interface you have to implement to use ure gaming platform.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">This is the interface you have to implement to use ure gaming platform.</span>",
+       "modifiers": ["interface"],
+       "is_intro": true
+}
+{
+       "name": "MyGame",
+       "synopsis": "This is an example of how to implement the Game interface",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$MyGame",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">This is an example of how to implement the Game interface</span>",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Starter",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Starter"
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Starter",
+       "visibility": "public",
+       "modifiers": ["class"],
+       "is_intro": true
+}
+{
+       "name": "Sys",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Sys"
+       }],
+       "class_name": "MClassDef",
+       "full_name": "test_prog$Sys",
+       "visibility": "public",
+       "modifiers": ["class"],
+       "is_intro": true
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_classes_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_classes_to_full_json.res
new file mode 100644 (file)
index 0000000..7e7c7ad
--- /dev/null
@@ -0,0 +1,338 @@
+{
+       "name": "Object",
+       "synopsis": "Root of everything.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Object",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>",
+       "modifiers": ["interface"]
+}
+{
+       "name": "Int",
+       "synopsis": "Some services about Integers.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Int",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Float",
+       "synopsis": "Some services about Floats.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Float",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Bool",
+       "synopsis": "Booleans, `true` or `false`.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Bool",
+               "synopsis": "Booleans, `true` or `false`."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Bool",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "String",
+       "synopsis": "Strings (there is no chars...).",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "String",
+               "synopsis": "Strings (there is no chars...)."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::String",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "List",
+       "synopsis": "List of things.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "List",
+               "synopsis": "List of things."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::List",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>",
+       "modifiers": ["class"],
+       "mparameters": [{
+               "name": "E",
+               "mtype": {
+                       "name": "nullable Object",
+                       "synopsis": "Root of everything.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>"
+               }
+       }]
+}
+{
+       "name": "Career",
+       "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Career",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>",
+       "modifiers": ["abstract class"]
+}
+{
+       "name": "Warrior",
+       "synopsis": "Warriors are good for fighting.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Warrior",
+               "synopsis": "Warriors are good for fighting."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Warrior",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Warriors are good for fighting.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Magician",
+       "synopsis": "Magicians know magic and how to use it.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Magician",
+               "synopsis": "Magicians know magic and how to use it."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Magician",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Magicians know magic and how to use it.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Alcoholic",
+       "synopsis": "Alcoholics are good to nothing escept taking punches.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Alcoholic",
+               "synopsis": "Alcoholics are good to nothing escept taking punches."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Alcoholic",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Alcoholics are good to nothing escept taking punches.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Race",
+       "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Race",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>",
+       "modifiers": ["abstract class"]
+}
+{
+       "name": "Human",
+       "synopsis": "Humans are able to do everithing.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Human",
+               "synopsis": "Humans are able to do everithing."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Human",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Humans are able to do everithing.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Dwarf",
+       "synopsis": "Dwarves make strong warriors.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Dwarf",
+               "synopsis": "Dwarves make strong warriors."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Dwarf",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Dwarves make strong warriors.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Elf",
+       "synopsis": "Elves make good magicians.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Elf",
+               "synopsis": "Elves make good magicians."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Elf",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Elves make good magicians.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Character",
+       "synopsis": "Characters can be played by both the human or the machine.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Character",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters can be played by both the human or the machine.</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Weapon",
+       "synopsis": "Something that can be used to attack someone and inflict damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Weapon",
+               "synopsis": "Something that can be used to attack someone and inflict damage."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Weapon",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be used to attack someone and inflict damage.</span>",
+       "modifiers": ["interface"]
+}
+{
+       "name": "Combatable",
+       "synopsis": "Something that can be combatted, it can `attack` and `defend`.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Combatable",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be combatted, it can <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> and <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">defend</span></span></span></code>.</span>",
+       "modifiers": ["interface"]
+}
+{
+       "name": "Game",
+       "synopsis": "This is the interface you have to implement to use ure gaming platform.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">This is the interface you have to implement to use ure gaming platform.</span>",
+       "modifiers": ["interface"]
+}
+{
+       "name": "MyGame",
+       "synopsis": "This is an example of how to implement the Game interface",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::MyGame",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">This is an example of how to implement the Game interface</span>",
+       "modifiers": ["class"]
+}
+{
+       "name": "Starter",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Starter"
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Starter",
+       "visibility": "public",
+       "modifiers": ["class"]
+}
+{
+       "name": "Sys",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Sys"
+       }],
+       "class_name": "MClass",
+       "full_name": "test_prog::Sys",
+       "visibility": "public",
+       "modifiers": ["class"]
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_groups_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_groups_to_full_json.res
new file mode 100644 (file)
index 0000000..3fc95f5
--- /dev/null
@@ -0,0 +1,84 @@
+{
+       "name": "test_prog",
+       "synopsis": "Test program for model tools.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, ">"],
+       "class_name": "MGroup",
+       "full_name": "test_prog>",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Test program for model tools.</span>",
+       "modifiers": ["group"]
+}
+{
+       "name": "examples",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, ">", {
+               "name": "examples"
+       }, ">"],
+       "class_name": "MGroup",
+       "full_name": "test_prog>examples>",
+       "visibility": "public",
+       "modifiers": ["group"]
+}
+{
+       "name": "game",
+       "synopsis": "Gaming group",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, ">", {
+               "name": "game",
+               "synopsis": "Gaming group"
+       }, ">"],
+       "class_name": "MGroup",
+       "full_name": "test_prog>game>",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Gaming group</span>",
+       "modifiers": ["group"]
+}
+{
+       "name": "platform",
+       "synopsis": "Fictive Crappy Platform.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, ">", {
+               "name": "platform",
+               "synopsis": "Fictive Crappy Platform."
+       }, ">"],
+       "class_name": "MGroup",
+       "full_name": "test_prog>platform>",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Fictive Crappy Platform.</span>",
+       "modifiers": ["group"]
+}
+{
+       "name": "rpg",
+       "synopsis": "Role Playing Game group",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, ">", {
+               "name": "rpg",
+               "synopsis": "Role Playing Game group"
+       }, ">"],
+       "class_name": "MGroup",
+       "full_name": "test_prog>rpg>",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Role Playing Game group</span>",
+       "modifiers": ["group"]
+}
+{
+       "name": "excluded",
+       "namespace": [{
+               "name": "excluded"
+       }, ">"],
+       "class_name": "MGroup",
+       "full_name": "excluded>",
+       "visibility": "public",
+       "modifiers": ["group"]
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_modules_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_modules_to_full_json.res
new file mode 100644 (file)
index 0000000..6b46961
--- /dev/null
@@ -0,0 +1,163 @@
+{
+       "name": "game_examples",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "game_examples"
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::game_examples",
+       "visibility": "public",
+       "modifiers": ["module"]
+}
+{
+       "name": "excluded",
+       "namespace": [{
+               "name": "excluded"
+       }, "::", {
+               "name": "excluded"
+       }],
+       "class_name": "MModule",
+       "full_name": "excluded::excluded",
+       "visibility": "public",
+       "modifiers": ["module"]
+}
+{
+       "name": "game",
+       "synopsis": "A game abstraction for RPG.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "game",
+               "synopsis": "A game abstraction for RPG."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A game abstraction for RPG.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "platform",
+       "synopsis": "Declares base types allowed on the platform.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "platform",
+               "synopsis": "Declares base types allowed on the platform."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::platform",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Declares base types allowed on the platform.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "careers",
+       "synopsis": "Careers of the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "careers",
+               "synopsis": "Careers of the game."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::careers",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Careers of the game.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "character",
+       "synopsis": "Characters are playable entity in the world.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::character",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters are playable entity in the world.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "combat",
+       "synopsis": "COmbat interactions between characters.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "combat",
+               "synopsis": "COmbat interactions between characters."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::combat",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">COmbat interactions between characters.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "races",
+       "synopsis": "Races of the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "races",
+               "synopsis": "Races of the game."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::races",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Races of the game.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "rpg",
+       "synopsis": "A worlg RPG abstraction.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "rpg",
+               "synopsis": "A worlg RPG abstraction."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::rpg",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A worlg RPG abstraction.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "test_prog",
+       "synopsis": "A test program with a fake model to check model tools.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "test_prog",
+               "synopsis": "A test program with a fake model to check model tools."
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog::test_prog",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A test program with a fake model to check model tools.</span>",
+       "modifiers": ["module"]
+}
+{
+       "name": "test_prog-m",
+       "namespace": [{
+               "name": "test_prog-m"
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog-m",
+       "visibility": "public",
+       "modifiers": ["module"]
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_packages_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_packages_to_full_json.res
new file mode 100644 (file)
index 0000000..8715a80
--- /dev/null
@@ -0,0 +1,25 @@
+{
+       "name": "test_prog",
+       "synopsis": "Test program for model tools.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }],
+       "class_name": "MPackage",
+       "full_name": "test_prog",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Test program for model tools.</span>",
+       "modifiers": ["package"],
+       "license": "Apache-2.0",
+       "tags": ["test", "game"]
+}
+{
+       "name": "excluded",
+       "namespace": [{
+               "name": "excluded"
+       }],
+       "class_name": "MPackage",
+       "full_name": "excluded",
+       "visibility": "public",
+       "modifiers": ["package"]
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_propdefs_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_propdefs_to_full_json.res
new file mode 100644 (file)
index 0000000..dea3470
--- /dev/null
@@ -0,0 +1,2558 @@
+{
+       "name": "OTHER",
+       "synopsis": "Used for comparisons.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "$", {
+               "name": "OTHER",
+               "synopsis": "Used for comparisons."
+       }],
+       "class_name": "MVirtualTypeDef",
+       "full_name": "test_prog$Object$OTHER",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used for comparisons.</span>",
+       "modifiers": ["type"],
+       "is_intro": true,
+       "bound": {
+               "name": "nullable Object",
+               "synopsis": "Root of everything.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>"
+       }
+}
+{
+       "name": "==",
+       "synopsis": "Is `other` equqls to `self`?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "$", {
+               "name": "==",
+               "synopsis": "Is `other` equqls to `self`?"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Object$==",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">other</span></span></span></code> equqls to <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">self</span></span></span></code>?</span>",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "other",
+                       "mtype": {
+                               "name": "OTHER",
+                               "synopsis": "Used for comparisons.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Used for comparisons.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "!=",
+       "synopsis": "Is `other` different from `self`?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "$", {
+               "name": "!=",
+               "synopsis": "Is `other` different from `self`?"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Object$!=",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">other</span></span></span></code> different from <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">self</span></span></span></code>?</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "other",
+                       "mtype": {
+                               "name": "OTHER",
+                               "synopsis": "Used for comparisons.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Used for comparisons.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "$", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Object$init",
+       "visibility": "public",
+       "modifiers": ["init"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Warrior",
+               "synopsis": "Warriors are good for fighting."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Warrior$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Magician",
+               "synopsis": "Magicians know magic and how to use it."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Magician$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Alcoholic",
+               "synopsis": "Alcoholics are good to nothing escept taking punches."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Alcoholic$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Human",
+               "synopsis": "Humans are able to do everithing."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Human$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Dwarf",
+               "synopsis": "Dwarves make strong warriors."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Dwarf$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Elf",
+               "synopsis": "Elves make good magicians."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Elf$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$Object::init",
+       "visibility": "public",
+       "modifiers": ["redef", "init"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "unary -",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": "unary -"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$unary -",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "+",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": "+"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$+",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "-",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": "-"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$-",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "*",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": "*"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$*",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "/",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": "/"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$/",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": ">",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": ">"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$>",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "to_f",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "$", {
+               "name": "to_f"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Int$to_f",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "+",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "$", {
+               "name": "+"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Float$+",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "-",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "$", {
+               "name": "-"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Float$-",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "*",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "$", {
+               "name": "*"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Float$*",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "/",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "$", {
+               "name": "/"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Float$/",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": ">",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "$", {
+               "name": ">"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Float$>",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "_strength_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "_strength_bonus"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Career$_strength_bonus",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "strength_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "strength_bonus"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$strength_bonus",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "strength_bonus=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "strength_bonus="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$strength_bonus=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "strength_bonus",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_endurance_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "_endurance_bonus"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Career$_endurance_bonus",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "endurance_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "endurance_bonus"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$endurance_bonus",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "endurance_bonus=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "endurance_bonus="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$endurance_bonus=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "endurance_bonus",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_intelligence_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "_intelligence_bonus"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Career$_intelligence_bonus",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "intelligence_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "intelligence_bonus"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$intelligence_bonus",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "intelligence_bonus=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "$", {
+               "name": "intelligence_bonus="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Career$intelligence_bonus=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "intelligence_bonus",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_base_strength",
+       "synopsis": "Used to represents how strong the race is.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "_base_strength",
+               "synopsis": "Used to represents how strong the race is."
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Race$_base_strength",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how strong the race is.</span>",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "base_strength",
+       "synopsis": "Used to represents how strong the race is.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "base_strength",
+               "synopsis": "Used to represents how strong the race is."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$base_strength",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how strong the race is.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "base_strength=",
+       "synopsis": "Used to represents how strong the race is.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "base_strength=",
+               "synopsis": "Used to represents how strong the race is."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$base_strength=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how strong the race is.</span>",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "base_strength",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_base_endurance",
+       "synopsis": "Used to represents how the race can absorb damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "_base_endurance",
+               "synopsis": "Used to represents how the race can absorb damage."
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Race$_base_endurance",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how the race can absorb damage.</span>",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "base_endurance",
+       "synopsis": "Used to represents how the race can absorb damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "base_endurance",
+               "synopsis": "Used to represents how the race can absorb damage."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$base_endurance",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how the race can absorb damage.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "base_endurance=",
+       "synopsis": "Used to represents how the race can absorb damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "base_endurance=",
+               "synopsis": "Used to represents how the race can absorb damage."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$base_endurance=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how the race can absorb damage.</span>",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "base_endurance",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_base_intelligence",
+       "synopsis": "Is this race smart?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "_base_intelligence",
+               "synopsis": "Is this race smart?"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Race$_base_intelligence",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is this race smart?</span>",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "base_intelligence",
+       "synopsis": "Is this race smart?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "base_intelligence",
+               "synopsis": "Is this race smart?"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$base_intelligence",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is this race smart?</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "base_intelligence=",
+       "synopsis": "Is this race smart?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "$", {
+               "name": "base_intelligence=",
+               "synopsis": "Is this race smart?"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Race$base_intelligence=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is this race smart?</span>",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "base_intelligence",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_race",
+       "synopsis": "The `Race` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "_race",
+               "synopsis": "The `Race` of the character."
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Character$_race",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Race</span></span></span></code> of the character.</span>",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+       }
+}
+{
+       "name": "race",
+       "synopsis": "The `Race` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "race",
+               "synopsis": "The `Race` of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$race",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Race</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Race",
+                       "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+               }
+       }
+}
+{
+       "name": "race=",
+       "synopsis": "The `Race` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "race=",
+               "synopsis": "The `Race` of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$race=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Race</span></span></span></code> of the character.</span>",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "race",
+                       "mtype": {
+                               "name": "Race",
+                               "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_career",
+       "synopsis": "The current `Career` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "_career",
+               "synopsis": "The current `Career` of the character."
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Character$_career",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "nullable Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+       }
+}
+{
+       "name": "career",
+       "synopsis": "The current `Career` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "career",
+               "synopsis": "The current `Career` of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$career",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "nullable Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+               }
+       }
+}
+{
+       "name": "career=",
+       "synopsis": "The current `Career` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "career=",
+               "synopsis": "The current `Career` of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$career=",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "career",
+                       "mtype": {
+                               "name": "nullable Career",
+                               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "quit",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "quit"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$quit",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_name",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "_name"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Character$_name",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "String",
+               "synopsis": "Strings (there is no chars...).",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>"
+       }
+}
+{
+       "name": "name",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "name"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$name",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "String",
+                       "synopsis": "Strings (there is no chars...).",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>"
+               }
+       }
+}
+{
+       "name": "name=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "name="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$name=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "name",
+                       "mtype": {
+                               "name": "String",
+                               "synopsis": "Strings (there is no chars...).",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_age",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "_age"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Character$_age",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "age",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "age"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$age",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "age=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "age="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$age=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "age",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_sex",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "_sex"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Character$_sex",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Bool",
+               "synopsis": "Booleans, `true` or `false`.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+       }
+}
+{
+       "name": "sex",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "sex"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$sex",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "sex=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "sex="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$sex=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "sex",
+                       "mtype": {
+                               "name": "Bool",
+                               "synopsis": "Booleans, `true` or `false`.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "total_strengh",
+       "synopsis": "The actual strength of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "total_strengh",
+               "synopsis": "The actual strength of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$total_strengh",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The actual strength of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "total_endurance",
+       "synopsis": "The actual endurance of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "total_endurance",
+               "synopsis": "The actual endurance of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$total_endurance",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The actual endurance of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "total_intelligence",
+       "synopsis": "The acutal intelligence of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "total_intelligence",
+               "synopsis": "The acutal intelligence of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$total_intelligence",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The acutal intelligence of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "max_health",
+       "synopsis": "Maximum health of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "max_health",
+               "synopsis": "Maximum health of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$max_health",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Maximum health of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "_health",
+       "synopsis": "The current `health` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "_health",
+               "synopsis": "The current `health` of the character."
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$Character$_health",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> of the character.</span>",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "health",
+       "synopsis": "The current `health` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "health",
+               "synopsis": "The current `health` of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$health",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "health=",
+       "synopsis": "The current `health` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "health=",
+               "synopsis": "The current `health` of the character."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Character$health=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> of the character.</span>",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "health",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "dps",
+       "synopsis": "Damage per second inflicted by this weapon.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Weapon",
+               "synopsis": "Something that can be used to attack someone and inflict damage."
+       }, "$", {
+               "name": "dps",
+               "synopsis": "Damage per second inflicted by this weapon."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Weapon$dps",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Damage per second inflicted by this weapon.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "dps",
+       "synopsis": "Dwarf `dps` are based on the dwarf `base_endurance` (represents weight here)",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "combat",
+               "synopsis": "COmbat interactions between characters."
+       }, "$", {
+               "name": "Dwarf",
+               "synopsis": "Dwarves make strong warriors."
+       }, "$", {
+               "name": "Weapon",
+               "synopsis": "Something that can be used to attack someone and inflict damage."
+       }, "::", {
+               "name": "dps",
+               "synopsis": "Dwarf `dps` are based on the dwarf `base_endurance` (represents weight here)"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog::combat$Dwarf$Weapon::dps",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Dwarf <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">dps</span></span></span></code> are based on the dwarf <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">base_endurance</span></span></span></code> (represents weight here)</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "hit_points",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "$", {
+               "name": "hit_points"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Combatable$hit_points",
+       "visibility": "public",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "hit_points",
+       "synopsis": "Use character `health` to determines hit_points.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "combat",
+               "synopsis": "COmbat interactions between characters."
+       }, "$", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "::", {
+               "name": "hit_points",
+               "synopsis": "Use character `health` to determines hit_points."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog::combat$Character$Combatable::hit_points",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Use character <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> to determines hit_points.</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "attack",
+       "synopsis": "A `Combatable` can attack a `target` that is also a `Combatable`.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "$", {
+               "name": "attack",
+               "synopsis": "A `Combatable` can attack a `target` that is also a `Combatable`."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Combatable$attack",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Combatable</span></span></span></code> can attack a <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">target</span></span></span></code> that is also a <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Combatable</span></span></span></code>.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 2,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "target",
+                       "mtype": {
+                               "name": "Combatable",
+                               "synopsis": "Something that can be combatted, it can `attack` and `defend`.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be combatted, it can <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> and <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">defend</span></span></span></code>.</span>"
+                       }
+               }, {
+                       "is_vararg": false,
+                       "name": "weapon",
+                       "mtype": {
+                               "name": "Weapon",
+                               "synopsis": "Something that can be used to attack someone and inflict damage.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be used to attack someone and inflict damage.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "direct_attack",
+       "synopsis": "Like `attack` but cannot be defended.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "$", {
+               "name": "direct_attack",
+               "synopsis": "Like `attack` but cannot be defended."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Combatable$direct_attack",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Like <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> but cannot be defended.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 2,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "target",
+                       "mtype": {
+                               "name": "Combatable",
+                               "synopsis": "Something that can be combatted, it can `attack` and `defend`.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be combatted, it can <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> and <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">defend</span></span></span></code>.</span>"
+                       }
+               }, {
+                       "is_vararg": false,
+                       "name": "weapon",
+                       "mtype": {
+                               "name": "Weapon",
+                               "synopsis": "Something that can be used to attack someone and inflict damage.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be used to attack someone and inflict damage.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "defend",
+       "synopsis": "`Combatable` can defend against attacks.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "$", {
+               "name": "defend",
+               "synopsis": "`Combatable` can defend against attacks."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Combatable$defend",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\"><code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Combatable</span></span></span></code> can defend against attacks.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "hit",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "is_dead",
+       "synopsis": "Is the character still have hit_points?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "$", {
+               "name": "is_dead",
+               "synopsis": "Is the character still have hit_points?"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Combatable$is_dead",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is the character still have hit_points?</span>",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "player_characters",
+       "synopsis": "Characters played by human players.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "$", {
+               "name": "player_characters",
+               "synopsis": "Characters played by human players."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Game$player_characters",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters played by human players.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "List[Character]",
+                       "synopsis": "List of things.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+               }
+       }
+}
+{
+       "name": "player_characters",
+       "synopsis": "Characters played by human players.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "player_characters",
+               "synopsis": "Characters played by human players."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$Game::player_characters",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters played by human players.</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "List[Character]",
+                       "synopsis": "List of things.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+               }
+       }
+}
+{
+       "name": "computer_characters",
+       "synopsis": "Characters players by computer.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "$", {
+               "name": "computer_characters",
+               "synopsis": "Characters players by computer."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Game$computer_characters",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters players by computer.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "List[Character]",
+                       "synopsis": "List of things.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+               }
+       }
+}
+{
+       "name": "computer_characters",
+       "synopsis": "Characters players by computer.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "computer_characters",
+               "synopsis": "Characters players by computer."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$Game::computer_characters",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters players by computer.</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "List[Character]",
+                       "synopsis": "List of things.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+               }
+       }
+}
+{
+       "name": "start_game",
+       "synopsis": "Start the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "$", {
+               "name": "start_game",
+               "synopsis": "Start the game."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Game$start_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Start the game.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "start_game",
+       "synopsis": "Start the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "start_game",
+               "synopsis": "Start the game."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$Game::start_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Start the game.</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "pause_game",
+       "synopsis": "Pause the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "$", {
+               "name": "pause_game",
+               "synopsis": "Pause the game."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Game$pause_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Pause the game.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "pause_game",
+       "synopsis": "Pause the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "pause_game",
+               "synopsis": "Pause the game."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$Game::pause_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Pause the game.</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "stop_game",
+       "synopsis": "Stop the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "$", {
+               "name": "stop_game",
+               "synopsis": "Stop the game."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Game$stop_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Stop the game.</span>",
+       "modifiers": ["abstract", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "stop_game",
+       "synopsis": "Stop the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "stop_game",
+               "synopsis": "Stop the game."
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$Game::stop_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Stop the game.</span>",
+       "modifiers": ["redef", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_player_characters",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "_player_characters"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$MyGame$_player_characters",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "List[Character]",
+               "synopsis": "List of things.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+       }
+}
+{
+       "name": "player_characters=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "player_characters="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$player_characters=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "player_characters",
+                       "mtype": {
+                               "name": "List[Character]",
+                               "synopsis": "List of things.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_computer_characters",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "_computer_characters"
+       }],
+       "class_name": "MAttributeDef",
+       "full_name": "test_prog$MyGame$_computer_characters",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "is_intro": true,
+       "static_mtype": {
+               "name": "List[Character]",
+               "synopsis": "List of things.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+       }
+}
+{
+       "name": "computer_characters=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "$", {
+               "name": "computer_characters="
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$MyGame$computer_characters=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "computer_characters",
+                       "mtype": {
+                               "name": "List[Character]",
+                               "synopsis": "List of things.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "start",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Starter"
+       }, "$", {
+               "name": "start"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Starter$start",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "main",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "$", {
+               "name": "Sys"
+       }, "$", {
+               "name": "main"
+       }],
+       "class_name": "MMethodDef",
+       "full_name": "test_prog$Sys$main",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "is_intro": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_props_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_props_to_full_json.res
new file mode 100644 (file)
index 0000000..bb15a19
--- /dev/null
@@ -0,0 +1,2098 @@
+{
+       "name": "OTHER",
+       "synopsis": "Used for comparisons.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "OTHER",
+               "synopsis": "Used for comparisons."
+       }],
+       "class_name": "MVirtualTypeProp",
+       "full_name": "test_prog::Object::OTHER",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used for comparisons.</span>",
+       "modifiers": ["type"],
+       "bound": {
+               "name": "nullable Object",
+               "synopsis": "Root of everything.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Root of everything.</span>"
+       }
+}
+{
+       "name": "==",
+       "synopsis": "Is `other` equqls to `self`?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "==",
+               "synopsis": "Is `other` equqls to `self`?"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Object::==",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">other</span></span></span></code> equqls to <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">self</span></span></span></code>?</span>",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "other",
+                       "mtype": {
+                               "name": "OTHER",
+                               "synopsis": "Used for comparisons.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Used for comparisons.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "!=",
+       "synopsis": "Is `other` different from `self`?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "!=",
+               "synopsis": "Is `other` different from `self`?"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Object::!=",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">other</span></span></span></code> different from <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">self</span></span></span></code>?</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "other",
+                       "mtype": {
+                               "name": "OTHER",
+                               "synopsis": "Used for comparisons.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Used for comparisons.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "init",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Object",
+               "synopsis": "Root of everything."
+       }, "::", {
+               "name": "init"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Object::init",
+       "visibility": "public",
+       "modifiers": ["init"],
+       "is_init": true,
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "unary -",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": "unary -"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::unary -",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "+",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": "+"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::+",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "-",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": "-"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::-",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "*",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": "*"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::*",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "/",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": "/"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::/",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": ">",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": ">"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::>",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "i",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "to_f",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Int",
+               "synopsis": "Some services about Integers."
+       }, "::", {
+               "name": "to_f"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Int::to_f",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "+",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "::", {
+               "name": "+"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Float::+",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "-",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "::", {
+               "name": "-"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Float::-",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "*",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "::", {
+               "name": "*"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Float::*",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "/",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "::", {
+               "name": "/"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Float::/",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": ">",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Float",
+               "synopsis": "Some services about Floats."
+       }, "::", {
+               "name": ">"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Float::>",
+       "visibility": "public",
+       "modifiers": ["intern", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "f",
+                       "mtype": {
+                               "name": "Float",
+                               "synopsis": "Some services about Floats.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "_strength_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "careers",
+               "synopsis": "Careers of the game."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "_strength_bonus"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::careers::Career::_strength_bonus",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "strength_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "strength_bonus"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Career::strength_bonus",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "strength_bonus=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "strength_bonus="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Career::strength_bonus=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "strength_bonus",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_endurance_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "careers",
+               "synopsis": "Careers of the game."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "_endurance_bonus"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::careers::Career::_endurance_bonus",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "endurance_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "endurance_bonus"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Career::endurance_bonus",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "endurance_bonus=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "endurance_bonus="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Career::endurance_bonus=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "endurance_bonus",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_intelligence_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "careers",
+               "synopsis": "Careers of the game."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "_intelligence_bonus"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::careers::Career::_intelligence_bonus",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "intelligence_bonus",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "intelligence_bonus"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Career::intelligence_bonus",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "intelligence_bonus=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+       }, "::", {
+               "name": "intelligence_bonus="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Career::intelligence_bonus=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "intelligence_bonus",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_base_strength",
+       "synopsis": "Used to represents how strong the race is.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "races",
+               "synopsis": "Races of the game."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "_base_strength",
+               "synopsis": "Used to represents how strong the race is."
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::races::Race::_base_strength",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how strong the race is.</span>",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "base_strength",
+       "synopsis": "Used to represents how strong the race is.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "base_strength",
+               "synopsis": "Used to represents how strong the race is."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Race::base_strength",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how strong the race is.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "base_strength=",
+       "synopsis": "Used to represents how strong the race is.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "base_strength=",
+               "synopsis": "Used to represents how strong the race is."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Race::base_strength=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how strong the race is.</span>",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "base_strength",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_base_endurance",
+       "synopsis": "Used to represents how the race can absorb damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "races",
+               "synopsis": "Races of the game."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "_base_endurance",
+               "synopsis": "Used to represents how the race can absorb damage."
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::races::Race::_base_endurance",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how the race can absorb damage.</span>",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "base_endurance",
+       "synopsis": "Used to represents how the race can absorb damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "base_endurance",
+               "synopsis": "Used to represents how the race can absorb damage."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Race::base_endurance",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how the race can absorb damage.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "base_endurance=",
+       "synopsis": "Used to represents how the race can absorb damage.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "base_endurance=",
+               "synopsis": "Used to represents how the race can absorb damage."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Race::base_endurance=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Used to represents how the race can absorb damage.</span>",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "base_endurance",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_base_intelligence",
+       "synopsis": "Is this race smart?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "races",
+               "synopsis": "Races of the game."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "_base_intelligence",
+               "synopsis": "Is this race smart?"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::races::Race::_base_intelligence",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is this race smart?</span>",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "base_intelligence",
+       "synopsis": "Is this race smart?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "base_intelligence",
+               "synopsis": "Is this race smart?"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Race::base_intelligence",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is this race smart?</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "base_intelligence=",
+       "synopsis": "Is this race smart?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+       }, "::", {
+               "name": "base_intelligence=",
+               "synopsis": "Is this race smart?"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Race::base_intelligence=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is this race smart?</span>",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "base_intelligence",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_race",
+       "synopsis": "The `Race` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "_race",
+               "synopsis": "The `Race` of the character."
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::character::Character::_race",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Race</span></span></span></code> of the character.</span>",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Race",
+               "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+       }
+}
+{
+       "name": "race",
+       "synopsis": "The `Race` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "race",
+               "synopsis": "The `Race` of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::race",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Race</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Race",
+                       "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+               }
+       }
+}
+{
+       "name": "race=",
+       "synopsis": "The `Race` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "race=",
+               "synopsis": "The `Race` of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::race=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Race</span></span></span></code> of the character.</span>",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "race",
+                       "mtype": {
+                               "name": "Race",
+                               "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_career",
+       "synopsis": "The current `Career` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "_career",
+               "synopsis": "The current `Career` of the character."
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::character::Character::_career",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "nullable Career",
+               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+       }
+}
+{
+       "name": "career",
+       "synopsis": "The current `Career` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "career",
+               "synopsis": "The current `Career` of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::career",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "nullable Career",
+                       "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+               }
+       }
+}
+{
+       "name": "career=",
+       "synopsis": "The current `Career` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "career=",
+               "synopsis": "The current `Career` of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::career=",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "career",
+                       "mtype": {
+                               "name": "nullable Career",
+                               "synopsis": "A `Career` gives a characteristic bonus or malus to the character.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "quit",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "quit"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::quit",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_name",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "_name"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::character::Character::_name",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "String",
+               "synopsis": "Strings (there is no chars...).",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>"
+       }
+}
+{
+       "name": "name",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "name"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::name",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "String",
+                       "synopsis": "Strings (there is no chars...).",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>"
+               }
+       }
+}
+{
+       "name": "name=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "name="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::name=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "name",
+                       "mtype": {
+                               "name": "String",
+                               "synopsis": "Strings (there is no chars...).",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Strings (there is no chars...).</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_age",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "_age"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::character::Character::_age",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "age",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "age"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::age",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "age=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "age="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::age=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "age",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_sex",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "_sex"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::character::Character::_sex",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Bool",
+               "synopsis": "Booleans, `true` or `false`.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+       }
+}
+{
+       "name": "sex",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "sex"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::sex",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "sex=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "sex="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::sex=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "sex",
+                       "mtype": {
+                               "name": "Bool",
+                               "synopsis": "Booleans, `true` or `false`.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "total_strengh",
+       "synopsis": "The actual strength of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "total_strengh",
+               "synopsis": "The actual strength of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::total_strengh",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The actual strength of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "total_endurance",
+       "synopsis": "The actual endurance of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "total_endurance",
+               "synopsis": "The actual endurance of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::total_endurance",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The actual endurance of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "total_intelligence",
+       "synopsis": "The acutal intelligence of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "total_intelligence",
+               "synopsis": "The acutal intelligence of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::total_intelligence",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The acutal intelligence of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "max_health",
+       "synopsis": "Maximum health of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "max_health",
+               "synopsis": "Maximum health of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::max_health",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Maximum health of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "_health",
+       "synopsis": "The current `health` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "character",
+               "synopsis": "Characters are playable entity in the world."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "_health",
+               "synopsis": "The current `health` of the character."
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::character::Character::_health",
+       "visibility": "private",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> of the character.</span>",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "Int",
+               "synopsis": "Some services about Integers.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+       }
+}
+{
+       "name": "health",
+       "synopsis": "The current `health` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "health",
+               "synopsis": "The current `health` of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::health",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> of the character.</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "health=",
+       "synopsis": "The current `health` of the character.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Character",
+               "synopsis": "Characters can be played by both the human or the machine."
+       }, "::", {
+               "name": "health=",
+               "synopsis": "The current `health` of the character."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Character::health=",
+       "visibility": "protected",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">The current <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">health</span></span></span></code> of the character.</span>",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "health",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "dps",
+       "synopsis": "Damage per second inflicted by this weapon.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Weapon",
+               "synopsis": "Something that can be used to attack someone and inflict damage."
+       }, "::", {
+               "name": "dps",
+               "synopsis": "Damage per second inflicted by this weapon."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Weapon::dps",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Damage per second inflicted by this weapon.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Float",
+                       "synopsis": "Some services about Floats.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Floats.</span>"
+               }
+       }
+}
+{
+       "name": "hit_points",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "::", {
+               "name": "hit_points"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Combatable::hit_points",
+       "visibility": "public",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "attack",
+       "synopsis": "A `Combatable` can attack a `target` that is also a `Combatable`.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "::", {
+               "name": "attack",
+               "synopsis": "A `Combatable` can attack a `target` that is also a `Combatable`."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Combatable::attack",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">A <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Combatable</span></span></span></code> can attack a <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">target</span></span></span></code> that is also a <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Combatable</span></span></span></code>.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 2,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "target",
+                       "mtype": {
+                               "name": "Combatable",
+                               "synopsis": "Something that can be combatted, it can `attack` and `defend`.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be combatted, it can <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> and <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">defend</span></span></span></code>.</span>"
+                       }
+               }, {
+                       "is_vararg": false,
+                       "name": "weapon",
+                       "mtype": {
+                               "name": "Weapon",
+                               "synopsis": "Something that can be used to attack someone and inflict damage.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be used to attack someone and inflict damage.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "direct_attack",
+       "synopsis": "Like `attack` but cannot be defended.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "::", {
+               "name": "direct_attack",
+               "synopsis": "Like `attack` but cannot be defended."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Combatable::direct_attack",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Like <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> but cannot be defended.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 2,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "target",
+                       "mtype": {
+                               "name": "Combatable",
+                               "synopsis": "Something that can be combatted, it can `attack` and `defend`.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be combatted, it can <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">attack</span></span></span></code> and <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_i\">defend</span></span></span></code>.</span>"
+                       }
+               }, {
+                       "is_vararg": false,
+                       "name": "weapon",
+                       "mtype": {
+                               "name": "Weapon",
+                               "synopsis": "Something that can be used to attack someone and inflict damage.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Something that can be used to attack someone and inflict damage.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "defend",
+       "synopsis": "`Combatable` can defend against attacks.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "::", {
+               "name": "defend",
+               "synopsis": "`Combatable` can defend against attacks."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Combatable::defend",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\"><code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_t\">Combatable</span></span></span></code> can defend against attacks.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "hit",
+                       "mtype": {
+                               "name": "Int",
+                               "synopsis": "Some services about Integers.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+                       }
+               }],
+               "return_mtype": {
+                       "name": "Int",
+                       "synopsis": "Some services about Integers.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Some services about Integers.</span>"
+               }
+       }
+}
+{
+       "name": "is_dead",
+       "synopsis": "Is the character still have hit_points?",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Combatable",
+               "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+       }, "::", {
+               "name": "is_dead",
+               "synopsis": "Is the character still have hit_points?"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Combatable::is_dead",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Is the character still have hit_points?</span>",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "Bool",
+                       "synopsis": "Booleans, `true` or `false`.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+               }
+       }
+}
+{
+       "name": "player_characters",
+       "synopsis": "Characters played by human players.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "player_characters",
+               "synopsis": "Characters played by human players."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Game::player_characters",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters played by human players.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "List[Character]",
+                       "synopsis": "List of things.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+               }
+       }
+}
+{
+       "name": "computer_characters",
+       "synopsis": "Characters players by computer.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "computer_characters",
+               "synopsis": "Characters players by computer."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Game::computer_characters",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Characters players by computer.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": {
+                       "name": "List[Character]",
+                       "synopsis": "List of things.",
+                       "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+               }
+       }
+}
+{
+       "name": "start_game",
+       "synopsis": "Start the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "start_game",
+               "synopsis": "Start the game."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Game::start_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Start the game.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "pause_game",
+       "synopsis": "Pause the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "pause_game",
+               "synopsis": "Pause the game."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Game::pause_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Pause the game.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "stop_game",
+       "synopsis": "Stop the game.",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Game",
+               "synopsis": "This is the interface you have to implement to use ure gaming platform."
+       }, "::", {
+               "name": "stop_game",
+               "synopsis": "Stop the game."
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Game::stop_game",
+       "visibility": "public",
+       "html_synopsis": "<span class=\"synopsys nitdoc\">Stop the game.</span>",
+       "modifiers": ["abstract", "fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_player_characters",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "game_examples"
+       }, "::", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "::", {
+               "name": "_player_characters"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::game_examples::MyGame::_player_characters",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "List[Character]",
+               "synopsis": "List of things.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+       }
+}
+{
+       "name": "player_characters=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "::", {
+               "name": "player_characters="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::MyGame::player_characters=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "player_characters",
+                       "mtype": {
+                               "name": "List[Character]",
+                               "synopsis": "List of things.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "_computer_characters",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "game_examples"
+       }, "::", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "::", {
+               "name": "_computer_characters"
+       }],
+       "class_name": "MAttribute",
+       "full_name": "test_prog::game_examples::MyGame::_computer_characters",
+       "visibility": "private",
+       "modifiers": ["private", "var"],
+       "static_mtype": {
+               "name": "List[Character]",
+               "synopsis": "List of things.",
+               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+       }
+}
+{
+       "name": "computer_characters=",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "MyGame",
+               "synopsis": "This is an example of how to implement the Game interface"
+       }, "::", {
+               "name": "computer_characters="
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::MyGame::computer_characters=",
+       "visibility": "protected",
+       "modifiers": ["protected", "fun"],
+       "msignature": {
+               "arity": 1,
+               "mparameters": [{
+                       "is_vararg": false,
+                       "name": "computer_characters",
+                       "mtype": {
+                               "name": "List[Character]",
+                               "synopsis": "List of things.",
+                               "html_synopsis": "<span class=\"synopsys nitdoc\">List of things.</span>"
+                       }
+               }],
+               "return_mtype": null
+       }
+}
+{
+       "name": "start",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Starter"
+       }, "::", {
+               "name": "start"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Starter::start",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
+{
+       "name": "main",
+       "namespace": [{
+               "name": "test_prog",
+               "synopsis": "Test program for model tools."
+       }, "::", {
+               "name": "Sys"
+       }, "::", {
+               "name": "main"
+       }],
+       "class_name": "MMethod",
+       "full_name": "test_prog::Sys::main",
+       "visibility": "public",
+       "modifiers": ["fun"],
+       "msignature": {
+               "arity": 0,
+               "mparameters": [],
+               "return_mtype": null
+       }
+}
diff --git a/src/doc/templates/tests/test_templates_json.sav/test_refs_to_full_json.res b/src/doc/templates/tests/test_templates_json.sav/test_refs_to_full_json.res
new file mode 100644 (file)
index 0000000..b0034b7
--- /dev/null
@@ -0,0 +1,11 @@
+{
+       "name": "test_prog",
+       "synopsis": "Test program for model tools."
+}
+{
+       "name": "game_examples"
+}
+{
+       "name": "Object",
+       "synopsis": "Root of everything."
+}
diff --git a/src/doc/term/term.nit b/src/doc/term/term.nit
new file mode 100644 (file)
index 0000000..61d5206
--- /dev/null
@@ -0,0 +1,349 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module term
+
+import commands::commands_parser
+import templates::templates_term
+
+redef class CommandParser
+
+       fun execute(query: String, no_color: nullable Bool) do
+               var cmd = self.parse(query)
+               var error = self.error
+
+               # If not a command, try a comment query
+               if cmd == null and error isa CmdParserError then
+                       error = null
+                       cmd = new CmdComment(view, mentity_name = query)
+                       var opts = new HashMap[String, String]
+                       var status = cmd.parser_init(query, opts)
+                       if not status isa CmdSuccess then error = status
+               end
+
+               if error isa CmdError or error isa CmdWarning then
+                       error.print_message(no_color)
+                       print ""
+               end
+               cmd.as(not null).execute(no_color)
+       end
+end
+
+redef class DocCommand
+       fun execute(no_color: nullable Bool) is abstract
+end
+
+redef class CmdMessage
+       fun print_message(no_color: nullable Bool) do print to_s
+end
+
+redef class CmdError
+       redef fun print_message(no_color) do
+               var res = "Error: {to_s}"
+               if no_color == null or not no_color then res = res.bold.red
+               print res
+       end
+end
+
+redef class CmdWarning
+       redef fun print_message(no_color) do
+               var res = "Warning: {to_s}"
+               if no_color == null or not no_color then res = res.bold.yellow
+               print res
+       end
+end
+
+# Model queries
+
+redef class ErrorMEntityNotFound
+       redef fun print_message(no_color) do
+               if no_color == null or not no_color then
+                       print "No result found for `{mentity_name.blue}`...".bold
+               else
+                       print "No result found for `{mentity_name}`..."
+               end
+               print ""
+               if suggestions.not_empty then
+                       print "Did you mean?"
+                       print ""
+                       for s in suggestions do
+                               print s.cs_list_item(no_color)
+                               print ""
+                       end
+               end
+       end
+end
+
+redef class ErrorMEntityConflict
+       redef fun print_message(no_color) do
+               if no_color == null or not no_color then
+                       print "Multiple results found for `{mentity_name.blue}`...".bold
+               else
+                       print "Multiple results found for `{mentity_name}`..."
+               end
+               print ""
+               if conflicts.not_empty then
+                       print "Did you mean?"
+                       print ""
+                       for s in conflicts do
+                               print s.cs_list_item(no_color)
+                               print ""
+                       end
+               end
+       end
+end
+
+redef class CmdList
+       fun print_list(list_title: nullable String, list_items: nullable Array[MEntity], no_color: nullable Bool) do
+               if list_title != null then
+                       if no_color == null or not no_color then
+                               print list_title.bold
+                       else
+                               print list_title
+                       end
+                       print ""
+               end
+               if list_items != null and list_items.not_empty then
+                       for mentity in list_items do
+                               print mentity.cs_list_item(no_color)
+                               print ""
+                       end
+               else
+                       print "None."
+               end
+       end
+end
+
+redef class CmdComment
+       redef fun execute(no_color) do
+               var mentity = self.mentity
+               if mentity == null then return
+
+               var full_name = mentity.cs_full_name(no_color)
+               if no_color == null or not no_color then
+                       print "Documentation for `{full_name}`:".bold
+               else
+                       print "Documentation for `{full_name}`:"
+               end
+               print ""
+               print " {mentity.cs_icon(no_color)} {mentity.cs_full_name(no_color)}"
+               print "   {mentity.cs_declaration(no_color)}"
+               print "   {mentity.cs_location(no_color)}"
+               print ""
+               var mdoc = self.mdoc
+               if mdoc == null then return
+               if full_doc then
+                       print mdoc.cs_comment(no_color, 3)
+               else
+                       print "   {mdoc.cs_short_comment(no_color)}\n"
+               end
+       end
+end
+
+redef class CmdAncestors
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Ancestors for `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdParents
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Parents for `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdChildren
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Children for `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdDescendants
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Descendants for `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdLinearization
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Linearization for `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdSearch
+       redef fun execute(no_color) do
+               print_list("Search results for `{query.as(not null)}`:", results, no_color)
+       end
+end
+
+redef class CmdModelEntities
+       redef fun execute(no_color) do
+               var kind = self.kind
+               if no_color != null and not no_color then kind = kind.blue
+               print_list("MEntities for kind `{kind}`:", results, no_color)
+       end
+end
+
+redef class CmdFeatures
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Features for `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdCode
+
+       redef var format = "ansi" is optional
+
+       redef fun execute(no_color) do
+               var mentity = self.mentity
+               if mentity == null then return
+
+               var title = "Code for `{mentity.cs_full_name(no_color)}`:"
+               if no_color == null or not no_color then
+                       print title.bold
+               else
+                       print title
+               end
+               if no_color == null or not no_color then
+                       var ansi = render
+                       if ansi != null then
+                               print "~~~"
+                               print ansi.write_to_string
+                               print "~~~"
+                       end
+               else
+                       printn mentity.cs_source_code
+               end
+       end
+end
+
+redef class CmdGraph
+       redef fun execute(no_color) do
+               format = "dot"
+               var dot = self.render
+               if dot == null then return
+               var f = new ProcessWriter("dot", "-Txlib")
+               f.write dot.write_to_string
+               f.close
+               f.wait
+       end
+end
+
+# CmdUsage
+
+redef class CmdCall
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Methods calling `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdNew
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Methods intializing `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdReturn
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Methods returning `{full_name}`:", results, no_color)
+       end
+end
+
+redef class CmdParam
+       redef fun execute(no_color) do
+               var full_name = mentity.as(not null).cs_full_name(no_color)
+               print_list("Methods accepting `{full_name}` as parameter:", results, no_color)
+       end
+end
+
+# CmdCatalog
+
+redef class CmdCatalogPackages
+       redef fun execute(no_color) do
+               print_list("Packages from catalog:", results, no_color)
+       end
+end
+
+redef class CmdCatalogStats
+       redef fun execute(no_color) do
+               if no_color == null or not no_color then
+                       print "Catalog statistics:".bold
+               else
+                       print "Catalog statistics:"
+               end
+
+               var stats = self.stats.as(not null)
+               print " * {stats.packages} packages"
+               print " * {stats.modules} modules"
+               print " * {stats.methods} methods"
+               print " * {stats.classes} classes"
+               print " * {stats.loc} lines of code"
+               print " * {stats.contributors} contributors"
+               print " * {stats.maintainers} maintainers"
+               print " * {stats.tags} tags"
+       end
+end
+
+redef class CmdCatalogTags
+       redef fun execute(no_color) do
+               if no_color == null or not no_color then
+                       print "Tags from catalog:".bold
+               else
+                       print "Tags from catalog:"
+               end
+
+               print ""
+               var counts = self.packages_count_by_tags.as(not null)
+               for tag, count in counts do
+                       if no_color == null or not no_color then
+                               print " * {tag.blue.bold}: {count} packages"
+                       else
+                               print " * {tag}: {count} packages"
+                       end
+               end
+       end
+end
+
+redef class CmdCatalogTag
+       redef fun execute(no_color) do
+               var tag = self.tag.as(not null)
+               if no_color == null or not no_color then tag = tag.blue.bold
+               print_list("Packages tagged with `{tag}`:", results, no_color)
+       end
+end
+
+redef class CmdCatalogMaintaining
+       redef fun execute(no_color) do
+               var name = self.person_name.as(not null)
+               if no_color == null or not no_color then name = name.blue.bold
+               print_list("Packages maintained by `{name}`:", results, no_color)
+       end
+end
+
+redef class CmdCatalogContributing
+       redef fun execute(no_color) do
+               var name = self.person_name.as(not null)
+               if no_color == null or not no_color then name = name.blue.bold
+               print_list("Packages contributed by `{name}`:", results, no_color)
+       end
+end
diff --git a/src/doc/term/tests/test_term.nit b/src/doc/term/tests/test_term.nit
new file mode 100644 (file)
index 0000000..08530da
--- /dev/null
@@ -0,0 +1,202 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_term is test
+
+import term
+import commands::test_commands_catalog
+
+# Nitunit test suite specific to commands
+class TestTerm
+       super TestCommandsCatalog
+       test
+
+       # CmdEntity
+
+       fun test_mentity_full_name is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("test_prog::Character", true)
+       end
+
+       fun test_mentity_name is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("Character", true)
+       end
+
+       fun test_mentity_empty is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("", true)
+       end
+
+       fun test_mentity_not_found is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("Caracter", true)
+       end
+
+       fun test_mentity_conflict is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("+", true)
+       end
+
+       # CmdDoc
+
+       fun test_comment is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("doc: Character", true)
+       end
+
+       fun test_comment_short is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("doc: Character | only-synopsis", true)
+       end
+
+       fun test_comment_no_fallback is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("doc: Character | no-fallback", true)
+       end
+
+       # CmdInheritance
+
+       fun test_ancestors is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("ancestors: Warrior | parents: true", true)
+       end
+
+       fun test_ancestors_without_parents is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("ancestors: Warrior | parents: false", true)
+       end
+
+       fun test_parents is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("parents: Warrior", true)
+       end
+
+       fun test_children is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("children: Career", true)
+       end
+
+       fun test_descendants is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("descendants: Career", true)
+       end
+
+       fun test_descendants_without_children is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("descendants: Career | children: false", true)
+       end
+
+       # CmdLin
+
+       fun test_lin is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("lin: init | limit: 2", true)
+       end
+
+       fun test_lin_no_lin is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("lin: test_prog", true)
+       end
+
+       # CmdSearch
+
+       fun test_search is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("search: Caracter | limit: 2", true)
+       end
+
+       fun test_search_no_query is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("search: | limit: 1", true)
+       end
+
+       # CmdDefs
+
+       fun test_features is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("defs: Character | limit: 3", true)
+       end
+
+       # CmdCode
+
+       fun test_code is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("code: Character", true)
+       end
+
+       # CmdUsage
+
+       fun test_init is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("new: Elf | limit: 2", true)
+       end
+
+       fun test_call is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("call: endurance_bonus", true)
+       end
+
+       fun test_return is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("return: Int | limit: 3", true)
+       end
+
+       fun test_param is test do
+               var parser = new CommandParser(test_view, test_builder)
+               parser.execute("param: Career | limit: 3", true)
+       end
+
+       # CmdCatalog
+
+       fun test_term_catalog is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("catalog:", true)
+       end
+
+       fun test_term_catalog_search is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("search: Caracter | limit: 3", true)
+       end
+
+       fun test_term_catalog_stats is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("stats:", true)
+       end
+
+       fun test_term_catalog_tags is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("tags:", true)
+       end
+
+       fun test_term_catalog_tag is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("tag: game", true)
+       end
+
+       fun test_term_catalog_maintain is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("maintain: Alexandre Terrasa", true)
+       end
+
+       fun test_term_catalog_contrib is test do
+               var parser = new CommandParser(test_view, test_builder, test_catalog)
+               parser.execute("contrib: Alexandre Terrasa", true)
+       end
+end
+
+redef class nitc::Location
+       # Avoid location diffs
+       redef fun to_s do return "test_location"
+end
diff --git a/src/doc/term/tests/test_term.sav/test_ancestors.res b/src/doc/term/tests/test_term.sav/test_ancestors.res
new file mode 100644 (file)
index 0000000..eeefbdf
--- /dev/null
@@ -0,0 +1,12 @@
+Ancestors for `test_prog::Warrior`:
+
+ + test_prog::Career
+   # A `Career` gives a characteristic bonus or malus to the character.
+   abstract class Career
+   test_location
+
+ + test_prog::Object
+   # Root of everything.
+   interface Object
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_ancestors_without_parents.res b/src/doc/term/tests/test_term.sav/test_ancestors_without_parents.res
new file mode 100644 (file)
index 0000000..548c77c
--- /dev/null
@@ -0,0 +1,7 @@
+Ancestors for `test_prog::Warrior`:
+
+ + test_prog::Object
+   # Root of everything.
+   interface Object
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_call.res b/src/doc/term/tests/test_term.sav/test_call.res
new file mode 100644 (file)
index 0000000..ac3c732
--- /dev/null
@@ -0,0 +1,11 @@
+Methods calling `test_prog::Career::endurance_bonus`:
+
+ * test_prog$Character$Object::init
+   redef init init(race: Race, name: String, age: Int, sex: Bool)
+   test_location
+
+ + test_prog$Character$total_endurance
+   # The actual endurance of the character.
+   fun total_endurance: Int
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_children.res b/src/doc/term/tests/test_term.sav/test_children.res
new file mode 100644 (file)
index 0000000..7c3a626
--- /dev/null
@@ -0,0 +1,17 @@
+Children for `test_prog::Career`:
+
+ + test_prog::Alcoholic
+   # Alcoholics are good to nothing escept taking punches.
+   class Alcoholic
+   test_location
+
+ + test_prog::Magician
+   # Magicians know magic and how to use it.
+   class Magician
+   test_location
+
+ + test_prog::Warrior
+   # Warriors are good for fighting.
+   class Warrior
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_code.res b/src/doc/term/tests/test_term.sav/test_code.res
new file mode 100644 (file)
index 0000000..0ce0299
--- /dev/null
@@ -0,0 +1,52 @@
+Code for `test_prog::Character`:
+
+~~~
+# Characters can be played by both the human or the machine.
+class Character
+
+       # The `Race` of the character.
+       var race: Race
+
+       # The current `Career` of the character.
+       # Returns `null` if character is unemployed.
+       var career: nullable Career = null is writable
+
+       fun quit do
+               career = null
+       end
+
+       var name: String
+       var age: Int
+       var sex: Bool
+
+       # The actual strength of the character.
+       #
+       # Returns `race.base_strength + career.strength_bonus` or just `race.base_strength` is unemployed.
+       fun total_strengh: Int do
+               if career != null then return race.base_strength + career.strength_bonus
+               return race.base_strength
+       end
+
+       # The actual endurance of the character.
+       fun total_endurance: Int do
+               if career != null then return race.base_endurance + career.endurance_bonus
+               return race.base_endurance
+       end
+
+       # The acutal intelligence of the character.
+       fun total_intelligence: Int do
+               if career != null then return race.base_intelligence + career.intelligence_bonus
+               return race.base_intelligence
+       end
+
+       # Maximum health of the character.
+       #
+       # Based on `total endurance * 10`.
+       fun max_health: Int do return total_endurance * 10
+
+       # The current `health` of the character.
+       #
+       # Starts at `max_health`.
+       var health: Int = max_health
+end
+~~~
diff --git a/src/doc/term/tests/test_term.sav/test_comment.res b/src/doc/term/tests/test_term.sav/test_comment.res
new file mode 100644 (file)
index 0000000..7dd578d
--- /dev/null
@@ -0,0 +1,8 @@
+Documentation for `test_prog::Character`:
+
+ + test_prog::Character
+   class Character
+   test_location
+
+   Characters can be played by both the human or the machine.
+
diff --git a/src/doc/term/tests/test_term.sav/test_comment_no_fallback.res b/src/doc/term/tests/test_term.sav/test_comment_no_fallback.res
new file mode 100644 (file)
index 0000000..54c0e88
--- /dev/null
@@ -0,0 +1,8 @@
+Warning: No documentation for `test_prog::Character`.
+
+Documentation for `test_prog::Character`:
+
+ + test_prog::Character
+   class Character
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_comment_short.res b/src/doc/term/tests/test_term.sav/test_comment_short.res
new file mode 100644 (file)
index 0000000..7dd578d
--- /dev/null
@@ -0,0 +1,8 @@
+Documentation for `test_prog::Character`:
+
+ + test_prog::Character
+   class Character
+   test_location
+
+   Characters can be played by both the human or the machine.
+
diff --git a/src/doc/term/tests/test_term.sav/test_descendants.res b/src/doc/term/tests/test_term.sav/test_descendants.res
new file mode 100644 (file)
index 0000000..288bb38
--- /dev/null
@@ -0,0 +1,17 @@
+Descendants for `test_prog::Career`:
+
+ + test_prog::Alcoholic
+   # Alcoholics are good to nothing escept taking punches.
+   class Alcoholic
+   test_location
+
+ + test_prog::Magician
+   # Magicians know magic and how to use it.
+   class Magician
+   test_location
+
+ + test_prog::Warrior
+   # Warriors are good for fighting.
+   class Warrior
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_descendants_without_children.res b/src/doc/term/tests/test_term.sav/test_descendants_without_children.res
new file mode 100644 (file)
index 0000000..04c1fd9
--- /dev/null
@@ -0,0 +1,3 @@
+Descendants for `test_prog::Career`:
+
+None.
diff --git a/src/doc/term/tests/test_term.sav/test_features.res b/src/doc/term/tests/test_term.sav/test_features.res
new file mode 100644 (file)
index 0000000..1a12c90
--- /dev/null
@@ -0,0 +1,16 @@
+Features for `test_prog::Character`:
+
+ - test_prog::character::Character::_age
+   private var _age: Int
+   test_location
+
+ - test_prog::character::Character::_career
+   # The current `Career` of the character.
+   private var _career: nullable Career
+   test_location
+
+ - test_prog::character::Character::_health
+   # The current `health` of the character.
+   private var _health: Int
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_init.res b/src/doc/term/tests/test_term.sav/test_init.res
new file mode 100644 (file)
index 0000000..45ed0a3
--- /dev/null
@@ -0,0 +1,3 @@
+Methods intializing `test_prog::Elf`:
+
+None.
diff --git a/src/doc/term/tests/test_term.sav/test_lin.res b/src/doc/term/tests/test_term.sav/test_lin.res
new file mode 100644 (file)
index 0000000..23e94dc
--- /dev/null
@@ -0,0 +1,10 @@
+Linearization for `test_prog::Object::init`:
+
+ + test_prog$Object$init
+   init init
+   test_location
+
+ * test_prog$Race$Object::init
+   redef init init(base_strength: Int, base_endurance: Int, base_intelligence: Int)
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_lin_no_lin.res b/src/doc/term/tests/test_term.sav/test_lin_no_lin.res
new file mode 100644 (file)
index 0000000..6543a17
--- /dev/null
@@ -0,0 +1,5 @@
+Warning: No linearization for `test_prog`
+
+Linearization for `test_prog`:
+
+None.
diff --git a/src/doc/term/tests/test_term.sav/test_mentity_conflict.res b/src/doc/term/tests/test_term.sav/test_mentity_conflict.res
new file mode 100644 (file)
index 0000000..b66c27f
--- /dev/null
@@ -0,0 +1,13 @@
+Multiple results found for `+`...
+
+Did you mean?
+
+ + test_prog::Int::+
+   intern fun +(i: Int): Int
+   test_location
+
+ + test_prog::Float::+
+   intern fun +(f: Float): Float
+   test_location
+
+
diff --git a/src/doc/term/tests/test_term.sav/test_mentity_empty.res b/src/doc/term/tests/test_term.sav/test_mentity_empty.res
new file mode 100644 (file)
index 0000000..eed622c
--- /dev/null
@@ -0,0 +1,17 @@
+No result found for ``...
+
+Did you mean?
+
+ + test_prog::Int::*
+   intern fun *(i: Int): Int
+   test_location
+
+ + test_prog::Float::*
+   intern fun *(f: Float): Float
+   test_location
+
+ + test_prog::Float::+
+   intern fun +(f: Float): Float
+   test_location
+
+
diff --git a/src/doc/term/tests/test_term.sav/test_mentity_full_name.res b/src/doc/term/tests/test_term.sav/test_mentity_full_name.res
new file mode 100644 (file)
index 0000000..7dd578d
--- /dev/null
@@ -0,0 +1,8 @@
+Documentation for `test_prog::Character`:
+
+ + test_prog::Character
+   class Character
+   test_location
+
+   Characters can be played by both the human or the machine.
+
diff --git a/src/doc/term/tests/test_term.sav/test_mentity_name.res b/src/doc/term/tests/test_term.sav/test_mentity_name.res
new file mode 100644 (file)
index 0000000..7dd578d
--- /dev/null
@@ -0,0 +1,8 @@
+Documentation for `test_prog::Character`:
+
+ + test_prog::Character
+   class Character
+   test_location
+
+   Characters can be played by both the human or the machine.
+
diff --git a/src/doc/term/tests/test_term.sav/test_mentity_not_found.res b/src/doc/term/tests/test_term.sav/test_mentity_not_found.res
new file mode 100644 (file)
index 0000000..ff87303
--- /dev/null
@@ -0,0 +1,20 @@
+No result found for `Caracter`...
+
+Did you mean?
+
+ + test_prog::Character
+   # Characters can be played by both the human or the machine.
+   class Character
+   test_location
+
+ + test_prog::character
+   # Characters are playable entity in the world.
+   module character
+   test_location
+
+ + test_prog::Career
+   # A `Career` gives a characteristic bonus or malus to the character.
+   abstract class Career
+   test_location
+
+
diff --git a/src/doc/term/tests/test_term.sav/test_param.res b/src/doc/term/tests/test_term.sav/test_param.res
new file mode 100644 (file)
index 0000000..5f65e7f
--- /dev/null
@@ -0,0 +1,7 @@
+Methods accepting `test_prog::Career` as parameter:
+
+ + test_prog::Character::career=
+   # The current `Career` of the character.
+   fun career=(career: nullable Career)
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_parents.res b/src/doc/term/tests/test_term.sav/test_parents.res
new file mode 100644 (file)
index 0000000..814f320
--- /dev/null
@@ -0,0 +1,7 @@
+Parents for `test_prog::Warrior`:
+
+ + test_prog::Career
+   # A `Career` gives a characteristic bonus or malus to the character.
+   abstract class Career
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_return.res b/src/doc/term/tests/test_term.sav/test_return.res
new file mode 100644 (file)
index 0000000..ce6c68f
--- /dev/null
@@ -0,0 +1,14 @@
+Methods returning `test_prog::Int`:
+
+ + test_prog::Int::*
+   intern fun *(i: Int): Int
+   test_location
+
+ + test_prog::Int::+
+   intern fun +(i: Int): Int
+   test_location
+
+ + test_prog::Int::-
+   intern fun -(i: Int): Int
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_search.res b/src/doc/term/tests/test_term.sav/test_search.res
new file mode 100644 (file)
index 0000000..965f6dc
--- /dev/null
@@ -0,0 +1,12 @@
+Search results for `Caracter`:
+
+ + test_prog::Character
+   # Characters can be played by both the human or the machine.
+   class Character
+   test_location
+
+ + test_prog::character
+   # Characters are playable entity in the world.
+   module character
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_search_no_query.res b/src/doc/term/tests/test_term.sav/test_search_no_query.res
new file mode 100644 (file)
index 0000000..591c48b
--- /dev/null
@@ -0,0 +1,6 @@
+Search results for ``:
+
+ + test_prog::Int::*
+   intern fun *(i: Int): Int
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog.res b/src/doc/term/tests/test_term.sav/test_term_catalog.res
new file mode 100644 (file)
index 0000000..79ba492
--- /dev/null
@@ -0,0 +1,11 @@
+Packages from catalog:
+
+ + test_prog
+   # Test program for model tools.
+   package test_prog
+   test_location
+
+ + excluded
+   package excluded
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_contrib.res b/src/doc/term/tests/test_term.sav/test_term_catalog_contrib.res
new file mode 100644 (file)
index 0000000..60ce480
--- /dev/null
@@ -0,0 +1,7 @@
+Packages contributed by `Alexandre Terrasa`:
+
+ + test_prog
+   # Test program for model tools.
+   package test_prog
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_maintain.res b/src/doc/term/tests/test_term.sav/test_term_catalog_maintain.res
new file mode 100644 (file)
index 0000000..4dfedb2
--- /dev/null
@@ -0,0 +1,11 @@
+Packages maintained by `Alexandre Terrasa`:
+
+ + test_prog
+   # Test program for model tools.
+   package test_prog
+   test_location
+
+ + excluded
+   package excluded
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_search.res b/src/doc/term/tests/test_term.sav/test_term_catalog_search.res
new file mode 100644 (file)
index 0000000..ae5fe51
--- /dev/null
@@ -0,0 +1,17 @@
+Search results for `Caracter`:
+
+ + test_prog::Character
+   # Characters can be played by both the human or the machine.
+   class Character
+   test_location
+
+ + test_prog::character
+   # Characters are playable entity in the world.
+   module character
+   test_location
+
+ + test_prog::Career
+   # A `Career` gives a characteristic bonus or malus to the character.
+   abstract class Career
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_stats.res b/src/doc/term/tests/test_term.sav/test_term_catalog_stats.res
new file mode 100644 (file)
index 0000000..fd8b8ba
--- /dev/null
@@ -0,0 +1,9 @@
+Catalog statistics:
+ * 2 packages
+ * 10 modules
+ * 75 methods
+ * 23 classes
+ * 471 lines of code
+ * 6 contributors
+ * 1 maintainers
+ * 2 tags
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_tag.res b/src/doc/term/tests/test_term.sav/test_term_catalog_tag.res
new file mode 100644 (file)
index 0000000..143fd74
--- /dev/null
@@ -0,0 +1,7 @@
+Packages tagged with `game`:
+
+ + test_prog
+   # Test program for model tools.
+   package test_prog
+   test_location
+
diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_tags.res b/src/doc/term/tests/test_term.sav/test_term_catalog_tags.res
new file mode 100644 (file)
index 0000000..ced4b52
--- /dev/null
@@ -0,0 +1,4 @@
+Tags from catalog:
+
+ * game: 1 packages
+ * test: 1 packages
index 3ceb9f3..c86bf96 100644 (file)
@@ -1803,6 +1803,8 @@ class MNullableType
                if t == mtype then return self
                return t.as_nullable
        end
+
+       redef fun mdoc_or_fallback do return mtype.mdoc_or_fallback
 end
 
 # A non-null version of a formal type.
diff --git a/src/model/model_json.nit b/src/model/model_json.nit
deleted file mode 100644 (file)
index a48cef2..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Make model entities Serializable.
-#
-# To avoid cycles, every reference from a MEntity to another is replaced by a
-# MEntityRef.
-#
-# How subobjects are retrieved using the MEntityRef is the responsability of the
-# client. Json objects can be returned as this or inflated with concrete objet
-# rather than the refs.
-#
-# TODO consider serialization module?
-module model_json
-
-import model::model_collect
-import json::static
-import json::serialization_write
-import loader
-
-# A reference to another mentity.
-class MEntityRef
-       super MEntity
-
-       # MEntity to link to.
-       var mentity: MEntity
-
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("full_name", mentity.full_name)
-       end
-end
-
-redef class MEntity
-       serialize
-
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("name", name)
-               v.serialize_attribute("class_name", class_name)
-               v.serialize_attribute("full_name", full_name)
-               v.serialize_attribute("mdoc", mdoc_or_fallback)
-               v.serialize_attribute("visibility", visibility.to_s)
-               v.serialize_attribute("modifiers", collect_modifiers)
-               v.serialize_attribute("location", location)
-       end
-
-       # Serialize the full version of `self` to JSON
-       #
-       # See: `FullJsonSerializer`
-       fun serialize_to_full_json(mainmodule: MModule, plain, pretty: nullable Bool): String do
-               var stream = new StringWriter
-               var serializer = new FullJsonSerializer(stream, mainmodule)
-               serializer.plain_json = plain or else false
-               serializer.pretty_json = pretty or else false
-               serializer.serialize self
-               stream.close
-               return stream.to_s
-       end
-
-       # Return the full json representation of `self` with references.
-       #
-       # By default, every reference to another MEntity is replaced by a pointer
-       # to the MEntity::json_id.
-       # Use this method to obtain a full object with mentities instead of pointers.
-       fun to_full_json(mainmodule: MModule): String do
-               return serialize_to_full_json(mainmodule, plain=true)
-       end
-
-       # Same as `to_full_json` but with pretty json.
-       fun to_pretty_full_json(mainmodule: MModule): String do
-               return serialize_to_full_json(mainmodule, plain=true, pretty=true)
-       end
-
-       # Sort mentities by name
-       private fun sort_entities(mentities: Collection[MEntity]): Array[MEntity] do
-               var sorter = new MEntityNameSorter
-               var sorted = mentities.to_a
-               sorter.sort(sorted)
-               return sorted
-       end
-end
-
-redef class MDoc
-       serialize
-
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("content", content.join("\n"))
-               v.serialize_attribute("location", location)
-       end
-end
-
-redef class nitc::Location
-       serialize
-
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("column_end", column_end)
-               v.serialize_attribute("column_start", column_start)
-               v.serialize_attribute("line_end", line_end)
-               v.serialize_attribute("line_start", line_start)
-               var file = self.file
-               if file != null then
-                       v.serialize_attribute("file", file.filename)
-               end
-       end
-end
-
-redef class MPackage
-       redef fun core_serialize_to(v) do
-               super
-               if v isa FullJsonSerializer then
-                       v.serialize_attribute("root", to_mentity_ref(root))
-                       v.serialize_attribute("mgroups", to_mentity_refs(sort_entities(mgroups)))
-                       var ini = self.ini
-                       if ini != null then v.serialize_attribute("ini", ini.to_map)
-               end
-       end
-end
-
-redef class MGroup
-       redef fun core_serialize_to(v) do
-               super
-               if v isa FullJsonSerializer then
-                       v.serialize_attribute("is_root", is_root)
-                       v.serialize_attribute("mpackage", to_mentity_ref(mpackage))
-                       v.serialize_attribute("default_mmodule", to_mentity_ref(default_mmodule))
-                       v.serialize_attribute("parent", to_mentity_ref(parent))
-                       v.serialize_attribute("mmodules", to_mentity_refs(sort_entities(mmodules)))
-                       v.serialize_attribute("mgroups", to_mentity_refs(sort_entities(in_nesting.direct_smallers)))
-               end
-       end
-end
-
-redef class MModule
-       redef fun core_serialize_to(v) do
-               super
-               if v isa FullJsonSerializer then
-                       var view = new ModelView(model, v.mainmodule)
-                       v.serialize_attribute("mpackage", to_mentity_ref(mpackage))
-                       v.serialize_attribute("mgroup", to_mentity_ref(mgroup))
-                       v.serialize_attribute("intro_mclasses", to_mentity_refs(sort_entities(intro_mclasses)))
-                       v.serialize_attribute("mclassdefs", to_mentity_refs(sort_entities(mclassdefs)))
-                       v.serialize_attribute("intro_mclassdefs", to_mentity_refs(sort_entities(collect_intro_mclassdefs(view))))
-                       v.serialize_attribute("redef_mclassdefs", to_mentity_refs(sort_entities(collect_redef_mclassdefs(view))))
-                       v.serialize_attribute("imports", to_mentity_refs(in_importation.direct_greaters))
-               end
-       end
-end
-
-redef class MClass
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("mparameters", mparameters)
-               if v isa FullJsonSerializer then
-                       var filter = new ModelFilter(private_visibility)
-                       var view = new ModelView(model, v.mainmodule, filter)
-                       v.serialize_attribute("intro", to_mentity_ref(intro))
-                       v.serialize_attribute("intro_mmodule", to_mentity_ref(intro_mmodule))
-                       v.serialize_attribute("mpackage", to_mentity_ref(intro_mmodule.mpackage))
-                       v.serialize_attribute("mclassdefs", to_mentity_refs(mclassdefs))
-                       v.serialize_attribute("all_mproperties", to_mentity_refs(sort_entities(collect_accessible_mproperties(view))))
-                       v.serialize_attribute("intro_mproperties", to_mentity_refs(sort_entities(collect_intro_mproperties(view))))
-                       v.serialize_attribute("redef_mproperties", to_mentity_refs(sort_entities(collect_redef_mproperties(view))))
-                       v.serialize_attribute("parents", to_mentity_refs(sort_entities(collect_parents(view))))
-               end
-       end
-end
-
-redef class MClassDef
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("is_intro", is_intro)
-               v.serialize_attribute("mparameters", mclass.mparameters)
-               if v isa FullJsonSerializer then
-                       var filter = new ModelFilter(private_visibility)
-                       var view = new ModelView(model, v.mainmodule, filter)
-                       v.serialize_attribute("mmodule", to_mentity_ref(mmodule))
-                       v.serialize_attribute("mclass", to_mentity_ref(mclass))
-                       v.serialize_attribute("mpropdefs", to_mentity_refs(sort_entities(mpropdefs)))
-                       v.serialize_attribute("intro_mproperties", to_mentity_refs(sort_entities(intro_mproperties)))
-                       v.serialize_attribute("intro", to_mentity_ref(mclass.intro))
-                       v.serialize_attribute("mpackage", to_mentity_ref(mmodule.mpackage))
-                       v.serialize_attribute("intro_mpropdefs", to_mentity_refs(sort_entities(collect_intro_mpropdefs(view))))
-                       v.serialize_attribute("redef_mpropdefs", to_mentity_refs(sort_entities(collect_redef_mpropdefs(view))))
-               end
-       end
-end
-
-redef class MProperty
-       redef fun core_serialize_to(v) do
-               super
-               if v isa FullJsonSerializer then
-                       v.serialize_attribute("intro", to_mentity_ref(intro))
-                       v.serialize_attribute("intro_mclassdef", to_mentity_ref(intro_mclassdef))
-                       v.serialize_attribute("mpropdefs", to_mentity_refs(sort_entities(mpropdefs)))
-                       v.serialize_attribute("intro_mclass", to_mentity_ref(intro_mclassdef.mclass))
-                       v.serialize_attribute("mpackage", to_mentity_ref(intro_mclassdef.mmodule.mpackage))
-               end
-       end
-end
-
-redef class MMethod
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("is_init", is_init)
-               v.serialize_attribute("msignature", intro.msignature)
-       end
-end
-
-redef class MAttribute
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("static_mtype", to_mentity_ref(intro.static_mtype))
-       end
-end
-
-redef class MVirtualTypeProp
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("mvirtualtype", to_mentity_ref(mvirtualtype))
-               v.serialize_attribute("bound", to_mentity_ref(intro.bound))
-       end
-end
-
-redef class MPropDef
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("is_intro", is_intro)
-               if v isa FullJsonSerializer then
-                       v.serialize_attribute("mclassdef", to_mentity_ref(mclassdef))
-                       v.serialize_attribute("mproperty", to_mentity_ref(mproperty))
-                       v.serialize_attribute("intro", to_mentity_ref(mproperty.intro))
-                       v.serialize_attribute("intro_mclassdef", to_mentity_ref(mproperty.intro.mclassdef))
-                       v.serialize_attribute("mmodule", to_mentity_ref(mclassdef.mmodule))
-                       v.serialize_attribute("mgroup", to_mentity_ref(mclassdef.mmodule.mgroup))
-                       v.serialize_attribute("mpackage", to_mentity_ref(mclassdef.mmodule.mpackage))
-               end
-       end
-end
-
-redef class MMethodDef
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("msignature", msignature)
-       end
-end
-
-redef class MAttributeDef
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("static_mtype", to_mentity_ref(static_mtype))
-       end
-end
-
-redef class MVirtualTypeDef
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("bound", to_mentity_ref(bound))
-               v.serialize_attribute("is_fixed", is_fixed)
-       end
-end
-
-redef class MSignature
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("arity", arity)
-               v.serialize_attribute("mparams", mparameters)
-               v.serialize_attribute("return_mtype", to_mentity_ref(return_mtype))
-               v.serialize_attribute("vararg_rank", vararg_rank)
-       end
-end
-
-redef class MParameterType
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("name", name)
-               v.serialize_attribute("rank", rank)
-               v.serialize_attribute("mtype", to_mentity_ref(mclass.intro.bound_mtype.arguments[rank]))
-       end
-end
-
-redef class MParameter
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("is_vararg", is_vararg)
-               v.serialize_attribute("name", name)
-               v.serialize_attribute("mtype", to_mentity_ref(mtype))
-       end
-end
-
-# Create a ref to a `mentity`.
-fun to_mentity_ref(mentity: nullable MEntity): nullable MEntityRef do
-       if mentity == null then return null
-       return new MEntityRef(mentity)
-end
-
-# Return a collection of `mentities` as a JsonArray of MEntityRefs.
-fun to_mentity_refs(mentities: Collection[MEntity]): Array[MEntityRef] do
-       var array = new Array[MEntityRef]
-       for mentity in mentities do
-               var ref = to_mentity_ref(mentity)
-               if ref == null then continue
-               array.add ref
-       end
-       return array
-end
-
-# Use the FullJsonSerializer to generate the full json representation of a MEntity.
-#
-# See MEntity::to_full_json.
-class FullJsonSerializer
-       super JsonSerializer
-
-       # FIXME tmp use of the mainmodule, a PR is comming to clean all the JSON mess
-       var mainmodule: MModule
-end
diff --git a/src/model/test_model_json.sav/test_classdefs_to_full_json.res b/src/model/test_model_json.sav/test_classdefs_to_full_json.res
deleted file mode 100644 (file)
index 6a4e795..0000000
+++ /dev/null
@@ -1,1462 +0,0 @@
-{
-       "name": "Object",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Object",
-       "mdoc": {
-               "content": "Root of everything.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 21,
-                       "line_start": 20,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 30,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mclass": {
-               "full_name": "test_prog::Object"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Object$!="
-       }, {
-               "full_name": "test_prog$Object$=="
-       }, {
-               "full_name": "test_prog$Object$OTHER"
-       }, {
-               "full_name": "test_prog$Object$init"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro": {
-               "full_name": "test_prog$Object"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Object$!="
-       }, {
-               "full_name": "test_prog$Object$=="
-       }, {
-               "full_name": "test_prog$Object$OTHER"
-       }, {
-               "full_name": "test_prog$Object$init"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Int",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Int",
-       "mdoc": {
-               "content": "Some services about Integers.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 33,
-                       "line_start": 32,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 41,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$*"
-       }, {
-               "full_name": "test_prog$Int$+"
-       }, {
-               "full_name": "test_prog$Int$-"
-       }, {
-               "full_name": "test_prog$Int$/"
-       }, {
-               "full_name": "test_prog$Int$>"
-       }, {
-               "full_name": "test_prog$Int$to_f"
-       }, {
-               "full_name": "test_prog$Int$unary -"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Int::*"
-       }, {
-               "full_name": "test_prog::Int::+"
-       }, {
-               "full_name": "test_prog::Int::-"
-       }, {
-               "full_name": "test_prog::Int::/"
-       }, {
-               "full_name": "test_prog::Int::>"
-       }, {
-               "full_name": "test_prog::Int::to_f"
-       }, {
-               "full_name": "test_prog::Int::unary -"
-       }],
-       "intro": {
-               "full_name": "test_prog$Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Int$*"
-       }, {
-               "full_name": "test_prog$Int$+"
-       }, {
-               "full_name": "test_prog$Int$-"
-       }, {
-               "full_name": "test_prog$Int$/"
-       }, {
-               "full_name": "test_prog$Int$>"
-       }, {
-               "full_name": "test_prog$Int$to_f"
-       }, {
-               "full_name": "test_prog$Int$unary -"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Float",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Float",
-       "mdoc": {
-               "content": "Some services about Floats.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 44,
-                       "line_start": 43,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 50,
-               "line_start": 43,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mclass": {
-               "full_name": "test_prog::Float"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Float$*"
-       }, {
-               "full_name": "test_prog$Float$+"
-       }, {
-               "full_name": "test_prog$Float$-"
-       }, {
-               "full_name": "test_prog$Float$/"
-       }, {
-               "full_name": "test_prog$Float$>"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Float::*"
-       }, {
-               "full_name": "test_prog::Float::+"
-       }, {
-               "full_name": "test_prog::Float::-"
-       }, {
-               "full_name": "test_prog::Float::/"
-       }, {
-               "full_name": "test_prog::Float::>"
-       }],
-       "intro": {
-               "full_name": "test_prog$Float"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Float$*"
-       }, {
-               "full_name": "test_prog$Float$+"
-       }, {
-               "full_name": "test_prog$Float$-"
-       }, {
-               "full_name": "test_prog$Float$/"
-       }, {
-               "full_name": "test_prog$Float$>"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Bool",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Bool",
-       "mdoc": {
-               "content": "Booleans, `true` or `false`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 53,
-                       "line_start": 52,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 14,
-               "column_start": 1,
-               "line_end": 53,
-               "line_start": 52,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mclass": {
-               "full_name": "test_prog::Bool"
-       },
-       "mpropdefs": [],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Bool"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": []
-}
-{
-       "name": "String",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$String",
-       "mdoc": {
-               "content": "Strings (there is no chars...).",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 56,
-                       "line_start": 55,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 16,
-               "column_start": 1,
-               "line_end": 56,
-               "line_start": 55,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mclass": {
-               "full_name": "test_prog::String"
-       },
-       "mpropdefs": [],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$String"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": []
-}
-{
-       "name": "List",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$List",
-       "mdoc": {
-               "content": "List of things.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 59,
-                       "line_start": 58,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 17,
-               "column_start": 1,
-               "line_end": 59,
-               "line_start": 58,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [{
-               "name": "E",
-               "rank": 0,
-               "mtype": {
-                       "full_name": "nullable test_prog::Object"
-               }
-       }],
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mclass": {
-               "full_name": "test_prog::List"
-       },
-       "mpropdefs": [],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$List"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Career",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Career",
-       "mdoc": {
-               "content": "A `Career` gives a characteristic bonus or malus to the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 30,
-                       "line_start": 29,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 36,
-               "line_start": 29,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$_endurance_bonus"
-       }, {
-               "full_name": "test_prog$Career$_intelligence_bonus"
-       }, {
-               "full_name": "test_prog$Career$_strength_bonus"
-       }, {
-               "full_name": "test_prog$Career$endurance_bonus"
-       }, {
-               "full_name": "test_prog$Career$endurance_bonus="
-       }, {
-               "full_name": "test_prog$Career$Object::init"
-       }, {
-               "full_name": "test_prog$Career$intelligence_bonus"
-       }, {
-               "full_name": "test_prog$Career$intelligence_bonus="
-       }, {
-               "full_name": "test_prog$Career$strength_bonus"
-       }, {
-               "full_name": "test_prog$Career$strength_bonus="
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus="
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       }, {
-               "full_name": "test_prog::Career::strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::strength_bonus="
-       }],
-       "intro": {
-               "full_name": "test_prog$Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Career$_endurance_bonus"
-       }, {
-               "full_name": "test_prog$Career$_intelligence_bonus"
-       }, {
-               "full_name": "test_prog$Career$_strength_bonus"
-       }, {
-               "full_name": "test_prog$Career$endurance_bonus"
-       }, {
-               "full_name": "test_prog$Career$endurance_bonus="
-       }, {
-               "full_name": "test_prog$Career$intelligence_bonus"
-       }, {
-               "full_name": "test_prog$Career$intelligence_bonus="
-       }, {
-               "full_name": "test_prog$Career$strength_bonus"
-       }, {
-               "full_name": "test_prog$Career$strength_bonus="
-       }],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Career$Object::init"
-       }]
-}
-{
-       "name": "Warrior",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Warrior",
-       "mdoc": {
-               "content": "Warriors are good for fighting.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 47,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mclass": {
-               "full_name": "test_prog::Warrior"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Warrior$Object::init"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Warrior"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Warrior$Object::init"
-       }]
-}
-{
-       "name": "Magician",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Magician",
-       "mdoc": {
-               "content": "Magicians know magic and how to use it.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 50,
-                       "line_start": 49,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 58,
-               "line_start": 49,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mclass": {
-               "full_name": "test_prog::Magician"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Magician$Object::init"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Magician"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Magician$Object::init"
-       }]
-}
-{
-       "name": "Alcoholic",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Alcoholic",
-       "mdoc": {
-               "content": "Alcoholics are good to nothing escept taking punches.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 61,
-                       "line_start": 60,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 69,
-               "line_start": 60,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mclass": {
-               "full_name": "test_prog::Alcoholic"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Alcoholic$Object::init"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Alcoholic"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Alcoholic$Object::init"
-       }]
-}
-{
-       "name": "Race",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Race",
-       "mdoc": {
-               "content": "Race determines basic characteristics and what the character will be able to do in life.\n\nThese are base characteristics, they cannot be changed\nbut you can add new ones if needed using refinement.\nObjects and spells cannot change those characteristics.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 33,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 45,
-               "line_start": 28,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$_base_endurance"
-       }, {
-               "full_name": "test_prog$Race$_base_intelligence"
-       }, {
-               "full_name": "test_prog$Race$_base_strength"
-       }, {
-               "full_name": "test_prog$Race$base_endurance"
-       }, {
-               "full_name": "test_prog$Race$base_endurance="
-       }, {
-               "full_name": "test_prog$Race$base_intelligence"
-       }, {
-               "full_name": "test_prog$Race$base_intelligence="
-       }, {
-               "full_name": "test_prog$Race$base_strength"
-       }, {
-               "full_name": "test_prog$Race$base_strength="
-       }, {
-               "full_name": "test_prog$Race$Object::init"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::races::Race::_base_endurance"
-       }, {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       }, {
-               "full_name": "test_prog::races::Race::_base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_endurance"
-       }, {
-               "full_name": "test_prog::Race::base_endurance="
-       }, {
-               "full_name": "test_prog::Race::base_intelligence"
-       }, {
-               "full_name": "test_prog::Race::base_intelligence="
-       }, {
-               "full_name": "test_prog::Race::base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_strength="
-       }],
-       "intro": {
-               "full_name": "test_prog$Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Race$_base_endurance"
-       }, {
-               "full_name": "test_prog$Race$_base_intelligence"
-       }, {
-               "full_name": "test_prog$Race$_base_strength"
-       }, {
-               "full_name": "test_prog$Race$base_endurance"
-       }, {
-               "full_name": "test_prog$Race$base_endurance="
-       }, {
-               "full_name": "test_prog$Race$base_intelligence"
-       }, {
-               "full_name": "test_prog$Race$base_intelligence="
-       }, {
-               "full_name": "test_prog$Race$base_strength"
-       }, {
-               "full_name": "test_prog$Race$base_strength="
-       }],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Race$Object::init"
-       }]
-}
-{
-       "name": "Human",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Human",
-       "mdoc": {
-               "content": "Humans are able to do everithing.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 48,
-                       "line_start": 47,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 56,
-               "line_start": 47,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mclass": {
-               "full_name": "test_prog::Human"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Human$Object::init"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Human"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Human$Object::init"
-       }]
-}
-{
-       "name": "Dwarf",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Dwarf",
-       "mdoc": {
-               "content": "Dwarves make strong warriors.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 59,
-                       "line_start": 58,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 67,
-               "line_start": 58,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mclass": {
-               "full_name": "test_prog::Dwarf"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Dwarf$Object::init"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Dwarf"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Dwarf$Object::init"
-       }]
-}
-{
-       "name": "Dwarf",
-       "class_name": "MClassDef",
-       "full_name": "test_prog::combat$Dwarf",
-       "mdoc": {
-               "content": "Dwarves can be used as weapons.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 62,
-                       "line_start": 61,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 67,
-               "line_start": 61,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mclass": {
-               "full_name": "test_prog::Dwarf"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog::combat$Dwarf$Weapon::dps"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Dwarf"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog::combat$Dwarf$Weapon::dps"
-       }]
-}
-{
-       "name": "Elf",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Elf",
-       "mdoc": {
-               "content": "Elves make good magicians.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 70,
-                       "line_start": 69,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 78,
-               "line_start": 69,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mclass": {
-               "full_name": "test_prog::Elf"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Elf$Object::init"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Elf"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Elf$Object::init"
-       }]
-}
-{
-       "name": "Character",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Character",
-       "mdoc": {
-               "content": "Characters can be played by both the human or the machine.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 22,
-                       "line_start": 21,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 68,
-               "line_start": 21,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_age"
-       }, {
-               "full_name": "test_prog$Character$_career"
-       }, {
-               "full_name": "test_prog$Character$_health"
-       }, {
-               "full_name": "test_prog$Character$_name"
-       }, {
-               "full_name": "test_prog$Character$_race"
-       }, {
-               "full_name": "test_prog$Character$_sex"
-       }, {
-               "full_name": "test_prog$Character$age"
-       }, {
-               "full_name": "test_prog$Character$age="
-       }, {
-               "full_name": "test_prog$Character$career"
-       }, {
-               "full_name": "test_prog$Character$career="
-       }, {
-               "full_name": "test_prog$Character$health"
-       }, {
-               "full_name": "test_prog$Character$health="
-       }, {
-               "full_name": "test_prog$Character$Object::init"
-       }, {
-               "full_name": "test_prog$Character$max_health"
-       }, {
-               "full_name": "test_prog$Character$name"
-       }, {
-               "full_name": "test_prog$Character$name="
-       }, {
-               "full_name": "test_prog$Character$quit"
-       }, {
-               "full_name": "test_prog$Character$race"
-       }, {
-               "full_name": "test_prog$Character$race="
-       }, {
-               "full_name": "test_prog$Character$sex"
-       }, {
-               "full_name": "test_prog$Character$sex="
-       }, {
-               "full_name": "test_prog$Character$total_endurance"
-       }, {
-               "full_name": "test_prog$Character$total_intelligence"
-       }, {
-               "full_name": "test_prog$Character$total_strengh"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::character::Character::_age"
-       }, {
-               "full_name": "test_prog::character::Character::_career"
-       }, {
-               "full_name": "test_prog::character::Character::_health"
-       }, {
-               "full_name": "test_prog::character::Character::_name"
-       }, {
-               "full_name": "test_prog::character::Character::_race"
-       }, {
-               "full_name": "test_prog::character::Character::_sex"
-       }, {
-               "full_name": "test_prog::Character::age"
-       }, {
-               "full_name": "test_prog::Character::age="
-       }, {
-               "full_name": "test_prog::Character::career"
-       }, {
-               "full_name": "test_prog::Character::career="
-       }, {
-               "full_name": "test_prog::Character::health"
-       }, {
-               "full_name": "test_prog::Character::health="
-       }, {
-               "full_name": "test_prog::Character::max_health"
-       }, {
-               "full_name": "test_prog::Character::name"
-       }, {
-               "full_name": "test_prog::Character::name="
-       }, {
-               "full_name": "test_prog::Character::quit"
-       }, {
-               "full_name": "test_prog::Character::race"
-       }, {
-               "full_name": "test_prog::Character::race="
-       }, {
-               "full_name": "test_prog::Character::sex"
-       }, {
-               "full_name": "test_prog::Character::sex="
-       }, {
-               "full_name": "test_prog::Character::total_endurance"
-       }, {
-               "full_name": "test_prog::Character::total_intelligence"
-       }, {
-               "full_name": "test_prog::Character::total_strengh"
-       }],
-       "intro": {
-               "full_name": "test_prog$Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Character$_age"
-       }, {
-               "full_name": "test_prog$Character$_career"
-       }, {
-               "full_name": "test_prog$Character$_health"
-       }, {
-               "full_name": "test_prog$Character$_name"
-       }, {
-               "full_name": "test_prog$Character$_race"
-       }, {
-               "full_name": "test_prog$Character$_sex"
-       }, {
-               "full_name": "test_prog$Character$age"
-       }, {
-               "full_name": "test_prog$Character$age="
-       }, {
-               "full_name": "test_prog$Character$career"
-       }, {
-               "full_name": "test_prog$Character$career="
-       }, {
-               "full_name": "test_prog$Character$health"
-       }, {
-               "full_name": "test_prog$Character$health="
-       }, {
-               "full_name": "test_prog$Character$max_health"
-       }, {
-               "full_name": "test_prog$Character$name"
-       }, {
-               "full_name": "test_prog$Character$name="
-       }, {
-               "full_name": "test_prog$Character$quit"
-       }, {
-               "full_name": "test_prog$Character$race"
-       }, {
-               "full_name": "test_prog$Character$race="
-       }, {
-               "full_name": "test_prog$Character$sex"
-       }, {
-               "full_name": "test_prog$Character$sex="
-       }, {
-               "full_name": "test_prog$Character$total_endurance"
-       }, {
-               "full_name": "test_prog$Character$total_intelligence"
-       }, {
-               "full_name": "test_prog$Character$total_strengh"
-       }],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$Character$Object::init"
-       }]
-}
-{
-       "name": "Character",
-       "class_name": "MClassDef",
-       "full_name": "test_prog::combat$Character",
-       "mdoc": {
-               "content": "Characters are now `Comabatable`",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 54,
-                       "line_start": 53,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 59,
-               "line_start": 53,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog::combat$Character$Combatable::hit_points"
-       }],
-       "intro_mproperties": [],
-       "intro": {
-               "full_name": "test_prog$Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog::combat$Character$Combatable::hit_points"
-       }]
-}
-{
-       "name": "Weapon",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Weapon",
-       "mdoc": {
-               "content": "Something that can be used to attack someone and inflict damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 21,
-                       "line_start": 20,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 24,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mclass": {
-               "full_name": "test_prog::Weapon"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Weapon$dps"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Weapon::dps"
-       }],
-       "intro": {
-               "full_name": "test_prog$Weapon"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Weapon$dps"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Combatable",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Combatable",
-       "mdoc": {
-               "content": "Something that can be combatted, it can `attack` and `defend`.\n\nWorld items can also be `Combatable`.\n`defend` method is then used to determines how the object react to an attack\nSome magical items can even `attack`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 31,
-                       "line_start": 26,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 51,
-               "line_start": 26,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mclass": {
-               "full_name": "test_prog::Combatable"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Combatable$attack"
-       }, {
-               "full_name": "test_prog$Combatable$defend"
-       }, {
-               "full_name": "test_prog$Combatable$direct_attack"
-       }, {
-               "full_name": "test_prog$Combatable$hit_points"
-       }, {
-               "full_name": "test_prog$Combatable$is_dead"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Combatable::attack"
-       }, {
-               "full_name": "test_prog::Combatable::defend"
-       }, {
-               "full_name": "test_prog::Combatable::direct_attack"
-       }, {
-               "full_name": "test_prog::Combatable::hit_points"
-       }, {
-               "full_name": "test_prog::Combatable::is_dead"
-       }],
-       "intro": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Combatable$attack"
-       }, {
-               "full_name": "test_prog$Combatable$defend"
-       }, {
-               "full_name": "test_prog$Combatable$direct_attack"
-       }, {
-               "full_name": "test_prog$Combatable$hit_points"
-       }, {
-               "full_name": "test_prog$Combatable$is_dead"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Game",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Game",
-       "mdoc": {
-               "content": "This is the interface you have to implement to use ure gaming platform.\n\nsee http://our.platform.com",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 23,
-                       "line_start": 20,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 45,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mclass": {
-               "full_name": "test_prog::Game"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Game$computer_characters"
-       }, {
-               "full_name": "test_prog$Game$pause_game"
-       }, {
-               "full_name": "test_prog$Game$player_characters"
-       }, {
-               "full_name": "test_prog$Game$start_game"
-       }, {
-               "full_name": "test_prog$Game$stop_game"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Game::computer_characters"
-       }, {
-               "full_name": "test_prog::Game::pause_game"
-       }, {
-               "full_name": "test_prog::Game::player_characters"
-       }, {
-               "full_name": "test_prog::Game::start_game"
-       }, {
-               "full_name": "test_prog::Game::stop_game"
-       }],
-       "intro": {
-               "full_name": "test_prog$Game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Game$computer_characters"
-       }, {
-               "full_name": "test_prog$Game$pause_game"
-       }, {
-               "full_name": "test_prog$Game$player_characters"
-       }, {
-               "full_name": "test_prog$Game$start_game"
-       }, {
-               "full_name": "test_prog$Game$stop_game"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "MyGame",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$MyGame",
-       "mdoc": {
-               "content": "This is an example of how to implement the Game interface",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 20,
-                       "line_start": 19,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 32,
-               "line_start": 19,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mclass": {
-               "full_name": "test_prog::MyGame"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$MyGame$_computer_characters"
-       }, {
-               "full_name": "test_prog$MyGame$_player_characters"
-       }, {
-               "full_name": "test_prog$MyGame$Game::computer_characters"
-       }, {
-               "full_name": "test_prog$MyGame$computer_characters="
-       }, {
-               "full_name": "test_prog$MyGame$Game::pause_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::player_characters"
-       }, {
-               "full_name": "test_prog$MyGame$player_characters="
-       }, {
-               "full_name": "test_prog$MyGame$Game::start_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::stop_game"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::game_examples::MyGame::_computer_characters"
-       }, {
-               "full_name": "test_prog::game_examples::MyGame::_player_characters"
-       }, {
-               "full_name": "test_prog::MyGame::computer_characters="
-       }, {
-               "full_name": "test_prog::MyGame::player_characters="
-       }],
-       "intro": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$MyGame$_computer_characters"
-       }, {
-               "full_name": "test_prog$MyGame$_player_characters"
-       }, {
-               "full_name": "test_prog$MyGame$computer_characters="
-       }, {
-               "full_name": "test_prog$MyGame$player_characters="
-       }],
-       "redef_mpropdefs": [{
-               "full_name": "test_prog$MyGame$Game::computer_characters"
-       }, {
-               "full_name": "test_prog$MyGame$Game::pause_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::player_characters"
-       }, {
-               "full_name": "test_prog$MyGame$Game::start_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::stop_game"
-       }]
-}
-{
-       "name": "Starter",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Starter",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 23,
-               "line_start": 21,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "mclass": {
-               "full_name": "test_prog::Starter"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Starter$start"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Starter::start"
-       }],
-       "intro": {
-               "full_name": "test_prog$Starter"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Starter$start"
-       }],
-       "redef_mpropdefs": []
-}
-{
-       "name": "Sys",
-       "class_name": "MClassDef",
-       "full_name": "test_prog$Sys",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 13,
-               "column_start": 1,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mparameters": [],
-       "mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "mclass": {
-               "full_name": "test_prog::Sys"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Sys$main"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Sys::main"
-       }],
-       "intro": {
-               "full_name": "test_prog$Sys"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "intro_mpropdefs": [{
-               "full_name": "test_prog$Sys$main"
-       }],
-       "redef_mpropdefs": []
-}
diff --git a/src/model/test_model_json.sav/test_classes_to_full_json.res b/src/model/test_model_json.sav/test_classes_to_full_json.res
deleted file mode 100644 (file)
index 79c488c..0000000
+++ /dev/null
@@ -1,1503 +0,0 @@
-{
-       "name": "Object",
-       "class_name": "MClass",
-       "full_name": "test_prog::Object",
-       "mdoc": {
-               "content": "Root of everything.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 21,
-                       "line_start": 20,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 30,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Object"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Object"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "redef_mproperties": [],
-       "parents": []
-}
-{
-       "name": "Int",
-       "class_name": "MClass",
-       "full_name": "test_prog::Int",
-       "mdoc": {
-               "content": "Some services about Integers.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 33,
-                       "line_start": 32,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 41,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Int"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Int"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Int::*"
-       }, {
-               "full_name": "test_prog::Int::+"
-       }, {
-               "full_name": "test_prog::Int::-"
-       }, {
-               "full_name": "test_prog::Int::/"
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Int::>"
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Int::to_f"
-       }, {
-               "full_name": "test_prog::Int::unary -"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Int::*"
-       }, {
-               "full_name": "test_prog::Int::+"
-       }, {
-               "full_name": "test_prog::Int::-"
-       }, {
-               "full_name": "test_prog::Int::/"
-       }, {
-               "full_name": "test_prog::Int::>"
-       }, {
-               "full_name": "test_prog::Int::to_f"
-       }, {
-               "full_name": "test_prog::Int::unary -"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Float",
-       "class_name": "MClass",
-       "full_name": "test_prog::Float",
-       "mdoc": {
-               "content": "Some services about Floats.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 44,
-                       "line_start": 43,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 50,
-               "line_start": 43,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Float"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Float"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Float::*"
-       }, {
-               "full_name": "test_prog::Float::+"
-       }, {
-               "full_name": "test_prog::Float::-"
-       }, {
-               "full_name": "test_prog::Float::/"
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Float::>"
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Float::*"
-       }, {
-               "full_name": "test_prog::Float::+"
-       }, {
-               "full_name": "test_prog::Float::-"
-       }, {
-               "full_name": "test_prog::Float::/"
-       }, {
-               "full_name": "test_prog::Float::>"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Bool",
-       "class_name": "MClass",
-       "full_name": "test_prog::Bool",
-       "mdoc": {
-               "content": "Booleans, `true` or `false`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 53,
-                       "line_start": 52,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 14,
-               "column_start": 1,
-               "line_end": 53,
-               "line_start": 52,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Bool"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Bool"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "String",
-       "class_name": "MClass",
-       "full_name": "test_prog::String",
-       "mdoc": {
-               "content": "Strings (there is no chars...).",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 56,
-                       "line_start": 55,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 16,
-               "column_start": 1,
-               "line_end": 56,
-               "line_start": 55,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$String"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$String"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "List",
-       "class_name": "MClass",
-       "full_name": "test_prog::List",
-       "mdoc": {
-               "content": "List of things.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 59,
-                       "line_start": 58,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 17,
-               "column_start": 1,
-               "line_end": 59,
-               "line_start": 58,
-               "file": "test_location"
-       },
-       "mparameters": [{
-               "name": "E",
-               "rank": 0,
-               "mtype": {
-                       "full_name": "nullable test_prog::Object"
-               }
-       }],
-       "intro": {
-               "full_name": "test_prog$List"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$List"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Career",
-       "class_name": "MClass",
-       "full_name": "test_prog::Career",
-       "mdoc": {
-               "content": "A `Career` gives a characteristic bonus or malus to the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 30,
-                       "line_start": 29,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 36,
-               "line_start": 29,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Career"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Career"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       }, {
-               "full_name": "test_prog::Career::strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::strength_bonus="
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus="
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       }, {
-               "full_name": "test_prog::Career::strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::strength_bonus="
-       }],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Warrior",
-       "class_name": "MClass",
-       "full_name": "test_prog::Warrior",
-       "mdoc": {
-               "content": "Warriors are good for fighting.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 47,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Warrior"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Warrior"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       }, {
-               "full_name": "test_prog::Career::strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::strength_bonus="
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Career"
-       }]
-}
-{
-       "name": "Magician",
-       "class_name": "MClass",
-       "full_name": "test_prog::Magician",
-       "mdoc": {
-               "content": "Magicians know magic and how to use it.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 50,
-                       "line_start": 49,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 58,
-               "line_start": 49,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Magician"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Magician"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       }, {
-               "full_name": "test_prog::Career::strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::strength_bonus="
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Career"
-       }]
-}
-{
-       "name": "Alcoholic",
-       "class_name": "MClass",
-       "full_name": "test_prog::Alcoholic",
-       "mdoc": {
-               "content": "Alcoholics are good to nothing escept taking punches.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 61,
-                       "line_start": 60,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 69,
-               "line_start": 60,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Alcoholic"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Alcoholic"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       }, {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus"
-       }, {
-               "full_name": "test_prog::Career::endurance_bonus="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       }, {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       }, {
-               "full_name": "test_prog::Career::strength_bonus"
-       }, {
-               "full_name": "test_prog::Career::strength_bonus="
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Career"
-       }]
-}
-{
-       "name": "Race",
-       "class_name": "MClass",
-       "full_name": "test_prog::Race",
-       "mdoc": {
-               "content": "Race determines basic characteristics and what the character will be able to do in life.\n\nThese are base characteristics, they cannot be changed\nbut you can add new ones if needed using refinement.\nObjects and spells cannot change those characteristics.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 33,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 45,
-               "line_start": 28,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Race"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Race"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::races::Race::_base_endurance"
-       }, {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       }, {
-               "full_name": "test_prog::races::Race::_base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_endurance"
-       }, {
-               "full_name": "test_prog::Race::base_endurance="
-       }, {
-               "full_name": "test_prog::Race::base_intelligence"
-       }, {
-               "full_name": "test_prog::Race::base_intelligence="
-       }, {
-               "full_name": "test_prog::Race::base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_strength="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::races::Race::_base_endurance"
-       }, {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       }, {
-               "full_name": "test_prog::races::Race::_base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_endurance"
-       }, {
-               "full_name": "test_prog::Race::base_endurance="
-       }, {
-               "full_name": "test_prog::Race::base_intelligence"
-       }, {
-               "full_name": "test_prog::Race::base_intelligence="
-       }, {
-               "full_name": "test_prog::Race::base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_strength="
-       }],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Human",
-       "class_name": "MClass",
-       "full_name": "test_prog::Human",
-       "mdoc": {
-               "content": "Humans are able to do everithing.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 48,
-                       "line_start": 47,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 56,
-               "line_start": 47,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Human"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Human"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::races::Race::_base_endurance"
-       }, {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       }, {
-               "full_name": "test_prog::races::Race::_base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_endurance"
-       }, {
-               "full_name": "test_prog::Race::base_endurance="
-       }, {
-               "full_name": "test_prog::Race::base_intelligence"
-       }, {
-               "full_name": "test_prog::Race::base_intelligence="
-       }, {
-               "full_name": "test_prog::Race::base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_strength="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Race"
-       }]
-}
-{
-       "name": "Dwarf",
-       "class_name": "MClass",
-       "full_name": "test_prog::Dwarf",
-       "mdoc": {
-               "content": "Dwarves make strong warriors.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 59,
-                       "line_start": 58,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 67,
-               "line_start": 58,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Dwarf"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Dwarf"
-       }, {
-               "full_name": "test_prog::combat$Dwarf"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::races::Race::_base_endurance"
-       }, {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       }, {
-               "full_name": "test_prog::races::Race::_base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_endurance"
-       }, {
-               "full_name": "test_prog::Race::base_endurance="
-       }, {
-               "full_name": "test_prog::Race::base_intelligence"
-       }, {
-               "full_name": "test_prog::Race::base_intelligence="
-       }, {
-               "full_name": "test_prog::Race::base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_strength="
-       }, {
-               "full_name": "test_prog::Weapon::dps"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Weapon::dps"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Race"
-       }, {
-               "full_name": "test_prog::Weapon"
-       }]
-}
-{
-       "name": "Elf",
-       "class_name": "MClass",
-       "full_name": "test_prog::Elf",
-       "mdoc": {
-               "content": "Elves make good magicians.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 70,
-                       "line_start": 69,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 78,
-               "line_start": 69,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Elf"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Elf"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::races::Race::_base_endurance"
-       }, {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       }, {
-               "full_name": "test_prog::races::Race::_base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_endurance"
-       }, {
-               "full_name": "test_prog::Race::base_endurance="
-       }, {
-               "full_name": "test_prog::Race::base_intelligence"
-       }, {
-               "full_name": "test_prog::Race::base_intelligence="
-       }, {
-               "full_name": "test_prog::Race::base_strength"
-       }, {
-               "full_name": "test_prog::Race::base_strength="
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Race"
-       }]
-}
-{
-       "name": "Character",
-       "class_name": "MClass",
-       "full_name": "test_prog::Character",
-       "mdoc": {
-               "content": "Characters can be played by both the human or the machine.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 22,
-                       "line_start": 21,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 68,
-               "line_start": 21,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Character"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Character"
-       }, {
-               "full_name": "test_prog::combat$Character"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::character::Character::_age"
-       }, {
-               "full_name": "test_prog::character::Character::_career"
-       }, {
-               "full_name": "test_prog::character::Character::_health"
-       }, {
-               "full_name": "test_prog::character::Character::_name"
-       }, {
-               "full_name": "test_prog::character::Character::_race"
-       }, {
-               "full_name": "test_prog::character::Character::_sex"
-       }, {
-               "full_name": "test_prog::Character::age"
-       }, {
-               "full_name": "test_prog::Character::age="
-       }, {
-               "full_name": "test_prog::Combatable::attack"
-       }, {
-               "full_name": "test_prog::Character::career"
-       }, {
-               "full_name": "test_prog::Character::career="
-       }, {
-               "full_name": "test_prog::Combatable::defend"
-       }, {
-               "full_name": "test_prog::Combatable::direct_attack"
-       }, {
-               "full_name": "test_prog::Character::health"
-       }, {
-               "full_name": "test_prog::Character::health="
-       }, {
-               "full_name": "test_prog::Combatable::hit_points"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Combatable::is_dead"
-       }, {
-               "full_name": "test_prog::Character::max_health"
-       }, {
-               "full_name": "test_prog::Character::name"
-       }, {
-               "full_name": "test_prog::Character::name="
-       }, {
-               "full_name": "test_prog::Character::quit"
-       }, {
-               "full_name": "test_prog::Character::race"
-       }, {
-               "full_name": "test_prog::Character::race="
-       }, {
-               "full_name": "test_prog::Character::sex"
-       }, {
-               "full_name": "test_prog::Character::sex="
-       }, {
-               "full_name": "test_prog::Character::total_endurance"
-       }, {
-               "full_name": "test_prog::Character::total_intelligence"
-       }, {
-               "full_name": "test_prog::Character::total_strengh"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::character::Character::_age"
-       }, {
-               "full_name": "test_prog::character::Character::_career"
-       }, {
-               "full_name": "test_prog::character::Character::_health"
-       }, {
-               "full_name": "test_prog::character::Character::_name"
-       }, {
-               "full_name": "test_prog::character::Character::_race"
-       }, {
-               "full_name": "test_prog::character::Character::_sex"
-       }, {
-               "full_name": "test_prog::Character::age"
-       }, {
-               "full_name": "test_prog::Character::age="
-       }, {
-               "full_name": "test_prog::Character::career"
-       }, {
-               "full_name": "test_prog::Character::career="
-       }, {
-               "full_name": "test_prog::Character::health"
-       }, {
-               "full_name": "test_prog::Character::health="
-       }, {
-               "full_name": "test_prog::Character::max_health"
-       }, {
-               "full_name": "test_prog::Character::name"
-       }, {
-               "full_name": "test_prog::Character::name="
-       }, {
-               "full_name": "test_prog::Character::quit"
-       }, {
-               "full_name": "test_prog::Character::race"
-       }, {
-               "full_name": "test_prog::Character::race="
-       }, {
-               "full_name": "test_prog::Character::sex"
-       }, {
-               "full_name": "test_prog::Character::sex="
-       }, {
-               "full_name": "test_prog::Character::total_endurance"
-       }, {
-               "full_name": "test_prog::Character::total_intelligence"
-       }, {
-               "full_name": "test_prog::Character::total_strengh"
-       }],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Combatable::hit_points"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "parents": [{
-               "full_name": "test_prog::Combatable"
-       }]
-}
-{
-       "name": "Weapon",
-       "class_name": "MClass",
-       "full_name": "test_prog::Weapon",
-       "mdoc": {
-               "content": "Something that can be used to attack someone and inflict damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 21,
-                       "line_start": 20,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 24,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Weapon"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Weapon"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Weapon::dps"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Weapon::dps"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Combatable",
-       "class_name": "MClass",
-       "full_name": "test_prog::Combatable",
-       "mdoc": {
-               "content": "Something that can be combatted, it can `attack` and `defend`.\n\nWorld items can also be `Combatable`.\n`defend` method is then used to determines how the object react to an attack\nSome magical items can even `attack`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 31,
-                       "line_start": 26,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 51,
-               "line_start": 26,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Combatable"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Combatable"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Combatable::attack"
-       }, {
-               "full_name": "test_prog::Combatable::defend"
-       }, {
-               "full_name": "test_prog::Combatable::direct_attack"
-       }, {
-               "full_name": "test_prog::Combatable::hit_points"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Combatable::is_dead"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Combatable::attack"
-       }, {
-               "full_name": "test_prog::Combatable::defend"
-       }, {
-               "full_name": "test_prog::Combatable::direct_attack"
-       }, {
-               "full_name": "test_prog::Combatable::hit_points"
-       }, {
-               "full_name": "test_prog::Combatable::is_dead"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Game",
-       "class_name": "MClass",
-       "full_name": "test_prog::Game",
-       "mdoc": {
-               "content": "This is the interface you have to implement to use ure gaming platform.\n\nsee http://our.platform.com",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 23,
-                       "line_start": 20,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["interface"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 45,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Game"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Game"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Game::computer_characters"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Game::pause_game"
-       }, {
-               "full_name": "test_prog::Game::player_characters"
-       }, {
-               "full_name": "test_prog::Game::start_game"
-       }, {
-               "full_name": "test_prog::Game::stop_game"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Game::computer_characters"
-       }, {
-               "full_name": "test_prog::Game::pause_game"
-       }, {
-               "full_name": "test_prog::Game::player_characters"
-       }, {
-               "full_name": "test_prog::Game::start_game"
-       }, {
-               "full_name": "test_prog::Game::stop_game"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "MyGame",
-       "class_name": "MClass",
-       "full_name": "test_prog::MyGame",
-       "mdoc": {
-               "content": "This is an example of how to implement the Game interface",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 20,
-                       "line_start": 19,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 32,
-               "line_start": 19,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$MyGame"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$MyGame"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::game_examples::MyGame::_computer_characters"
-       }, {
-               "full_name": "test_prog::game_examples::MyGame::_player_characters"
-       }, {
-               "full_name": "test_prog::Game::computer_characters"
-       }, {
-               "full_name": "test_prog::MyGame::computer_characters="
-       }, {
-               "full_name": "test_prog::Game::pause_game"
-       }, {
-               "full_name": "test_prog::Game::player_characters"
-       }, {
-               "full_name": "test_prog::MyGame::player_characters="
-       }, {
-               "full_name": "test_prog::Game::start_game"
-       }, {
-               "full_name": "test_prog::Game::stop_game"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::game_examples::MyGame::_computer_characters"
-       }, {
-               "full_name": "test_prog::game_examples::MyGame::_player_characters"
-       }, {
-               "full_name": "test_prog::MyGame::computer_characters="
-       }, {
-               "full_name": "test_prog::MyGame::player_characters="
-       }],
-       "redef_mproperties": [{
-               "full_name": "test_prog::Game::computer_characters"
-       }, {
-               "full_name": "test_prog::Game::pause_game"
-       }, {
-               "full_name": "test_prog::Game::player_characters"
-       }, {
-               "full_name": "test_prog::Game::start_game"
-       }, {
-               "full_name": "test_prog::Game::stop_game"
-       }],
-       "parents": []
-}
-{
-       "name": "Starter",
-       "class_name": "MClass",
-       "full_name": "test_prog::Starter",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 23,
-               "line_start": 21,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Starter"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Starter"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Starter::start"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Starter::start"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
-{
-       "name": "Sys",
-       "class_name": "MClass",
-       "full_name": "test_prog::Sys",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["class"],
-       "location": {
-               "column_end": 13,
-               "column_start": 1,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "mparameters": [],
-       "intro": {
-               "full_name": "test_prog$Sys"
-       },
-       "intro_mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mclassdefs": [{
-               "full_name": "test_prog$Sys"
-       }],
-       "all_mproperties": [{
-               "full_name": "test_prog::Object::!="
-       }, {
-               "full_name": "test_prog::Object::=="
-       }, {
-               "full_name": "test_prog::Object::OTHER"
-       }, {
-               "full_name": "test_prog::Object::init"
-       }, {
-               "full_name": "test_prog::Sys::main"
-       }],
-       "intro_mproperties": [{
-               "full_name": "test_prog::Sys::main"
-       }],
-       "redef_mproperties": [],
-       "parents": [{
-               "full_name": "test_prog::Object"
-       }]
-}
diff --git a/src/model/test_model_json.sav/test_groups_to_full_json.res b/src/model/test_model_json.sav/test_groups_to_full_json.res
deleted file mode 100644 (file)
index ee5e331..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-{
-       "name": "test_prog",
-       "class_name": "MGroup",
-       "full_name": "test_prog>",
-       "mdoc": {
-               "content": "Test program for model tools.\n\nThis program creates a fake model that can be used to test tools like:\n\n* `nitdoc`\n* `nitmetrics`\n* `nitx`\n* or others `modelbuilder`.\n\nAn image:\n\n![Tinks3D](../../contrib/tinks/doc/tinks3d.png)",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 12,
-                       "line_start": 1,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["group"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "is_root": true,
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "default_mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "parent": null,
-       "mmodules": [{
-               "full_name": "test_prog::test_prog"
-       }],
-       "mgroups": [{
-               "full_name": "test_prog>examples>"
-       }, {
-               "full_name": "test_prog>game>"
-       }, {
-               "full_name": "test_prog>platform>"
-       }, {
-               "full_name": "test_prog>rpg>"
-       }]
-}
-{
-       "name": "examples",
-       "class_name": "MGroup",
-       "full_name": "test_prog>examples>",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["group"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "is_root": false,
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "default_mmodule": null,
-       "parent": {
-               "full_name": "test_prog>"
-       },
-       "mmodules": [{
-               "full_name": "test_prog::game_examples"
-       }],
-       "mgroups": []
-}
-{
-       "name": "game",
-       "class_name": "MGroup",
-       "full_name": "test_prog>game>",
-       "mdoc": {
-               "content": "Gaming group",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 1,
-                       "line_start": 1,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["group"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "is_root": false,
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "default_mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "parent": {
-               "full_name": "test_prog>"
-       },
-       "mmodules": [{
-               "full_name": "test_prog::game"
-       }],
-       "mgroups": []
-}
-{
-       "name": "platform",
-       "class_name": "MGroup",
-       "full_name": "test_prog>platform>",
-       "mdoc": {
-               "content": "Fictive Crappy Platform.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 1,
-                       "line_start": 1,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["group"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "is_root": false,
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "default_mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "parent": {
-               "full_name": "test_prog>"
-       },
-       "mmodules": [{
-               "full_name": "test_prog::platform"
-       }],
-       "mgroups": []
-}
-{
-       "name": "rpg",
-       "class_name": "MGroup",
-       "full_name": "test_prog>rpg>",
-       "mdoc": {
-               "content": "Role Playing Game group",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 1,
-                       "line_start": 1,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["group"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "is_root": false,
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "default_mmodule": {
-               "full_name": "test_prog::rpg"
-       },
-       "parent": {
-               "full_name": "test_prog>"
-       },
-       "mmodules": [{
-               "full_name": "test_prog::careers"
-       }, {
-               "full_name": "test_prog::character"
-       }, {
-               "full_name": "test_prog::combat"
-       }, {
-               "full_name": "test_prog::races"
-       }, {
-               "full_name": "test_prog::rpg"
-       }],
-       "mgroups": []
-}
-{
-       "name": "excluded",
-       "class_name": "MGroup",
-       "full_name": "excluded>",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["group"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "is_root": true,
-       "mpackage": {
-               "full_name": "excluded"
-       },
-       "default_mmodule": {
-               "full_name": "excluded::excluded"
-       },
-       "parent": null,
-       "mmodules": [{
-               "full_name": "excluded::excluded"
-       }],
-       "mgroups": []
-}
diff --git a/src/model/test_model_json.sav/test_modules_to_full_json.res b/src/model/test_model_json.sav/test_modules_to_full_json.res
deleted file mode 100644 (file)
index d117c08..0000000
+++ /dev/null
@@ -1,510 +0,0 @@
-{
-       "name": "game_examples",
-       "class_name": "MModule",
-       "full_name": "test_prog::game_examples",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 32,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::MyGame"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$MyGame"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$MyGame"
-       }],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::game"
-       }]
-}
-{
-       "name": "excluded",
-       "class_name": "MModule",
-       "full_name": "excluded::excluded",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "excluded"
-       },
-       "mgroup": {
-               "full_name": "excluded>"
-       },
-       "intro_mclasses": [],
-       "mclassdefs": [],
-       "intro_mclassdefs": [],
-       "redef_mclassdefs": [],
-       "imports": []
-}
-{
-       "name": "game",
-       "class_name": "MModule",
-       "full_name": "test_prog::game",
-       "mdoc": {
-               "content": "A game abstraction for RPG.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 16,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 45,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>game>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Game"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$Game"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Game"
-       }],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::rpg"
-       }]
-}
-{
-       "name": "platform",
-       "class_name": "MModule",
-       "full_name": "test_prog::platform",
-       "mdoc": {
-               "content": "Declares base types allowed on the platform.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 16,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 17,
-               "column_start": 1,
-               "line_end": 59,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Bool"
-       }, {
-               "full_name": "test_prog::Float"
-       }, {
-               "full_name": "test_prog::Int"
-       }, {
-               "full_name": "test_prog::List"
-       }, {
-               "full_name": "test_prog::Object"
-       }, {
-               "full_name": "test_prog::String"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$Bool"
-       }, {
-               "full_name": "test_prog$Float"
-       }, {
-               "full_name": "test_prog$Int"
-       }, {
-               "full_name": "test_prog$List"
-       }, {
-               "full_name": "test_prog$Object"
-       }, {
-               "full_name": "test_prog$String"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Bool"
-       }, {
-               "full_name": "test_prog$Float"
-       }, {
-               "full_name": "test_prog$Int"
-       }, {
-               "full_name": "test_prog$List"
-       }, {
-               "full_name": "test_prog$Object"
-       }, {
-               "full_name": "test_prog$String"
-       }],
-       "redef_mclassdefs": [],
-       "imports": []
-}
-{
-       "name": "careers",
-       "class_name": "MModule",
-       "full_name": "test_prog::careers",
-       "mdoc": {
-               "content": "Careers of the game.\n\nAll characters can have a `Career`.\nA character can also quit its current career and start a new one.\n\nAvailable careers:\n\n * `Warrior`\n * `Magician`\n * `Alcoholic`",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 25,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 69,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Alcoholic"
-       }, {
-               "full_name": "test_prog::Career"
-       }, {
-               "full_name": "test_prog::Magician"
-       }, {
-               "full_name": "test_prog::Warrior"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$Alcoholic"
-       }, {
-               "full_name": "test_prog$Career"
-       }, {
-               "full_name": "test_prog$Magician"
-       }, {
-               "full_name": "test_prog$Warrior"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Alcoholic"
-       }, {
-               "full_name": "test_prog$Career"
-       }, {
-               "full_name": "test_prog$Magician"
-       }, {
-               "full_name": "test_prog$Warrior"
-       }],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::platform"
-       }]
-}
-{
-       "name": "character",
-       "class_name": "MModule",
-       "full_name": "test_prog::character",
-       "mdoc": {
-               "content": "Characters are playable entity in the world.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 16,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 68,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Character"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$Character"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Character"
-       }],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::races"
-       }, {
-               "full_name": "test_prog::careers"
-       }]
-}
-{
-       "name": "combat",
-       "class_name": "MModule",
-       "full_name": "test_prog::combat",
-       "mdoc": {
-               "content": "COmbat interactions between characters.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 16,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 67,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Combatable"
-       }, {
-               "full_name": "test_prog::Weapon"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog::combat$Character"
-       }, {
-               "full_name": "test_prog$Combatable"
-       }, {
-               "full_name": "test_prog::combat$Dwarf"
-       }, {
-               "full_name": "test_prog$Weapon"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Combatable"
-       }, {
-               "full_name": "test_prog$Weapon"
-       }],
-       "redef_mclassdefs": [{
-               "full_name": "test_prog::combat$Character"
-       }, {
-               "full_name": "test_prog::combat$Dwarf"
-       }],
-       "imports": [{
-               "full_name": "test_prog::character"
-       }]
-}
-{
-       "name": "races",
-       "class_name": "MModule",
-       "full_name": "test_prog::races",
-       "mdoc": {
-               "content": "Races of the game.\n\nAll characters belong to a `Race`.\n\nAvailable races:\n\n * `Human`\n * `Dwarf`\n * `Elf`",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 24,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 78,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Dwarf"
-       }, {
-               "full_name": "test_prog::Elf"
-       }, {
-               "full_name": "test_prog::Human"
-       }, {
-               "full_name": "test_prog::Race"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$Dwarf"
-       }, {
-               "full_name": "test_prog$Elf"
-       }, {
-               "full_name": "test_prog$Human"
-       }, {
-               "full_name": "test_prog$Race"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Dwarf"
-       }, {
-               "full_name": "test_prog$Elf"
-       }, {
-               "full_name": "test_prog$Human"
-       }, {
-               "full_name": "test_prog$Race"
-       }],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::platform"
-       }]
-}
-{
-       "name": "rpg",
-       "class_name": "MModule",
-       "full_name": "test_prog::rpg",
-       "mdoc": {
-               "content": "A worlg RPG abstraction.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 16,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 13,
-               "column_start": 1,
-               "line_end": 21,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "intro_mclasses": [],
-       "mclassdefs": [],
-       "intro_mclassdefs": [],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::combat"
-       }]
-}
-{
-       "name": "test_prog",
-       "class_name": "MModule",
-       "full_name": "test_prog::test_prog",
-       "mdoc": {
-               "content": "A test program with a fake model to check model tools.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 1,
-                       "line_end": 16,
-                       "line_start": 15,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 13,
-               "column_start": 1,
-               "line_end": 26,
-               "line_start": 15,
-               "file": "test_location"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>"
-       },
-       "intro_mclasses": [{
-               "full_name": "test_prog::Starter"
-       }, {
-               "full_name": "test_prog::Sys"
-       }],
-       "mclassdefs": [{
-               "full_name": "test_prog$Starter"
-       }, {
-               "full_name": "test_prog$Sys"
-       }],
-       "intro_mclassdefs": [{
-               "full_name": "test_prog$Starter"
-       }, {
-               "full_name": "test_prog$Sys"
-       }],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::game"
-       }]
-}
-{
-       "name": "test_prog-m",
-       "class_name": "MModule",
-       "full_name": "test_prog-m",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["module"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "mpackage": null,
-       "mgroup": null,
-       "intro_mclasses": [],
-       "mclassdefs": [],
-       "intro_mclassdefs": [],
-       "redef_mclassdefs": [],
-       "imports": [{
-               "full_name": "test_prog::test_prog"
-       }, {
-               "full_name": "test_prog::game_examples"
-       }]
-}
diff --git a/src/model/test_model_json.sav/test_packages_to_full_json.res b/src/model/test_model_json.sav/test_packages_to_full_json.res
deleted file mode 100644 (file)
index ca0a550..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-{
-       "name": "test_prog",
-       "class_name": "MPackage",
-       "full_name": "test_prog",
-       "mdoc": {
-               "content": "Test program for model tools.\n\nThis program creates a fake model that can be used to test tools like:\n\n* `nitdoc`\n* `nitmetrics`\n* `nitx`\n* or others `modelbuilder`.\n\nAn image:\n\n![Tinks3D](../../contrib/tinks/doc/tinks3d.png)",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 0,
-                       "line_end": 12,
-                       "line_start": 1,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["package"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "root": {
-               "full_name": "test_prog>"
-       },
-       "mgroups": [{
-               "full_name": "test_prog>examples>"
-       }, {
-               "full_name": "test_prog>game>"
-       }, {
-               "full_name": "test_prog>platform>"
-       }, {
-               "full_name": "test_prog>rpg>"
-       }, {
-               "full_name": "test_prog>"
-       }],
-       "ini": {
-               "upstream.issues": "https://github.com/nitlang/nit/issues",
-               "upstream.homepage": "http://nitlanguage.org",
-               "upstream.git.directory": "tests/test_prog",
-               "upstream.browse": "https://github.com/nitlang/nit/tree/master/tests/test_prog",
-               "source.exclude": "game/excluded.nit:game/excluded_dir",
-               "package.license": "Apache-2.0",
-               "package.more_contributors": "Riri <riri@example.com>, Fifi (http://www.example.com/~fifi), Loulou",
-               "package.maintainer": "John Doe <jdoe@example.com> (http://www.example.com/~jdoe), Spider-Man",
-               "package.tags": "test,game",
-               "package.version": "0.1",
-               "package.name": "test_prog"
-       }
-}
-{
-       "name": "excluded",
-       "class_name": "MPackage",
-       "full_name": "excluded",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["package"],
-       "location": {
-               "column_end": 0,
-               "column_start": 0,
-               "line_end": 0,
-               "line_start": 0,
-               "file": "test_location"
-       },
-       "root": {
-               "full_name": "excluded>"
-       },
-       "mgroups": [{
-               "full_name": "excluded>"
-       }]
-}
diff --git a/src/model/test_model_json.sav/test_propdefs_to_full_json.res b/src/model/test_model_json.sav/test_propdefs_to_full_json.res
deleted file mode 100644 (file)
index e4b178a..0000000
+++ /dev/null
@@ -1,4474 +0,0 @@
-{
-       "name": "OTHER",
-       "class_name": "MVirtualTypeDef",
-       "full_name": "test_prog$Object$OTHER",
-       "mdoc": {
-               "content": "Used for comparisons.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 23,
-                       "line_start": 22,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["type"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 22,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::OTHER"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$OTHER"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "bound": {
-               "full_name": "nullable test_prog::Object"
-       },
-       "is_fixed": false
-}
-{
-       "name": "==",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Object$==",
-       "mdoc": {
-               "content": "Is `other` equqls to `self`?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 26,
-                       "line_start": 25,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 37,
-               "column_start": 2,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::=="
-       },
-       "intro": {
-               "full_name": "test_prog$Object$=="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "other",
-                       "mtype": {
-                               "full_name": "test_prog::Object::OTHER"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "!=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Object$!=",
-       "mdoc": {
-               "content": "Is `other` different from `self`?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 55,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 28,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::!="
-       },
-       "intro": {
-               "full_name": "test_prog$Object$!="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "other",
-                       "mtype": {
-                               "full_name": "test_prog::Object::OTHER"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Object$init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["init"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 30,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 12,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Warrior$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 46,
-               "line_start": 42,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Warrior"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Magician$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 57,
-               "line_start": 53,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Magician"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Alcoholic$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 68,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Alcoholic"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 12,
-               "column_start": 2,
-               "line_end": 44,
-               "line_start": 44,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Human$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 55,
-               "line_start": 51,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Human"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Dwarf$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 66,
-               "line_start": 62,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Dwarf"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Elf$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 77,
-               "line_start": 73,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Elf"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["redef", "init"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 68,
-               "line_start": 21,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Object::init"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "unary -",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$unary -",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 21,
-               "column_start": 2,
-               "line_end": 34,
-               "line_start": 34,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::unary -"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$unary -"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "+",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$+",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::+"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$+"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "-",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$-",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::-"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$-"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "*",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$*",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::*"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$*"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "/",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$/",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 38,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::/"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$/"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": ">",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$>",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 30,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 39,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::>"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$>"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "to_f",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Int$to_f",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 26,
-               "column_start": 2,
-               "line_end": 40,
-               "line_start": 40,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Int::to_f"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$to_f"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "+",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Float$+",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 45,
-               "line_start": 45,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Float::+"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$+"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "-",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Float$-",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 46,
-               "line_start": 46,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Float::-"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$-"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "*",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Float$*",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 47,
-               "line_start": 47,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Float::*"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$*"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "/",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Float$/",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 48,
-               "line_start": 48,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Float::/"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$/"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": ">",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Float$>",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 32,
-               "column_start": 2,
-               "line_end": 49,
-               "line_start": 49,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Float::>"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$>"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mmodule": {
-               "full_name": "test_prog::platform"
-       },
-       "mgroup": {
-               "full_name": "test_prog>platform>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_strength_bonus",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Career$_strength_bonus",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::careers::Career::_strength_bonus"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$_strength_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "strength_bonus",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$strength_bonus",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Career::strength_bonus"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$strength_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "strength_bonus=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$strength_bonus=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Career::strength_bonus="
-       },
-       "intro": {
-               "full_name": "test_prog$Career$strength_bonus="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "strength_bonus",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_endurance_bonus",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Career$_endurance_bonus",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 25,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::careers::Career::_endurance_bonus"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$_endurance_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "endurance_bonus",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$endurance_bonus",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 25,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Career::endurance_bonus"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$endurance_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "endurance_bonus=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$endurance_bonus=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 25,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Career::endurance_bonus="
-       },
-       "intro": {
-               "full_name": "test_prog$Career$endurance_bonus="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "endurance_bonus",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_intelligence_bonus",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Career$_intelligence_bonus",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 33,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::careers::Career::_intelligence_bonus"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$_intelligence_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "intelligence_bonus",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$intelligence_bonus",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 33,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Career::intelligence_bonus"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$intelligence_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "intelligence_bonus=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Career$intelligence_bonus=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 33,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Career::intelligence_bonus="
-       },
-       "intro": {
-               "full_name": "test_prog$Career$intelligence_bonus="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mmodule": {
-               "full_name": "test_prog::careers"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "intelligence_bonus",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_base_strength",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Race$_base_strength",
-       "mdoc": {
-               "content": "Used to represents how strong the race is.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 35,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 23,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::races::Race::_base_strength"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$_base_strength"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "base_strength",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$base_strength",
-       "mdoc": {
-               "content": "Used to represents how strong the race is.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 35,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 23,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Race::base_strength"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_strength"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "base_strength=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$base_strength=",
-       "mdoc": {
-               "content": "Used to represents how strong the race is.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 35,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 23,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Race::base_strength="
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_strength="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "base_strength",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_base_endurance",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Race$_base_endurance",
-       "mdoc": {
-               "content": "Used to represents how the race can absorb damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::races::Race::_base_endurance"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$_base_endurance"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "base_endurance",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$base_endurance",
-       "mdoc": {
-               "content": "Used to represents how the race can absorb damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Race::base_endurance"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_endurance"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "base_endurance=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$base_endurance=",
-       "mdoc": {
-               "content": "Used to represents how the race can absorb damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Race::base_endurance="
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_endurance="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "base_endurance",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_base_intelligence",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Race$_base_intelligence",
-       "mdoc": {
-               "content": "Is this race smart?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 42,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::races::Race::_base_intelligence"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$_base_intelligence"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "base_intelligence",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$base_intelligence",
-       "mdoc": {
-               "content": "Is this race smart?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 42,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Race::base_intelligence"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_intelligence"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "base_intelligence=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Race$base_intelligence=",
-       "mdoc": {
-               "content": "Is this race smart?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 42,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Race::base_intelligence="
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_intelligence="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mmodule": {
-               "full_name": "test_prog::races"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "base_intelligence",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_race",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Character$_race",
-       "mdoc": {
-               "content": "The `Race` of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 25,
-                       "line_start": 24,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 15,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 24,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::character::Character::_race"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_race"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Race"
-       }
-}
-{
-       "name": "race",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$race",
-       "mdoc": {
-               "content": "The `Race` of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 25,
-                       "line_start": 24,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 15,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 24,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::race"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$race"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Race"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "race=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$race=",
-       "mdoc": {
-               "content": "The `Race` of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 25,
-                       "line_start": 24,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 15,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 24,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::race="
-       },
-       "intro": {
-               "full_name": "test_prog$Character$race="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "race",
-                       "mtype": {
-                               "full_name": "test_prog::Race"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_career",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Character$_career",
-       "mdoc": {
-               "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 47,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::character::Character::_career"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_career"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "nullable test_prog::Career"
-       }
-}
-{
-       "name": "career",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$career",
-       "mdoc": {
-               "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 47,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::career"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$career"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "nullable test_prog::Career"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "career=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$career=",
-       "mdoc": {
-               "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 47,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::career="
-       },
-       "intro": {
-               "full_name": "test_prog$Character$career="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "career",
-                       "mtype": {
-                               "full_name": "nullable test_prog::Career"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "quit",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$quit",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::quit"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$quit"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_name",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Character$_name",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::character::Character::_name"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_name"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::String"
-       }
-}
-{
-       "name": "name",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$name",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::name"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$name"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::String"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "name=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$name=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::name="
-       },
-       "intro": {
-               "full_name": "test_prog$Character$name="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "name",
-                       "mtype": {
-                               "full_name": "test_prog::String"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_age",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Character$_age",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 13,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::character::Character::_age"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_age"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "age",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$age",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 13,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::age"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$age"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "age=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$age=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 13,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::age="
-       },
-       "intro": {
-               "full_name": "test_prog$Character$age="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "age",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_sex",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Character$_sex",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 14,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::character::Character::_sex"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_sex"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Bool"
-       }
-}
-{
-       "name": "sex",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$sex",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 14,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::sex"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$sex"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "sex=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$sex=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 14,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::sex="
-       },
-       "intro": {
-               "full_name": "test_prog$Character$sex="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "sex",
-                       "mtype": {
-                               "full_name": "test_prog::Bool"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "total_strengh",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$total_strengh",
-       "mdoc": {
-               "content": "The actual strength of the character.\n\nReturns `race.base_strength + career.strength_bonus` or just `race.base_strength` is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 39,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 45,
-               "line_start": 39,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::total_strengh"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$total_strengh"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "total_endurance",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$total_endurance",
-       "mdoc": {
-               "content": "The actual endurance of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 48,
-                       "line_start": 47,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 51,
-               "line_start": 47,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::total_endurance"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$total_endurance"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "total_intelligence",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$total_intelligence",
-       "mdoc": {
-               "content": "The acutal intelligence of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 54,
-                       "line_start": 53,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 57,
-               "line_start": 53,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::total_intelligence"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$total_intelligence"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "max_health",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$max_health",
-       "mdoc": {
-               "content": "Maximum health of the character.\n\nBased on `total endurance * 10`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 62,
-                       "line_start": 59,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 51,
-               "column_start": 2,
-               "line_end": 62,
-               "line_start": 59,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::max_health"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$max_health"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_health",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$Character$_health",
-       "mdoc": {
-               "content": "The current `health` of the character.\n\nStarts at `max_health`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 67,
-                       "line_start": 64,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 67,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::character::Character::_health"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_health"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "health",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$health",
-       "mdoc": {
-               "content": "The current `health` of the character.\n\nStarts at `max_health`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 67,
-                       "line_start": 64,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 67,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::health"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$health"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "health=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Character$health=",
-       "mdoc": {
-               "content": "The current `health` of the character.\n\nStarts at `max_health`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 67,
-                       "line_start": 64,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 67,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Character::health="
-       },
-       "intro": {
-               "full_name": "test_prog$Character$health="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mmodule": {
-               "full_name": "test_prog::character"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "health",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "dps",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Weapon$dps",
-       "mdoc": {
-               "content": "Damage per second inflicted by this weapon.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 23,
-                       "line_start": 22,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 22,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Weapon"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Weapon::dps"
-       },
-       "intro": {
-               "full_name": "test_prog$Weapon$dps"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Weapon"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "dps",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog::combat$Dwarf$Weapon::dps",
-       "mdoc": {
-               "content": "Dwarf `dps` are based on the dwarf `base_endurance` (represents weight here)",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 66,
-                       "line_start": 65,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 51,
-               "column_start": 2,
-               "line_end": 66,
-               "line_start": 65,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog::combat$Dwarf"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Weapon::dps"
-       },
-       "intro": {
-               "full_name": "test_prog$Weapon$dps"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Weapon"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "hit_points",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Combatable$hit_points",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 32,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Combatable::hit_points"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$hit_points"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "hit_points",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog::combat$Character$Combatable::hit_points",
-       "mdoc": {
-               "content": "Use character `health` to determines hit_points.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 58,
-                       "line_start": 57,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 38,
-               "column_start": 2,
-               "line_end": 58,
-               "line_start": 57,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog::combat$Character"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Combatable::hit_points"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$hit_points"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "attack",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Combatable$attack",
-       "mdoc": {
-               "content": "A `Combatable` can attack a `target` that is also a `Combatable`.\n\nAttack the `target` using `wepaon` and returns the number of inflicted hit points.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 37,
-                       "line_start": 34,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 64,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 34,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Combatable::attack"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$attack"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 2,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "target",
-                       "mtype": {
-                               "full_name": "test_prog::Combatable"
-                       }
-               }, {
-                       "is_vararg": false,
-                       "name": "weapon",
-                       "mtype": {
-                               "full_name": "test_prog::Weapon"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "direct_attack",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Combatable$direct_attack",
-       "mdoc": {
-               "content": "Like `attack` but cannot be defended.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 40,
-                       "line_start": 39,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 71,
-               "column_start": 2,
-               "line_end": 40,
-               "line_start": 39,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Combatable::direct_attack"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$direct_attack"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 2,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "target",
-                       "mtype": {
-                               "full_name": "test_prog::Combatable"
-                       }
-               }, {
-                       "is_vararg": false,
-                       "name": "weapon",
-                       "mtype": {
-                               "full_name": "test_prog::Weapon"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "defend",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Combatable$defend",
-       "mdoc": {
-               "content": "`Combatable` can defend against attacks.\n\nDefends against a number of received hit points and return the number of pared hit points.\n\n@param hit: damage received.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 47,
-                       "line_start": 42,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 38,
-               "column_start": 2,
-               "line_end": 47,
-               "line_start": 42,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Combatable::defend"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$defend"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "hit",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "is_dead",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Combatable$is_dead",
-       "mdoc": {
-               "content": "Is the character still have hit_points?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 50,
-                       "line_start": 49,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 43,
-               "column_start": 2,
-               "line_end": 50,
-               "line_start": 49,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Combatable::is_dead"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$is_dead"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mmodule": {
-               "full_name": "test_prog::combat"
-       },
-       "mgroup": {
-               "full_name": "test_prog>rpg>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "player_characters",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Game$player_characters",
-       "mdoc": {
-               "content": "Characters played by human players.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 26,
-                       "line_start": 25,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 51,
-               "column_start": 2,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::player_characters"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$player_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mgroup": {
-               "full_name": "test_prog>game>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::List[test_prog::Character]"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "player_characters",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$Game::player_characters",
-       "mdoc": {
-               "content": "Characters played by human players.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 26,
-                       "line_start": 25,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 50,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 23,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::player_characters"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$player_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::List[test_prog::Character]"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "computer_characters",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Game$computer_characters",
-       "mdoc": {
-               "content": "Characters players by computer.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 53,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 28,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::computer_characters"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$computer_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mgroup": {
-               "full_name": "test_prog>game>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::List[test_prog::Character]"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "computer_characters",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$Game::computer_characters",
-       "mdoc": {
-               "content": "Characters players by computer.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 52,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::computer_characters"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$computer_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::List[test_prog::Character]"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "start_game",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Game$start_game",
-       "mdoc": {
-               "content": "Start the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 34,
-                       "line_start": 31,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 34,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::start_game"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$start_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mgroup": {
-               "full_name": "test_prog>game>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "start_game",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$Game::start_game",
-       "mdoc": {
-               "content": "Start the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 34,
-                       "line_start": 31,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 27,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::start_game"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$start_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "pause_game",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Game$pause_game",
-       "mdoc": {
-               "content": "Pause the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 36,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::pause_game"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$pause_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mgroup": {
-               "full_name": "test_prog>game>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "pause_game",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$Game::pause_game",
-       "mdoc": {
-               "content": "Pause the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 36,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 29,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::pause_game"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$pause_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "stop_game",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Game$stop_game",
-       "mdoc": {
-               "content": "Stop the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 44,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 26,
-               "column_start": 2,
-               "line_end": 44,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::stop_game"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$stop_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game"
-       },
-       "mgroup": {
-               "full_name": "test_prog>game>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "stop_game",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$Game::stop_game",
-       "mdoc": {
-               "content": "Stop the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 44,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["redef", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "is_intro": false,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Game::stop_game"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$stop_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_player_characters",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$MyGame$_player_characters",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 50,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 23,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::game_examples::MyGame::_player_characters"
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$_player_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::List[test_prog::Character]"
-       }
-}
-{
-       "name": "player_characters=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$player_characters=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 50,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 23,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::MyGame::player_characters="
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$player_characters="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "player_characters",
-                       "mtype": {
-                               "full_name": "test_prog::List[test_prog::Character]"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_computer_characters",
-       "class_name": "MAttributeDef",
-       "full_name": "test_prog$MyGame$_computer_characters",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 52,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::game_examples::MyGame::_computer_characters"
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$_computer_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::List[test_prog::Character]"
-       }
-}
-{
-       "name": "computer_characters=",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$MyGame$computer_characters=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 52,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mproperty": {
-               "full_name": "test_prog::MyGame::computer_characters="
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$computer_characters="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mmodule": {
-               "full_name": "test_prog::game_examples"
-       },
-       "mgroup": {
-               "full_name": "test_prog>examples>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "computer_characters",
-                       "mtype": {
-                               "full_name": "test_prog::List[test_prog::Character]"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "start",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Starter$start",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 22,
-               "line_start": 22,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Starter"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Starter::start"
-       },
-       "intro": {
-               "full_name": "test_prog$Starter$start"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Starter"
-       },
-       "mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "main",
-       "class_name": "MMethodDef",
-       "full_name": "test_prog$Sys$main",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 13,
-               "column_start": 1,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "is_intro": true,
-       "mclassdef": {
-               "full_name": "test_prog$Sys"
-       },
-       "mproperty": {
-               "full_name": "test_prog::Sys::main"
-       },
-       "intro": {
-               "full_name": "test_prog$Sys$main"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Sys"
-       },
-       "mmodule": {
-               "full_name": "test_prog::test_prog"
-       },
-       "mgroup": {
-               "full_name": "test_prog>"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
diff --git a/src/model/test_model_json.sav/test_props_to_full_json.res b/src/model/test_model_json.sav/test_props_to_full_json.res
deleted file mode 100644 (file)
index f2b22b3..0000000
+++ /dev/null
@@ -1,3290 +0,0 @@
-{
-       "name": "OTHER",
-       "class_name": "MVirtualTypeProp",
-       "full_name": "test_prog::Object::OTHER",
-       "mdoc": {
-               "content": "Used for comparisons.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 23,
-                       "line_start": 22,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["type"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 22,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$OTHER"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Object$OTHER"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Object"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "mvirtualtype": {
-               "full_name": "test_prog::Object::OTHER"
-       },
-       "bound": {
-               "full_name": "nullable test_prog::Object"
-       }
-}
-{
-       "name": "==",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Object::==",
-       "mdoc": {
-               "content": "Is `other` equqls to `self`?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 26,
-                       "line_start": 25,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 37,
-               "column_start": 2,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$=="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Object$=="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Object"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "other",
-                       "mtype": {
-                               "full_name": "test_prog::Object::OTHER"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "!=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Object::!=",
-       "mdoc": {
-               "content": "Is `other` different from `self`?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 55,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 28,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$!="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Object$!="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Object"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "other",
-                       "mtype": {
-                               "full_name": "test_prog::Object::OTHER"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "init",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Object::init",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["init"],
-       "location": {
-               "column_end": 3,
-               "column_start": 1,
-               "line_end": 30,
-               "line_start": 20,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Object$init"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Object"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Elf$Object::init"
-       }, {
-               "full_name": "test_prog$Career$Object::init"
-       }, {
-               "full_name": "test_prog$Warrior$Object::init"
-       }, {
-               "full_name": "test_prog$Magician$Object::init"
-       }, {
-               "full_name": "test_prog$Alcoholic$Object::init"
-       }, {
-               "full_name": "test_prog$Race$Object::init"
-       }, {
-               "full_name": "test_prog$Human$Object::init"
-       }, {
-               "full_name": "test_prog$Dwarf$Object::init"
-       }, {
-               "full_name": "test_prog$Character$Object::init"
-       }, {
-               "full_name": "test_prog$Object$init"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Object"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": true,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "unary -",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::unary -",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 21,
-               "column_start": 2,
-               "line_end": 34,
-               "line_start": 34,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$unary -"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$unary -"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "+",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::+",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$+"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$+"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "-",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::-",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$-"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$-"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "*",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::*",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$*"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$*"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "/",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::/",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 38,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$/"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$/"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": ">",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::>",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 30,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 39,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$>"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$>"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "i",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "to_f",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Int::to_f",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 26,
-               "column_start": 2,
-               "line_end": 40,
-               "line_start": 40,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Int$to_f"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Int"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Int$to_f"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Int"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "+",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Float::+",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 45,
-               "line_start": 45,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$+"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Float$+"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Float"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "-",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Float::-",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 46,
-               "line_start": 46,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$-"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Float$-"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Float"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "*",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Float::*",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 47,
-               "line_start": 47,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$*"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Float$*"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Float"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "/",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Float::/",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 33,
-               "column_start": 2,
-               "line_end": 48,
-               "line_start": 48,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$/"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Float$/"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Float"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": ">",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Float::>",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["intern", "fun"],
-       "location": {
-               "column_end": 32,
-               "column_start": 2,
-               "line_end": 49,
-               "line_start": 49,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Float$>"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Float"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Float$>"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Float"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "f",
-                       "mtype": {
-                               "full_name": "test_prog::Float"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_strength_bonus",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::careers::Career::_strength_bonus",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$_strength_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$_strength_bonus"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "strength_bonus",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Career::strength_bonus",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$strength_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$strength_bonus"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "strength_bonus=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Career::strength_bonus=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 31,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$strength_bonus="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$strength_bonus="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "strength_bonus",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_endurance_bonus",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::careers::Career::_endurance_bonus",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 25,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$_endurance_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$_endurance_bonus"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "endurance_bonus",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Career::endurance_bonus",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 25,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$endurance_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$endurance_bonus"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "endurance_bonus=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Career::endurance_bonus=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 25,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$endurance_bonus="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$endurance_bonus="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "endurance_bonus",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_intelligence_bonus",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::careers::Career::_intelligence_bonus",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 33,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$_intelligence_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$_intelligence_bonus"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "intelligence_bonus",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Career::intelligence_bonus",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 33,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$intelligence_bonus"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$intelligence_bonus"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "intelligence_bonus=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Career::intelligence_bonus=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 28,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 33,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Career$intelligence_bonus="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Career"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Career$intelligence_bonus="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Career"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "intelligence_bonus",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_base_strength",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::races::Race::_base_strength",
-       "mdoc": {
-               "content": "Used to represents how strong the race is.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 35,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 23,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$_base_strength"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$_base_strength"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "base_strength",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Race::base_strength",
-       "mdoc": {
-               "content": "Used to represents how strong the race is.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 35,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 23,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_strength"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$base_strength"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "base_strength=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Race::base_strength=",
-       "mdoc": {
-               "content": "Used to represents how strong the race is.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 36,
-                       "line_start": 35,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 23,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_strength="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$base_strength="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "base_strength",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_base_endurance",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::races::Race::_base_endurance",
-       "mdoc": {
-               "content": "Used to represents how the race can absorb damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$_base_endurance"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$_base_endurance"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "base_endurance",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Race::base_endurance",
-       "mdoc": {
-               "content": "Used to represents how the race can absorb damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_endurance"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$base_endurance"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "base_endurance=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Race::base_endurance=",
-       "mdoc": {
-               "content": "Used to represents how the race can absorb damage.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 38,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 24,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 38,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_endurance="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$base_endurance="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "base_endurance",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_base_intelligence",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::races::Race::_base_intelligence",
-       "mdoc": {
-               "content": "Is this race smart?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 42,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$_base_intelligence"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$_base_intelligence"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "base_intelligence",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Race::base_intelligence",
-       "mdoc": {
-               "content": "Is this race smart?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 42,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_intelligence"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$base_intelligence"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "base_intelligence=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Race::base_intelligence=",
-       "mdoc": {
-               "content": "Is this race smart?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 42,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Race$base_intelligence="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Race"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Race$base_intelligence="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Race"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "base_intelligence",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_race",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::character::Character::_race",
-       "mdoc": {
-               "content": "The `Race` of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 25,
-                       "line_start": 24,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 15,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 24,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_race"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_race"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Race"
-       }
-}
-{
-       "name": "race",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::race",
-       "mdoc": {
-               "content": "The `Race` of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 25,
-                       "line_start": 24,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 15,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 24,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$race"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$race"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Race"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "race=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::race=",
-       "mdoc": {
-               "content": "The `Race` of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 25,
-                       "line_start": 24,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 15,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 24,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$race="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$race="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "race",
-                       "mtype": {
-                               "full_name": "test_prog::Race"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_career",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::character::Character::_career",
-       "mdoc": {
-               "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 47,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_career"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_career"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "nullable test_prog::Career"
-       }
-}
-{
-       "name": "career",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::career",
-       "mdoc": {
-               "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 47,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$career"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$career"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "nullable test_prog::Career"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "career=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::career=",
-       "mdoc": {
-               "content": "The current `Career` of the character.\nReturns `null` if character is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 27,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 47,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 27,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$career="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$career="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "career",
-                       "mtype": {
-                               "full_name": "nullable test_prog::Career"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "quit",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::quit",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 33,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$quit"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$quit"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_name",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::character::Character::_name",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_name"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_name"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::String"
-       }
-}
-{
-       "name": "name",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::name",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$name"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$name"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::String"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "name=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::name=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 35,
-               "line_start": 35,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$name="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$name="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "name",
-                       "mtype": {
-                               "full_name": "test_prog::String"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_age",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::character::Character::_age",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 13,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_age"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_age"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "age",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::age",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 13,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$age"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$age"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "age=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::age=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 13,
-               "column_start": 2,
-               "line_end": 36,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$age="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$age="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "age",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_sex",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::character::Character::_sex",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 14,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_sex"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_sex"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Bool"
-       }
-}
-{
-       "name": "sex",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::sex",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 14,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$sex"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$sex"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "sex=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::sex=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 14,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 37,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$sex="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$sex="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "sex",
-                       "mtype": {
-                               "full_name": "test_prog::Bool"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "total_strengh",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::total_strengh",
-       "mdoc": {
-               "content": "The actual strength of the character.\n\nReturns `race.base_strength + career.strength_bonus` or just `race.base_strength` is unemployed.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 42,
-                       "line_start": 39,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 45,
-               "line_start": 39,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$total_strengh"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$total_strengh"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "total_endurance",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::total_endurance",
-       "mdoc": {
-               "content": "The actual endurance of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 48,
-                       "line_start": 47,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 51,
-               "line_start": 47,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$total_endurance"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$total_endurance"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "total_intelligence",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::total_intelligence",
-       "mdoc": {
-               "content": "The acutal intelligence of the character.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 54,
-                       "line_start": 53,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 4,
-               "column_start": 2,
-               "line_end": 57,
-               "line_start": 53,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$total_intelligence"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$total_intelligence"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "max_health",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::max_health",
-       "mdoc": {
-               "content": "Maximum health of the character.\n\nBased on `total endurance * 10`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 62,
-                       "line_start": 59,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 51,
-               "column_start": 2,
-               "line_end": 62,
-               "line_start": 59,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$max_health"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$max_health"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_health",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::character::Character::_health",
-       "mdoc": {
-               "content": "The current `health` of the character.\n\nStarts at `max_health`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 67,
-                       "line_start": 64,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 67,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$_health"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$_health"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::Int"
-       }
-}
-{
-       "name": "health",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::health",
-       "mdoc": {
-               "content": "The current `health` of the character.\n\nStarts at `max_health`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 67,
-                       "line_start": 64,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 67,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$health"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$health"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "health=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Character::health=",
-       "mdoc": {
-               "content": "The current `health` of the character.\n\nStarts at `max_health`.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 67,
-                       "line_start": 64,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 29,
-               "column_start": 2,
-               "line_end": 67,
-               "line_start": 64,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Character$health="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Character"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Character$health="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Character"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "health",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "dps",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Weapon::dps",
-       "mdoc": {
-               "content": "Damage per second inflicted by this weapon.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 23,
-                       "line_start": 22,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 22,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Weapon$dps"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Weapon"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Weapon$dps"
-       }, {
-               "full_name": "test_prog::combat$Dwarf$Weapon::dps"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Weapon"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Float"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "hit_points",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Combatable::hit_points",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 32,
-               "column_start": 2,
-               "line_end": 32,
-               "line_start": 32,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$hit_points"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Combatable$hit_points"
-       }, {
-               "full_name": "test_prog::combat$Character$Combatable::hit_points"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Combatable"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "attack",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Combatable::attack",
-       "mdoc": {
-               "content": "A `Combatable` can attack a `target` that is also a `Combatable`.\n\nAttack the `target` using `wepaon` and returns the number of inflicted hit points.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 37,
-                       "line_start": 34,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 64,
-               "column_start": 2,
-               "line_end": 37,
-               "line_start": 34,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$attack"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Combatable$attack"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Combatable"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 2,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "target",
-                       "mtype": {
-                               "full_name": "test_prog::Combatable"
-                       }
-               }, {
-                       "is_vararg": false,
-                       "name": "weapon",
-                       "mtype": {
-                               "full_name": "test_prog::Weapon"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "direct_attack",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Combatable::direct_attack",
-       "mdoc": {
-               "content": "Like `attack` but cannot be defended.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 40,
-                       "line_start": 39,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 71,
-               "column_start": 2,
-               "line_end": 40,
-               "line_start": 39,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$direct_attack"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Combatable$direct_attack"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Combatable"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 2,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "target",
-                       "mtype": {
-                               "full_name": "test_prog::Combatable"
-                       }
-               }, {
-                       "is_vararg": false,
-                       "name": "weapon",
-                       "mtype": {
-                               "full_name": "test_prog::Weapon"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "defend",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Combatable::defend",
-       "mdoc": {
-               "content": "`Combatable` can defend against attacks.\n\nDefends against a number of received hit points and return the number of pared hit points.\n\n@param hit: damage received.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 47,
-                       "line_start": 42,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 38,
-               "column_start": 2,
-               "line_end": 47,
-               "line_start": 42,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$defend"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Combatable$defend"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Combatable"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "hit",
-                       "mtype": {
-                               "full_name": "test_prog::Int"
-                       }
-               }],
-               "return_mtype": {
-                       "full_name": "test_prog::Int"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "is_dead",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Combatable::is_dead",
-       "mdoc": {
-               "content": "Is the character still have hit_points?",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 50,
-                       "line_start": 49,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 43,
-               "column_start": 2,
-               "line_end": 50,
-               "line_start": 49,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Combatable$is_dead"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Combatable"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Combatable$is_dead"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Combatable"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::Bool"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "player_characters",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Game::player_characters",
-       "mdoc": {
-               "content": "Characters played by human players.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 26,
-                       "line_start": 25,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 51,
-               "column_start": 2,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$player_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Game$player_characters"
-       }, {
-               "full_name": "test_prog$MyGame$Game::player_characters"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::List[test_prog::Character]"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "computer_characters",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Game::computer_characters",
-       "mdoc": {
-               "content": "Characters players by computer.",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 29,
-                       "line_start": 28,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 53,
-               "column_start": 2,
-               "line_end": 29,
-               "line_start": 28,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$computer_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Game$computer_characters"
-       }, {
-               "full_name": "test_prog$MyGame$Game::computer_characters"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": {
-                       "full_name": "test_prog::List[test_prog::Character]"
-               },
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "start_game",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Game::start_game",
-       "mdoc": {
-               "content": "Start the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 34,
-                       "line_start": 31,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 34,
-               "line_start": 31,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$start_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Game$start_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::start_game"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "pause_game",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Game::pause_game",
-       "mdoc": {
-               "content": "Pause the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 39,
-                       "line_start": 36,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 27,
-               "column_start": 2,
-               "line_end": 39,
-               "line_start": 36,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$pause_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Game$pause_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::pause_game"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "stop_game",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Game::stop_game",
-       "mdoc": {
-               "content": "Stop the game.\n\nYou have to implement that method!",
-               "location": {
-                       "column_end": 0,
-                       "column_start": 2,
-                       "line_end": 44,
-                       "line_start": 41,
-                       "file": "test_location"
-               }
-       },
-       "visibility": "public",
-       "modifiers": ["abstract", "fun"],
-       "location": {
-               "column_end": 26,
-               "column_start": 2,
-               "line_end": 44,
-               "line_start": 41,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Game$stop_game"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Game"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Game$stop_game"
-       }, {
-               "full_name": "test_prog$MyGame$Game::stop_game"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Game"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_player_characters",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::game_examples::MyGame::_player_characters",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 50,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 23,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$_player_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$MyGame$_player_characters"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::MyGame"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::List[test_prog::Character]"
-       }
-}
-{
-       "name": "player_characters=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::MyGame::player_characters=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 50,
-               "column_start": 2,
-               "line_end": 23,
-               "line_start": 23,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$player_characters="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$MyGame$player_characters="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::MyGame"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "player_characters",
-                       "mtype": {
-                               "full_name": "test_prog::List[test_prog::Character]"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "_computer_characters",
-       "class_name": "MAttribute",
-       "full_name": "test_prog::game_examples::MyGame::_computer_characters",
-       "mdoc": null,
-       "visibility": "private",
-       "modifiers": ["private", "var"],
-       "location": {
-               "column_end": 52,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$_computer_characters"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$MyGame$_computer_characters"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::MyGame"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "static_mtype": {
-               "full_name": "test_prog::List[test_prog::Character]"
-       }
-}
-{
-       "name": "computer_characters=",
-       "class_name": "MMethod",
-       "full_name": "test_prog::MyGame::computer_characters=",
-       "mdoc": null,
-       "visibility": "protected",
-       "modifiers": ["protected", "fun"],
-       "location": {
-               "column_end": 52,
-               "column_start": 2,
-               "line_end": 25,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$MyGame$computer_characters="
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$MyGame"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$MyGame$computer_characters="
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::MyGame"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 1,
-               "mparams": [{
-                       "is_vararg": false,
-                       "name": "computer_characters",
-                       "mtype": {
-                               "full_name": "test_prog::List[test_prog::Character]"
-                       }
-               }],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "start",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Starter::start",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 17,
-               "column_start": 2,
-               "line_end": 22,
-               "line_start": 22,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Starter$start"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Starter"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Starter$start"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Starter"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
-{
-       "name": "main",
-       "class_name": "MMethod",
-       "full_name": "test_prog::Sys::main",
-       "mdoc": null,
-       "visibility": "public",
-       "modifiers": ["fun"],
-       "location": {
-               "column_end": 13,
-               "column_start": 1,
-               "line_end": 26,
-               "line_start": 25,
-               "file": "test_location"
-       },
-       "intro": {
-               "full_name": "test_prog$Sys$main"
-       },
-       "intro_mclassdef": {
-               "full_name": "test_prog$Sys"
-       },
-       "mpropdefs": [{
-               "full_name": "test_prog$Sys$main"
-       }],
-       "intro_mclass": {
-               "full_name": "test_prog::Sys"
-       },
-       "mpackage": {
-               "full_name": "test_prog"
-       },
-       "is_init": false,
-       "msignature": {
-               "arity": 0,
-               "mparams": [],
-               "return_mtype": null,
-               "vararg_rank": -1
-       }
-}
diff --git a/src/model/test_model_json.sav/test_refs_to_full_json.res b/src/model/test_model_json.sav/test_refs_to_full_json.res
deleted file mode 100644 (file)
index b5e00b5..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-       "full_name": "test_prog"
-}
-{
-       "full_name": "test_prog::game_examples"
-}
-{
-       "full_name": "test_prog::Object"
-}
index 2b61ab7..3617df4 100644 (file)
@@ -16,7 +16,7 @@
 module nitweb
 
 import frontend
-import web
+import doc::api
 import doc::doc_down
 
 redef class ToolContext
index ff97784..061b44e 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# `nitx`, is a command tool that displays useful informations about the code.
+# `nitx`, a command tool that displays useful data about Nit code
 #
 # Features:
 #
-# * Display comment from name/namespace
-# * Display documentation page from Nitdoc in console
+# * Display documentation from name/namespace
 # * Find type usage in parameters, returns and news.
-# * Find usage of a specific property.
+# * Find usage (calls) of a specific property.
 # * Find source code related to class/property by its name.
+# * Display inheritance lists
 module nitx
 
-import modelbuilder
-import doc::doc_phases::doc_console
+import frontend
+import doc::term
+import readline
 
 redef class ToolContext
 
-       # Nittx generation phase.
-       var docx: Phase = new NitxPhase(self, null)
-
        # Used to shortcut the prompt and display directly the result in console.
        var opt_command = new OptionString("Nitx command to perform", "-c", "--command")
 
-       init do option_context.add_option opt_command
+       # Compute and use the catalog
+       var opt_catalog = new OptionBool("Use catalog", "--catalog")
+
+       init do option_context.add_option(opt_command, opt_catalog)
 end
 
-# Nitx phase explores the model and prepares the console rendering.
-private class NitxPhase
-       super Phase
-       redef fun process_mainmodule(mainmodule, mmodules)
-       do
-               var doc = new DocModel(mainmodule.model, mainmodule)
-
-               var phases = [
-                       new MakePagePhase(toolcontext, doc),
-                       new ConcernsPhase(toolcontext, doc),
-                       new StructurePhase(toolcontext, doc),
-                       new POSetPhase(toolcontext, doc): DocPhase]
-
-               for phase in phases do
-                       toolcontext.info("# {phase.class_name}", 1)
-                       phase.apply
+# Nitx handles console queries
+#
+# Using `prompt`, the command line can be turned on an interactive tool.
+class Nitx
+
+       # ModelView that contains the informations to display
+       var view: ModelView
+
+       # ModelBuilder to access AST nodes
+       var modelbuilder: ModelBuilder
+
+       # Catalog if any
+       var catalog: nullable Catalog = null is optional
+
+       # Do not use colors in the output
+       var no_color = false is optional
+
+       # Displays the welcome message and start prompt.
+       fun start do
+               welcome
+               prompt
+       end
+
+       # Displays the welcome message and the list of loaded modules.
+       fun welcome do
+               print "Welcome in the Nit Index!"
+               print ""
+               print "Loaded packages:\n"
+               var cmd = new CmdModelEntities(view, kind = "packages")
+               cmd.init_command
+               for mpackage in cmd.results.as(not null) do
+                       print " * {mpackage.full_name}"
+               end
+               help
+       end
+
+       # Displays the list of available queries.
+       fun help do
+               # TODO automatize that
+               print "\nCommands:\n"
+               for usage, doc in parser.commands_usage do
+                       var l = usage.length / 8
+                       print "\t{usage}{"\t" * (3 - l)}{doc}"
+               end
+               print "\n"
+               print "\t:h\t\t\tdisplay this help message"
+               print "\t:q\t\t\tquit interactive mode"
+               print ""
+       end
+
+       # Prompts the user for a query.
+       fun prompt do
+               var line = readline(">> ", true)
+               if line != null then
+                       do_command(line)
                end
+               prompt
+       end
+
+       # Parser used to process doc commands
+       var parser = new CommandParser(view, modelbuilder, catalog) is lazy
 
-               # start nitx
-               var nitx = new Nitx(toolcontext, doc)
-               var q = toolcontext.opt_command.value
-               if q != null then # shortcut prompt
-                       print ""
-                       nitx.do_query(q)
+       # Processes the query string and performs it.
+       fun do_command(str: String) do
+               if str == ":q" then
+                       exit 0
+               else if str == ":h" then
+                       help
                        return
                end
-               nitx.start
+               parser.execute(str, no_color)
+       end
+end
+
+redef class Catalog
+       # Build the catalog for Nitx
+       private fun build_catalog(view: ModelView) do
+               # Compute the poset
+               for p in view.mpackages do
+                       var g = p.root
+                       assert g != null
+                       modelbuilder.scan_group(g)
+
+                       deps.add_node(p)
+                       for gg in p.mgroups do for m in gg.mmodules do
+                               for im in m.in_importation.direct_greaters do
+                                       var ip = im.mpackage
+                                       if ip == null or ip == p then continue
+                                       deps.add_edge(p, ip)
+                               end
+                       end
+               end
+               # Build the catalog
+               for mpackage in view.mpackages do
+                       package_page(mpackage)
+                       git_info(mpackage)
+                       mpackage_stats(mpackage)
+               end
        end
 end
 
@@ -71,7 +143,7 @@ end
 var toolcontext = new ToolContext
 var tpl = new Template
 tpl.add "Usage: nitx [OPTION]... <file.nit>... [query]\n"
-tpl.add "Displays specific pieces of API information from Nit source files."
+tpl.add "Displays pieces of API information from Nit source files."
 toolcontext.tooldescription = tpl.write_to_string
 
 # process options
@@ -87,3 +159,22 @@ var mmodules = mbuilder.parse_full(arguments)
 if mmodules.is_empty then return
 mbuilder.run_phases
 toolcontext.run_global_phases(mmodules)
+var mainmodule = toolcontext.make_main_module(mmodules)
+
+# build views
+var view = new ModelView(model, mainmodule)
+var catalog = null
+if toolcontext.opt_catalog.value then
+       catalog = new Catalog(mbuilder)
+       catalog.build_catalog(view)
+end
+
+# start nitx
+var nitx = new Nitx(view, mbuilder, catalog, toolcontext.opt_no_color.value)
+var q = toolcontext.opt_command.value
+if q != null then # shortcut prompt
+       print ""
+       nitx.do_command(q)
+       return
+end
+nitx.start
diff --git a/src/web/api_catalog.nit b/src/web/api_catalog.nit
deleted file mode 100644 (file)
index afad834..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-module api_catalog
-
-import api_model
-import catalog::catalog_json
-
-redef class NitwebConfig
-
-       # Catalog to pass to handlers.
-       var catalog: Catalog is noinit
-
-       # Build the catalog
-       #
-       # This method should be called at nitweb startup.
-       fun build_catalog do
-               self.catalog = new Catalog(modelbuilder)
-               self.catalog.build_catalog(model.mpackages)
-       end
-end
-
-redef class APIRouter
-       redef init do
-               super
-               use("/catalog/packages/", new APICatalogPackages(config))
-               use("/catalog/stats", new APICatalogStats(config))
-
-               use("/catalog/tags", new APICatalogTags(config))
-               use("/catalog/tag/:tid", new APICatalogTag(config))
-
-               use("/catalog/person/:pid", new APICatalogPerson(config))
-               use("/catalog/person/:pid/maintaining", new APICatalogMaintaining(config))
-               use("/catalog/person/:pid/contributing", new APICatalogContributing(config))
-       end
-end
-
-abstract class APICatalogHandler
-       super APIHandler
-
-       # Sorter used to sort packages
-       #
-       # Sorting is based on mpackage score.
-       var mpackages_sorter = new CatalogScoreSorter(config.catalog) is lazy
-end
-
-# Get all the packages from the catalog using pagination
-#
-# `GET /packages?p=1&n=10`: get the list of catalog by page
-class APICatalogPackages
-       super APICatalogHandler
-
-       redef fun get(req, res) do
-               var page = req.int_arg("p")
-               var limit = req.int_arg("n")
-               var mpackages = config.catalog.mpackages.values.to_a
-               mpackages_sorter.sort(mpackages)
-               var response = new JsonArray.from(mpackages)
-               res.json paginate(response, response.length, page, limit)
-       end
-end
-
-# Get the catalog statistics
-#
-# `GET /stats`: return the catalog statistics
-class APICatalogStats
-       super APICatalogHandler
-
-       redef fun get(req, res) do
-               res.json config.catalog.catalog_stats
-       end
-end
-
-# Get all the tags from the catalog
-#
-# `GET /tags`: the list of tags associated with their number of packages
-class APICatalogTags
-       super APICatalogHandler
-
-       # Sorter to sort tags alphabetically
-       var tags_sorter = new CatalogTagsSorter
-
-       redef fun get(req, res) do
-               var obj = new JsonObject
-
-               var tags = config.catalog.tag2proj.keys.to_a
-               tags_sorter.sort(tags)
-
-               for tag in tags do
-                       if not config.catalog.tag2proj.has_key(tag) then continue
-                       obj[tag] = config.catalog.tag2proj[tag].length
-               end
-               res.json obj
-       end
-end
-
-# Get the packages related to a tag
-#
-# `GET /tag/:tid?p=1&n=10`: return a paginated list of packages
-class APICatalogTag
-       super APICatalogHandler
-
-       redef fun get(req, res) do
-               var page = req.int_arg("p")
-               var limit = req.int_arg("n")
-               var id = req.param("tid")
-               if id == null then
-                       res.api_error(400, "Missing tag")
-                       return
-               end
-               id = id.from_percent_encoding
-               if not config.catalog.tag2proj.has_key(id) then
-                       res.api_error(404, "Tag not found")
-                       return
-               end
-               var obj = new JsonObject
-               obj["tag"] = id
-               var mpackages = config.catalog.tag2proj[id]
-               mpackages_sorter.sort(mpackages)
-               var response = new JsonArray.from(mpackages)
-               obj["packages"] = paginate(response, response.length, page, limit)
-               res.json obj
-       end
-end
-
-# Get a person existing in the catalog
-#
-# `GET /person/:pid`: get the person with `pid`
-class APICatalogPerson
-       super APICatalogHandler
-
-       # Get the person with `:pid` or throw a 404 error
-       fun get_person(req: HttpRequest, res: HttpResponse): nullable Person do
-               var id = req.param("pid")
-               if id == null then
-                       res.api_error(400, "Missing package full_name")
-                       return null
-               end
-               id = id.from_percent_encoding
-               if not config.catalog.name2person.has_key(id) then
-                       res.api_error(404, "Person not found")
-                       return null
-               end
-               return config.catalog.name2person[id]
-       end
-
-       redef fun get(req, res) do
-               var person = get_person(req, res)
-               if person == null then return
-               res.json person
-       end
-end
-
-# Get the list of mpackages maintained by a person
-#
-# `GET /person/:pid/maintaining?p=1&n=10`: return a paginated list of packages
-class APICatalogMaintaining
-       super APICatalogPerson
-
-       redef fun get(req, res) do
-               var person = get_person(req, res)
-               if person == null then return
-
-               var page = req.int_arg("p")
-               var limit = req.int_arg("n")
-               var array = new Array[MPackage]
-               if config.catalog.maint2proj.has_key(person) then
-                       array = config.catalog.maint2proj[person].to_a
-               end
-               mpackages_sorter.sort(array)
-               var response = new JsonArray.from(array)
-               res.json paginate(response, response.length, page, limit)
-       end
-end
-
-# Get the list of mpackages contributed by a person
-#
-# `GET /person/:pid/contributing?p=1&n=10`: return a paginated list of packages
-class APICatalogContributing
-       super APICatalogPerson
-
-       redef fun get(req, res) do
-               var person = get_person(req, res)
-               if person == null then return
-
-               var page = req.int_arg("p")
-               var limit = req.int_arg("n")
-               var array = new Array[MPackage]
-               if config.catalog.contrib2proj.has_key(person) then
-                       array = config.catalog.contrib2proj[person].to_a
-               end
-               mpackages_sorter.sort(array)
-               var response = new JsonArray.from(array)
-               res.json paginate(response, response.length, page, limit)
-       end
-end
-
-redef class APIEntity
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-
-               # Special case for packages (catalog view)
-               if mentity isa MPackage then
-                       res.raw_json mentity.to_full_catalog_json(plain=true, config.mainmodule, config.catalog)
-               else
-                       res.raw_json mentity.to_full_json(config.mainmodule)
-               end
-       end
-end
-
-redef class APISearch
-       super APICatalogHandler
-
-       redef fun search(query, limit) do
-               var index = config.view.index
-
-               # lookup by name prefix
-               var matches = index.find_by_name_prefix(query).uniq.
-                       sort(lname_sorter, name_sorter, kind_sorter)
-               matches = matches.rerank.sort(vis_sorter, score_sorter)
-
-               # lookup by tags
-               var malus = matches.length
-               if config.catalog.tag2proj.has_key(query) then
-                       for mpackage in config.catalog.tag2proj[query] do
-                               matches.add new IndexMatch(mpackage, malus)
-                               malus += 1
-                       end
-                       matches = matches.uniq.rerank.sort(vis_sorter, score_sorter)
-               end
-
-               # lookup by full_name prefix
-               malus = matches.length
-               var full_matches = new IndexMatches
-               for match in index.find_by_full_name_prefix(query).
-                       sort(lfname_sorter, fname_sorter) do
-                       match.score += 1
-                       full_matches.add match
-               end
-               matches = matches.uniq
-
-               # lookup by similarity
-               malus = matches.length
-               var sim_matches = new IndexMatches
-               for match in index.find_by_similarity(query).sort(score_sorter, lname_sorter, name_sorter) do
-                       if match.score > query.length then break
-                       match.score += 1
-                       sim_matches.add match
-               end
-               matches.add_all sim_matches
-               matches = matches.uniq
-               return matches.rerank.sort(vis_sorter, score_sorter).mentities
-       end
-
-       private var score_sorter = new ScoreComparator
-       private var vis_sorter = new VisibilityComparator
-       private var name_sorter = new NameComparator
-       private var lname_sorter = new NameLengthComparator
-       private var fname_sorter = new FullNameComparator
-       private var lfname_sorter = new FullNameLengthComparator
-       private var kind_sorter = new MEntityComparator
-end
-
-redef class Catalog
-
-       # Build the catalog from `mpackages`
-       fun build_catalog(mpackages: Array[MPackage]) do
-               # Compute the poset
-               for p in mpackages do
-                       var g = p.root
-                       assert g != null
-                       modelbuilder.scan_group(g)
-
-                       deps.add_node(p)
-                       for gg in p.mgroups do for m in gg.mmodules do
-                               for im in m.in_importation.direct_greaters do
-                                       var ip = im.mpackage
-                                       if ip == null or ip == p then continue
-                                       deps.add_edge(p, ip)
-                               end
-                       end
-               end
-               # Build the catalog
-               for mpackage in mpackages do
-                       package_page(mpackage)
-                       git_info(mpackage)
-                       mpackage_stats(mpackage)
-               end
-       end
-end
-
-redef class MPackage
-       # Serialize the full catalog version of `self` to JSON
-       #
-       # See: `FullCatalogSerializer`
-       fun to_full_catalog_json(mainmodule: MModule, catalog: Catalog, plain, pretty: nullable Bool): String do
-               var stream = new StringWriter
-               var serializer = new FullCatalogSerializer(stream, mainmodule, catalog)
-               serializer.plain_json = plain or else false
-               serializer.pretty_json = pretty or else false
-               serializer.serialize self
-               stream.close
-               return stream.to_s
-       end
-
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("metadata", metadata)
-               if v isa FullCatalogSerializer then
-                       v.serialize_attribute("stats", v.catalog.mpackages_stats[self])
-
-                       var parents = v.catalog.deps[self].direct_greaters.to_a
-                       v.serialize_attribute("dependencies", v.deps_to_json(parents))
-                       var children = v.catalog.deps[self].direct_smallers.to_a
-                       v.serialize_attribute("clients", v.deps_to_json(children))
-               end
-       end
-end
-
-# CatalogSerializer decorate the Package JSON with full catalog metadata
-#
-# See MEntity::to_full_catalog_json.
-class FullCatalogSerializer
-       super FullJsonSerializer
-
-       # Catalog used to decorate the MPackages
-       var catalog: Catalog
-
-       private fun deps_to_json(mpackages: Array[MPackage]): JsonArray do
-               var res = new JsonArray
-               for mpackage in mpackages do
-                       res.add dep_to_json(mpackage)
-               end
-               return res
-       end
-
-       private fun dep_to_json(mpackage: MPackage): JsonObject do
-               var obj = new JsonObject
-               obj["name"] = mpackage.name
-               var mdoc = mpackage.mdoc_or_fallback
-               if mdoc != null then
-                       obj["synopsis"] = mdoc.synopsis.write_to_string
-               end
-               return obj
-       end
-end
diff --git a/src/web/api_docdown.nit b/src/web/api_docdown.nit
deleted file mode 100644 (file)
index 561f0af..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Nitdoc specific Markdown format handling for Nitweb
-module api_docdown
-
-import api_graph
-intrude import doc_down
-intrude import markdown::wikilinks
-import doc_commands
-import model::model_index
-
-redef class NitwebConfig
-       # Specific Markdown processor to use within Nitweb
-       var md_processor: MarkdownProcessor is lazy do
-               var proc = new MarkdownProcessor
-               proc.decorator = new NitwebDecorator(view, modelbuilder)
-               return proc
-       end
-end
-
-redef class APIRouter
-       redef init do
-               super
-               use("/docdown/", new APIDocdown(config))
-       end
-end
-
-# Docdown handler accept docdown as POST data and render it as HTML
-class APIDocdown
-       super APIHandler
-
-       redef fun post(req, res) do
-               res.html config.md_processor.process(req.body)
-       end
-end
-
-# Specific Markdown decorator for Nitweb
-#
-# We reuse all the implementation of the NitdocDecorator and add the wikilinks handling.
-class NitwebDecorator
-       super NitdocDecorator
-
-       # View used by wikilink commands to find model entities
-       var view: ModelView
-
-       # Modelbuilder used to access code
-       var modelbuilder: ModelBuilder
-
-       redef fun add_span_code(v, buffer, from, to) do
-               var text = new FlatBuffer
-               buffer.read(text, from, to)
-               var name = text.write_to_string
-               name = name.replace("nullable ", "")
-               var mentity = try_find_mentity(view, name)
-               if mentity == null then
-                       super
-               else
-                       v.add "<code>"
-                       v.write_mentity_link(mentity, text.write_to_string)
-                       v.add "</code>"
-               end
-       end
-
-       private fun try_find_mentity(view: ModelView, text: String): nullable MEntity do
-               var mentity = view.mentity_by_full_name(text)
-               if mentity != null then return mentity
-
-               var mentities = view.mentities_by_name(text)
-               if mentities.is_empty then
-                       return null
-               else if mentities.length > 1 then
-                       # TODO smart resolve conflicts
-               end
-               return mentities.first
-       end
-
-       redef fun add_wikilink(v, token) do
-               v.render_wikilink(token, view)
-       end
-end
-
-# Same as `InlineDecorator` but with wikilink commands handling
-class NitwebInlineDecorator
-       super InlineDecorator
-
-       # View used by wikilink commands to find model entities
-       var view: ModelView
-
-       # Modelbuilder used to access code
-       var modelbuilder: ModelBuilder
-
-       redef fun add_wikilink(v, token) do
-               v.render_wikilink(token, view)
-       end
-end
-
-redef class MarkdownProcessor
-
-       # Parser used to process doc commands
-       var parser = new DocCommandParser
-
-       # Render a wikilink
-       fun render_wikilink(token: TokenWikiLink, model: ModelView) do
-               var link = token.link
-               if link == null then return
-               var name = token.name
-               if name != null then link = "{name} | {link}"
-               var cmd = parser.parse(link.write_to_string)
-               if cmd == null then
-                       var full_name = if token.link != null then token.link.as(not null).write_to_string.trim else null
-                       if full_name == null or full_name.is_empty then
-                               write_error("empty wikilink")
-                               return
-                       end
-                       var mentity = find_mentity(model, full_name)
-                       if mentity == null then return
-                       name = if token.name != null then token.name.as(not null).to_s else null
-                       write_mentity_link(mentity, name)
-                       return
-               else
-                       for message in parser.errors do
-                               if message.level == 1 then
-                                       write_error(message.message)
-                               else if message.level > 1 then
-                                       write_warning(message.message)
-                               end
-                       end
-               end
-               cmd.render(self, token, model)
-       end
-
-       # Find the MEntity that matches `name`.
-       #
-       # Write an error if the entity is not found
-       fun find_mentity(model: ModelView, name: nullable String): nullable MEntity do
-               if name == null then
-                       write_error("no MEntity found")
-                       return null
-               end
-               # Lookup by full name
-               var mentity = model.mentity_by_full_name(name)
-               if mentity != null then return mentity
-
-               var mentities = model.mentities_by_name(name)
-               if mentities.is_empty then
-                       var suggest = model.find(name, 3)
-                       var msg = new Buffer
-                       msg.append "no MEntity found for name `{name}`"
-                       if suggest.not_empty then
-                               msg.append " (suggestions: "
-                               var i = 0
-                               for s in suggest do
-                                       msg.append "`{s.full_name}`"
-                                       if i < suggest.length - 1 then msg.append ", "
-                                       i += 1
-                               end
-                               msg.append ")"
-                       end
-                       write_error(msg.write_to_string)
-                       return null
-               else if mentities.length > 1 then
-                       var msg = new Buffer
-                       msg.append "conflicts for name `{name}`"
-                       msg.append " (conflicts: "
-                       var i = 0
-                       for s in mentities do
-                               msg.append "`{s.full_name}`"
-                               if i < mentities.length - 1 then msg.append ", "
-                               i += 1
-                       end
-                       msg.append ")"
-                       write_warning(msg.write_to_string)
-               end
-               return mentities.first
-       end
-
-       # Write a warning in the output
-       fun write_warning(text: String) do
-               emit_text "<p class='text-warning'>Warning: {text}</p>"
-       end
-
-       # Write an error in the output
-       fun write_error(text: String) do
-               emit_text "<p class='text-danger'>Error: {text}</p>"
-       end
-
-       # Write a link to a mentity in the output
-       fun write_mentity_link(mentity: MEntity, text: nullable String) do
-               var link = mentity.web_url
-               var name = text or else mentity.name
-               var mdoc = mentity.mdoc_or_fallback
-               var comment = null
-               if mdoc != null then comment = mdoc.synopsis
-               decorator.add_link(self, link, name, comment)
-       end
-
-       # Write a mentity list in the output
-       fun write_mentity_list(mentities: Collection[MEntity]) do
-               add "<ul>"
-               for mentity in mentities do
-                       var mdoc = mentity.mdoc_or_fallback
-                       add "<li>"
-                       write_mentity_link(mentity)
-                       if mdoc != null then
-                               add " - "
-                               emit_text mdoc.synopsis
-                       end
-                       add "</li>"
-               end
-               add "</ul>"
-       end
-end
-
-redef class DocCommand
-
-       # Emit the HTML related to the execution of this doc command
-       fun render(v: MarkdownProcessor, token: TokenWikiLink, model: ModelView) do
-               v.write_error("not yet implemented command `{token.link or else "null"}`")
-       end
-end
-
-redef class CommentCommand
-       redef fun render(v, token, model) do
-               var name = arg
-               var mentity = v.find_mentity(model, name)
-               if mentity == null then return
-               var mdoc = mentity.mdoc_or_fallback
-               if mdoc == null then
-                       v.write_warning("no MDoc for mentity `{name}`")
-                       return
-               end
-               v.add "<h3>"
-               if not opts.has_key("no-link") then
-                       v.write_mentity_link(mentity)
-               end
-               if not opts.has_key("no-link") and not opts.has_key("no-synopsis") then
-                       v.add " - "
-               end
-               if not opts.has_key("no-synopsis") then
-                       v.emit_text mdoc.html_synopsis.write_to_string
-               end
-               v.add "</h3>"
-               if not opts.has_key("no-comment") then
-                       v.add v.process(mdoc.comment).write_to_string
-               end
-       end
-end
-
-redef class ListCommand
-       redef fun render(v, token, model) do
-               var name = arg
-               var mentity = v.find_mentity(model, name)
-               if mentity == null then return
-               if mentity isa MPackage then
-                       v.write_mentity_list(mentity.mgroups)
-               else if mentity isa MGroup then
-                       var res = new Array[MEntity]
-                       res.add_all mentity.in_nesting.smallers
-                       res.add_all mentity.mmodules
-                       v.write_mentity_list(res)
-               else if mentity isa MModule then
-                       v.write_mentity_list(mentity.mclassdefs)
-               else if mentity isa MClass then
-                       v.write_mentity_list(mentity.collect_intro_mproperties(model))
-               else if mentity isa MClassDef then
-                       v.write_mentity_list(mentity.mpropdefs)
-               else if mentity isa MProperty then
-                       v.write_mentity_list(mentity.mpropdefs)
-               else
-                       v.write_error("no list found for name `{name}`")
-               end
-       end
-end
-
-redef class CodeCommand
-       redef fun render(v, token, model) do
-               var name = arg
-               var mentity = v.find_mentity(model, name)
-               if mentity == null then return
-               if mentity isa MClass then mentity = mentity.intro
-               if mentity isa MProperty then mentity = mentity.intro
-               var source = render_source(mentity, v.decorator.as(NitwebDecorator).modelbuilder)
-               if source == null then
-                       v.write_error("no source for MEntity `{name}`")
-                       return
-               end
-               v.add "<pre>"
-               v.add source
-               v.add "</pre>"
-       end
-
-       # Highlight `mentity` source code.
-       private fun render_source(mentity: MEntity, modelbuilder: ModelBuilder): nullable HTMLTag do
-               var node = modelbuilder.mentity2node(mentity)
-               if node == null then return null
-               var hl = new HtmlightVisitor
-               hl.highlight_node node
-               return hl.html
-       end
-end
-
-redef class GraphCommand
-       redef fun render(v, token, model) do
-               var name = arg
-               var mentity = v.find_mentity(model, name)
-               if mentity == null then return
-               var g = new InheritanceGraph(mentity, model)
-               var pdepth = if opts.has_key("pdepth") and opts["pdepth"].is_int then
-                       opts["pdepth"].to_i else 3
-               var cdepth = if opts.has_key("cdepth") and opts["cdepth"].is_int then
-                       opts["cdepth"].to_i else 3
-               v.add g.draw(pdepth, cdepth).to_svg
-       end
-end
-
-redef class Text
-       # Read `self` between `nstart` and `nend` (excluded) and writte chars to `out`.
-       private fun read(out: FlatBuffer, nstart, nend: Int): Int do
-               var pos = nstart
-               while pos < length and pos < nend do
-                       out.add self[pos]
-                       pos += 1
-               end
-               if pos == length then return -1
-               return pos
-       end
-end
diff --git a/src/web/api_graph.nit b/src/web/api_graph.nit
deleted file mode 100644 (file)
index 33ff7f8..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Render various graph from a model.
-module api_graph
-
-import web_base
-import dot
-import uml
-
-redef class APIRouter
-       init do
-               super
-               use("/graph/inheritance/:id", new APIInheritanceGraph(config))
-       end
-end
-
-# Render a hierarchy graph for `mentity` if any.
-class APIInheritanceGraph
-       super APIHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               var pdepth = req.int_arg("pdepth")
-               var cdepth = req.int_arg("cdepth")
-               var g = new InheritanceGraph(mentity, config.view)
-               res.send g.draw(pdepth, cdepth).to_svg
-       end
-end
-
-# Graph for mentity hierarchies
-#
-# Recursively build parents and children list from a `center`.
-class InheritanceGraph
-       super ModelVisitor
-
-       autoinit center, view, filter
-
-       # MEntity at the center of this graph
-       var center: MEntity
-
-       # ModelView used to filter graph
-       var view: ModelView
-
-       # Graph generated
-       var graph: DotGraph is lazy do
-               var graph = new DotGraph("package_diagram", "digraph")
-
-               graph["compound"] = "true"
-               graph["rankdir"] = "BT"
-               graph["ranksep"] = 0.3
-               graph["nodesep"] = 0.3
-
-               graph.nodes_attrs["margin"] = 0.1
-               graph.nodes_attrs["width"] = 0
-               graph.nodes_attrs["height"] = 0
-               graph.nodes_attrs["fontsize"] = 10
-               graph.nodes_attrs["fontname"] = "helvetica"
-
-               graph.edges_attrs["dir"] = "none"
-               graph.edges_attrs["color"] = "gray"
-
-               return graph
-       end
-
-       # Build the graph
-       fun draw(parents_depth, children_depth: nullable Int): DotGraph do
-               draw_node center
-               draw_parents(center, parents_depth)
-               draw_children(center, children_depth)
-               return graph
-       end
-
-       private var nodes = new HashMap[MEntity, DotElement]
-       private var done_parents = new HashSet[MEntity]
-       private var done_children = new HashSet[MEntity]
-
-       # Recursively draw parents of mentity
-       fun draw_parents(mentity: MEntity, max_depth: nullable Int, current_depth: nullable Int) do
-               if done_parents.has(mentity) then return
-               done_parents.add mentity
-               current_depth = current_depth or else 0
-               if max_depth != null and current_depth >= max_depth then
-                       from_dotdotdot(mentity)
-                       return
-               end
-               var parents = mentity.collect_parents(view)
-               if parents.length > 10 then
-                       from_dotdotdot(mentity)
-                       return
-               end
-               for parent in parents do
-                       if parent isa MModule then
-                               var mgroup = parent.mgroup
-                               if mgroup != null and mgroup.default_mmodule == parent then parent = mgroup
-                       end
-                       if parent isa MGroup then
-                               if parent.mpackage.mgroups.first == parent then parent = parent.mpackage
-                       end
-                       draw_edge(mentity, parent)
-               end
-               for parent in parents do
-                       if parent isa MModule then
-                               var mgroup = parent.mgroup
-                               if mgroup != null and mgroup.default_mmodule == parent then parent = mgroup
-                       end
-                       if parent isa MGroup then
-                               if parent.mpackage.mgroups.first == parent then parent = parent.mpackage
-                       end
-                       draw_parents(parent, max_depth, current_depth + 1)
-               end
-       end
-
-       # Recursively draw children of mentity
-       fun draw_children(mentity: MEntity, max_depth: nullable Int, current_depth: nullable Int) do
-               if done_children.has(mentity) then return
-               done_children.add mentity
-               current_depth = current_depth or else 0
-               if max_depth != null and current_depth >= max_depth then
-                       to_dotdotdot(mentity)
-                       return
-               end
-               var children = mentity.collect_children(view)
-               if children.length > 10 then
-                       to_dotdotdot(mentity)
-                       return
-               end
-               for child in children do
-                       if child isa MGroup then
-                               if child.mpackage.mgroups.first == child then child = child.mpackage
-                       end
-                       draw_edge(child, mentity)
-               end
-               for child in children do
-                       if child isa MGroup then
-                               if child.mpackage.mgroups.first == child then child = child.mpackage
-                       end
-                       draw_children(child, max_depth, current_depth + 1)
-               end
-       end
-
-       # Draw a node from a `mentity`
-       fun draw_node(mentity: MEntity): DotElement do
-               if nodes.has_key(mentity) then return nodes[mentity]
-               var node: DotElement = mentity.to_dot_node
-               if mentity == center then node = highlight(node)
-               nodes[mentity] = node
-               graph.add node
-               return node
-       end
-
-       private var edges = new HashMap2[MEntity, MEntity, DotEdge]
-
-       # Draw a edges between two mentities
-       fun draw_edge(from, to: MEntity): DotEdge do
-               if edges.has(from, to) then return edges[from, to].as(not null)
-               if edges.has(to, from) then return edges[to, from].as(not null)
-               var nfrom = draw_node(from)
-               var nto = draw_node(to)
-               var edge = new DotEdge(nfrom, nto)
-               edges[from, to] = edge
-               graph.add edge
-               return edge
-       end
-
-       private var to_dots = new HashMap[MEntity, DotElement]
-
-       # Create a link from `mentity` to a `...` node
-       fun to_dotdotdot(mentity: MEntity): DotEdge do
-               var nto = draw_node(mentity)
-               var dots = to_dots.get_or_null(mentity)
-               if dots == null then
-                       dots = dotdotdot("{nto.id}...")
-                       to_dots[mentity] = dots
-               end
-               graph.add dots
-               var edge = new DotEdge(dots, nto)
-               graph.add edge
-               return edge
-       end
-
-       private var from_dots = new HashMap[MEntity, DotElement]
-
-       # Create a link from a `...` node to a `mentity`
-       fun from_dotdotdot(mentity: MEntity): DotEdge do
-               var nfrom = draw_node(mentity)
-               var dots = to_dots.get_or_null(mentity)
-               if dots == null then
-                       dots = dotdotdot("...{nfrom.id}")
-                       from_dots[mentity] = dots
-               end
-               graph.add dots
-               var edge = new DotEdge(dots, nfrom)
-               graph.add edge
-               return edge
-       end
-
-       # Change the border color of the node
-       fun highlight(dot: DotElement): DotElement do
-               dot["color"] = "#1E9431"
-               return dot
-       end
-
-       # Generate a `...` node
-       fun dotdotdot(id: String): DotNode do
-               var node = new DotNode(id)
-               node["label"] = "..."
-               node["shape"] = "none"
-               return node
-       end
-end
-
-redef class MEntity
-       private fun to_dot_node: DotNode do
-               var node = new DotNode(full_name)
-               node["URL"] = web_url
-               node["label"] = name
-               return node
-       end
-end
-
-redef class MPackage
-       redef fun to_dot_node do
-               var node = super
-               node["shape"] = "tab"
-               return node
-       end
-end
-
-redef class MGroup
-       redef fun to_dot_node do
-               var node = super
-               node["shape"] = "folder"
-               return node
-       end
-end
-
-redef class MModule
-       redef fun to_dot_node do
-               var node = super
-               node["shape"] = "note"
-               return node
-       end
-end
-
-redef class MClass
-       redef fun to_dot_node do
-               var node = super
-               node["shape"] = "box"
-               return node
-       end
-end
diff --git a/src/web/api_model.nit b/src/web/api_model.nit
deleted file mode 100644 (file)
index 0de4806..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-module api_model
-
-import web_base
-import htmlight
-import uml
-import model::model_index
-
-redef class APIRouter
-       redef init do
-               super
-               use("/list", new APIList(config))
-               use("/search", new APISearch(config))
-               use("/random", new APIRandom(config))
-               use("/entity/:id", new APIEntity(config))
-               use("/entity/:id/doc", new APIEntityDoc(config))
-               use("/code/:id", new APIEntityCode(config))
-               use("/uml/:id", new APIEntityUML(config))
-               use("/linearization/:id", new APIEntityLinearization(config))
-               use("/defs/:id", new APIEntityDefs(config))
-               use("/inheritance/:id", new APIEntityInheritance(config))
-       end
-end
-
-# List all mentities.
-#
-# MEntities can be filtered on their kind using the `k` parameter.
-# Allowed kinds are `package`, `group`, `module`, `class`, `classdef`, `property`, `propdef`.
-#
-# List size can be limited with the `n` parameter.
-#
-# Example: `GET /list?k=module?n=10`
-class APIList
-       super APIHandler
-
-       # List mentities depending on the `k` kind parameter.
-       fun list_mentities(req: HttpRequest): Array[MEntity] do
-               var k = req.string_arg("k")
-               var mentities = new Array[MEntity]
-               if k == "package" then
-                       for mentity in config.view.mpackages do mentities.add mentity
-               else if k == "group" then
-                       for mentity in config.view.mgroups do mentities.add mentity
-               else if k == "module" then
-                       for mentity in config.view.mmodules do mentities.add mentity
-               else if k == "class" then
-                       for mentity in config.view.mclasses do mentities.add mentity
-               else if k == "classdef" then
-                       for mentity in config.view.mclassdefs do mentities.add mentity
-               else if k == "property" then
-                       for mentity in config.view.mproperties do mentities.add mentity
-               else if k == "propdef" then
-                       for mentity in config.view.mpropdefs do mentities.add mentity
-               else
-                       for mentity in config.view.mentities do mentities.add mentity
-               end
-               return mentities
-       end
-
-       # Filter mentities based on the config view filters
-       fun filter_mentities(req: HttpRequest, mentities: Array[MEntity]): Array[MEntity] do
-               var res = new Array[MEntity]
-               for mentity in mentities do
-                       if config.view.filter.accept_mentity(mentity) then res.add mentity
-               end
-               return res
-       end
-
-       # Sort mentities by lexicographic order
-       #
-       # TODO choose order from request
-       fun sort_mentities(req: HttpRequest, mentities: Array[MEntity]): Array[MEntity] do
-               var sorted = mentities.to_a
-               var sorter = new MEntityNameSorter
-               sorter.sort(sorted)
-               return sorted
-       end
-
-       # Limit mentities depending on the `n` parameter.
-       fun limit_mentities(req: HttpRequest, mentities: Array[MEntity]): Array[MEntity] do
-               var n = req.int_arg("n")
-               if n != null then
-                       return mentities.sub(0, n)
-               end
-               return mentities
-       end
-
-       redef fun get(req, res) do
-               var mentities = list_mentities(req)
-               mentities = sort_mentities(req, mentities)
-               mentities = limit_mentities(req, mentities)
-               res.json new JsonArray.from(mentities)
-       end
-end
-
-# Search mentities from a query string.
-#
-# Example: `GET /search?q=Arr`
-class APISearch
-       super APIList
-
-       redef fun get(req, res) do
-               var query = req.string_arg("q")
-               if query == null then
-                       res.api_error(400, "Missing search string")
-                       return
-               end
-               var page = req.int_arg("p")
-               var limit = req.int_arg("n")
-               var response = new JsonArray.from(search(query, limit))
-               res.json paginate(response, response.length, page, limit)
-       end
-
-       fun search(query: String, limit: nullable Int): Array[MEntity] do
-               return config.view.find(query)
-       end
-end
-
-# Return a random list of MEntities.
-#
-# Example: `GET /random?n=10&k=module`
-class APIRandom
-       super APIList
-
-       # Randomize mentities order.
-       fun randomize_mentities(req: HttpRequest, mentities: Array[MEntity]): Array[MEntity] do
-               var res = mentities.to_a
-               res.shuffle
-               return res
-       end
-
-       redef fun get(req, res) do
-               var mentities = list_mentities(req)
-               mentities = filter_mentities(req, mentities)
-               mentities = randomize_mentities(req, mentities)
-               mentities = limit_mentities(req, mentities)
-               res.json new JsonArray.from(mentities)
-       end
-end
-
-# Return the JSON representation of a MEntity.
-#
-# Example: `GET /entity/core::Array`
-class APIEntity
-       super APIHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               res.raw_json mentity.to_full_json(config.view.mainmodule)
-       end
-end
-
-# Return the full MDoc of a MEntity.
-#
-# Example: `GET /entity/core::Array/doc`
-class APIEntityDoc
-       super APIHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-
-               var obj = new JsonObject
-               var mdoc = mentity.mdoc_or_fallback
-               if mdoc != null then
-                       obj["documentation"] = mdoc.html_documentation.write_to_string
-                       obj["location"] = mdoc.location
-               end
-               res.json obj
-       end
-end
-
-# List ancestors, parents, child and descendants of MEntity
-#
-# Example: `GET /entity/core::Array/inheritance`
-class APIEntityInheritance
-       super APIHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               res.json mentity.hierarchy_poset(config.view)[mentity]
-       end
-end
-
-# Linearize super definitions of a MClassDef or a MPropDef if any.
-#
-# Example: `GET /entity/core::Array/linearization`
-class APIEntityLinearization
-       super APIHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               var lin = mentity.collect_linearization(config.mainmodule)
-               if lin == null then
-                       res.api_error(404, "No linearization for mentity `{mentity.full_name}`")
-                       return
-               end
-               var mentities = new JsonArray
-               for e in lin do mentities.add e
-               res.json mentities
-       end
-end
-
-# List definitions of a MEntity.
-#
-# Example: `GET /defs/core::Array`
-class APIEntityDefs
-       super APIList
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               var mentities = new Array[MEntity]
-               if mentity isa MPackage then
-                       mentities.add_all mentity.collect_mgroups(config.view)
-                       mentities.add_all mentity.collect_mmodules(config.view)
-               else if mentity isa MGroup then
-                       mentities.add_all mentity.collect_mgroups(config.view)
-                       mentities.add_all mentity.collect_mmodules(config.view)
-               else if mentity isa MModule then
-                       mentities.add_all mentity.collect_local_mclassdefs(config.view)
-               else if mentity isa MClass then
-                       mentities.add_all mentity.collect_mclassdefs(config.view)
-               else if mentity isa MClassDef then
-                       mentities.add_all mentity.collect_mpropdefs(config.view)
-               else if mentity isa MProperty then
-                       mentities.add_all mentity.collect_mpropdefs(config.view)
-               else
-                       res.api_error(404, "No definition list for mentity `{mentity.full_name}`")
-                       return
-               end
-               mentities = filter_mentities(req, mentities)
-               mentities = sort_mentities(req, mentities)
-               mentities = limit_mentities(req, mentities)
-               res.json new JsonArray.from(mentities)
-       end
-end
-
-abstract class SVGHandler
-       super APIHandler
-
-       # Render a `dot` string as a svg image.
-       fun render_dot(dot: Text): String do
-               var proc = new ProcessDuplex("dot", "-Tsvg")
-               var svg = proc.write_and_read(dot)
-               proc.close
-               proc.wait
-               return svg
-       end
-end
-
-# Return a UML representation of MEntity.
-#
-# Example: `GET /entity/core::Array/uml`
-class APIEntityUML
-       super SVGHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               var dot
-               if mentity isa MClassDef then mentity = mentity.mclass
-               if mentity isa MClass then
-                       var uml = new UMLModel(config.view, config.mainmodule)
-                       dot = uml.generate_class_uml.write_to_string
-               else if mentity isa MModule then
-                       var uml = new UMLModel(config.view, mentity)
-                       dot = uml.generate_package_uml.write_to_string
-               else
-                       res.api_error(404, "No UML for mentity `{mentity.full_name}`")
-                       return
-               end
-               res.send render_dot(dot)
-       end
-end
-
-# Return the source code of MEntity.
-#
-# Example: `GET /entity/core::Array/code`
-class APIEntityCode
-       super APIHandler
-
-       redef fun get(req, res) do
-               var mentity = mentity_from_uri(req, res)
-               if mentity == null then return
-               var source = render_source(mentity)
-               if source == null then
-                       res.api_error(404, "No code for mentity `{mentity.full_name}`")
-                       return
-               end
-               res.send source
-       end
-
-       # Highlight `mentity` source code.
-       private fun render_source(mentity: MEntity): nullable HTMLTag do
-               var node = config.modelbuilder.mentity2node(mentity)
-               if node == null then return null
-               var hl = new HtmlightVisitor
-               hl.highlight_node node
-               return hl.html
-       end
-end
diff --git a/src/web/web_base.nit b/src/web/web_base.nit
deleted file mode 100644 (file)
index 4aad814..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Base classes used by `nitweb`.
-module web_base
-
-import model::model_views
-import model::model_json
-import doc_down
-import popcorn
-import popcorn::pop_config
-import popcorn::pop_repos
-import popcorn::pop_json
-
-# Nitweb config file.
-class NitwebConfig
-       super AppConfig
-
-       redef fun default_db_name do return "nitweb"
-
-       # Model to use.
-       var model: Model
-
-       # MModule used to flatten model.
-       var mainmodule: MModule
-
-       # Modelbuilder used to access sources.
-       var modelbuilder: ModelBuilder
-
-       # ModelView used to access model.
-       var view: ModelView
-end
-
-# Specific handler for the nitweb API.
-abstract class APIHandler
-       super Handler
-
-       # App config.
-       var config: NitwebConfig
-
-       # Find the MEntity ` with `full_name`.
-       fun find_mentity(model: ModelView, full_name: nullable String): nullable MEntity do
-               if full_name == null then return null
-               var mentity = model.mentity_by_full_name(full_name.from_percent_encoding)
-               if mentity == null then return null
-               if config.view.accept_mentity(mentity) then return mentity
-               return null
-       end
-
-       # Try to load the mentity from uri with `/:id`.
-       #
-       # Send 400 if `:id` is null.
-       # Send 404 if no entity is found.
-       # Return null in both cases.
-       fun mentity_from_uri(req: HttpRequest, res: HttpResponse): nullable MEntity do
-               var id = req.param("id")
-               if id == null then
-                       res.api_error(400, "Expected mentity full name")
-                       return null
-               end
-               var mentity = find_mentity(config.view, id)
-               if mentity == null then
-                       res.api_error(404, "MEntity `{id}` not found")
-               end
-               return mentity
-       end
-
-       # Paginate a json array
-       #
-       # Returns only a subset of `results` depending on the current `page` and the
-       # number of elements to return set by `limit`.
-       #
-       # Transforms the json array into an object:
-       # ~~~json
-       # {
-       #       "page": 2,
-       #       "limit": 10,
-       #       "results: [ ... ],
-       #       "max": 5,
-       #       "total": 49
-       # }
-       # ~~~
-       fun paginate(results: JsonArray, count: Int, page, limit: nullable Int): JsonObject do
-               if page == null or page <= 0 then page = 1
-               if limit == null or limit <= 0 then limit = 20
-
-               var max = count / limit
-               if max == 0 then
-                       page = 1
-                       max = 1
-               else if page > max then
-                       page = max
-               end
-
-               var lstart = (page - 1) * limit
-               var lend = limit
-               if lstart + lend > count then lend = count - lstart
-
-               var res = new JsonObject
-               res["page"] = page
-               res["limit"] = limit
-               res["results"] = new JsonArray.from(results.subarray(lstart, lend))
-               res["max"] = max
-               res["total"] = count
-               return res
-       end
-end
-
-# A Rooter dedicated to APIHandlers.
-class APIRouter
-       super Router
-
-       # App config
-       var config: NitwebConfig
-end
-
-redef class HttpResponse
-
-       # Return an HTTP error response with `status`
-       #
-       # Like the rest of the API, errors are formated as JSON:
-       # ~~~json
-       # { "status": 404, "message": "Not found" }
-       # ~~~
-       fun api_error(status: Int, message: String) do
-               json(new APIError(status, message), status)
-       end
-
-       # Write data as JSON and set the right content type header.
-       fun raw_json(json: nullable String, status: nullable Int) do
-               header["Content-Type"] = media_types["json"].as(not null)
-               if json == null then
-                       send(null, status)
-               else
-                       send(json, status)
-               end
-       end
-end
-
-# An error returned by the API.
-#
-# Can be serialized to json.
-class APIError
-       serialize
-
-       # Reponse status
-       var status: Int
-
-       # Response error message
-       var message: String
-end
-
-# Fullname representation that can be used to build decorated links
-#
-# * MPackage: `mpackage_name`
-# * MGroup: `(mpackage_name::)mgroup_name`
-class Namespace
-       super Array[nullable NSEntity]
-       super NSEntity
-       serialize
-
-       redef fun to_s do return self.join("")
-       redef fun serialize_to(v) do to_a.serialize_to(v)
-end
-
-# Something that goes in a Namespace
-#
-# Can be either:
-# * a `NSToken` for tokens like `::`, `>` and `$`
-# * a `MSRef` for references to mentities
-interface NSEntity
-       super Serializable
-end
-
-# A reference to a MEntity that can be rendered as a link.
-#
-# We do not reuse `MEntityRef` ref since NSRef can be found in a ref and create
-# an infinite loop.
-class NSRef
-       super NSEntity
-       serialize
-
-       # The mentity to link to/
-       var mentity: MEntity
-
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("web_url", mentity.web_url)
-               v.serialize_attribute("api_url", mentity.api_url)
-               v.serialize_attribute("name", mentity.name)
-       end
-end
-
-# A namespace token representation
-#
-# Used for namespace tokens like `::`, `>` and `$`
-redef class String
-       super NSEntity
-end
-
-redef class MEntity
-
-       # URL to `self` within the web interface.
-       fun web_url: String do return "/doc/" / full_name
-
-       # URL to `self` within the JSON api.
-       fun api_url: String do return "/api/entity/" / full_name
-
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("namespace", namespace)
-               v.serialize_attribute("web_url", web_url)
-               v.serialize_attribute("api_url", api_url)
-       end
-
-       # Return `self.full_name` as an object that can be serialized to json.
-       fun namespace: nullable Namespace do return null
-
-       # Return a new NSRef to `self`.
-       fun to_ns_ref: NSRef do return new NSRef(self)
-end
-
-redef class MEntityRef
-       redef fun core_serialize_to(v) do
-               super
-               v.serialize_attribute("namespace", mentity.namespace)
-               v.serialize_attribute("web_url", mentity.web_url)
-               v.serialize_attribute("api_url", mentity.api_url)
-               v.serialize_attribute("name", mentity.name)
-               v.serialize_attribute("mdoc", mentity.mdoc_or_fallback)
-               v.serialize_attribute("visibility", mentity.visibility.to_s)
-               v.serialize_attribute("modifiers", mentity.collect_modifiers)
-               v.serialize_attribute("class_name", mentity.class_name)
-               var mentity = self.mentity
-               if mentity isa MMethod then
-                       v.serialize_attribute("msignature", mentity.intro.msignature)
-               else if mentity isa MMethodDef then
-                       v.serialize_attribute("msignature", mentity.msignature)
-               else if mentity isa MVirtualTypeProp then
-                       v.serialize_attribute("bound", to_mentity_ref(mentity.intro.bound))
-               else if mentity isa MVirtualTypeDef then
-                       v.serialize_attribute("bound", to_mentity_ref(mentity.bound))
-               end
-               v.serialize_attribute("location", mentity.location)
-       end
-end
-
-redef class MDoc
-
-       # Add doc down processing
-       redef fun core_serialize_to(v) do
-               v.serialize_attribute("html_synopsis", html_synopsis.write_to_string)
-       end
-end
-
-redef class MPackage
-       redef fun namespace do return new Namespace.from([to_ns_ref])
-end
-
-redef class MGroup
-       redef fun namespace do
-               var p = parent
-               if p == null then
-                       return new Namespace.from([to_ns_ref, ">": nullable NSEntity])
-               end
-               return new Namespace.from([p.namespace, to_ns_ref, ">": nullable NSEntity])
-       end
-end
-
-redef class MModule
-       redef fun namespace do
-               var mgroup = self.mgroup
-               if mgroup == null then
-                       return new Namespace.from([to_ns_ref])
-               end
-               return new Namespace.from([mgroup.mpackage.to_ns_ref, "::", to_ns_ref: nullable NSEntity])
-       end
-
-       private fun ns_for(visibility: MVisibility): nullable Namespace do
-               if visibility <= private_visibility then return namespace
-               var mgroup = self.mgroup
-               if mgroup == null then return namespace
-               return mgroup.mpackage.namespace
-       end
-end
-
-redef class MClass
-       redef fun namespace do
-               return new Namespace.from([intro_mmodule.ns_for(visibility), "::", to_ns_ref: nullable NSEntity])
-       end
-end
-
-redef class MClassDef
-       redef fun namespace do
-               if is_intro then
-                       return new Namespace.from([mmodule.ns_for(mclass.visibility), "$", to_ns_ref: nullable NSEntity])
-               else if mclass.intro_mmodule.mpackage != mmodule.mpackage then
-                       return new Namespace.from([mmodule.namespace, "$", mclass.namespace: nullable NSEntity])
-               else if mclass.visibility > private_visibility then
-                       return new Namespace.from([mmodule.namespace, "$", mclass.to_ns_ref: nullable NSEntity])
-               end
-               return new Namespace.from([mmodule.full_name, "$::", mclass.intro_mmodule.to_ns_ref: nullable NSEntity])
-       end
-
-       redef fun web_url do return "{mclass.web_url}/lin#{full_name}"
-end
-
-redef class MProperty
-       redef fun namespace do
-               if intro_mclassdef.is_intro then
-                       return new Namespace.from([intro_mclassdef.mmodule.ns_for(visibility), "::", intro_mclassdef.mclass.to_ns_ref, "::", to_ns_ref: nullable NSEntity])
-               else
-                       return new Namespace.from([intro_mclassdef.mmodule.namespace, "::", intro_mclassdef.mclass.to_ns_ref, "::", to_ns_ref: nullable NSEntity])
-               end
-       end
-end
-
-redef class MPropDef
-       redef fun namespace do
-               var res = new Namespace
-               res.add mclassdef.namespace
-               res.add "$"
-
-               if mclassdef.mclass == mproperty.intro_mclassdef.mclass then
-                       res.add to_ns_ref
-               else
-                       if mclassdef.mmodule.mpackage != mproperty.intro_mclassdef.mmodule.mpackage then
-                               res.add mproperty.intro_mclassdef.mmodule.ns_for(mproperty.visibility)
-                               res.add "::"
-                       else if mproperty.visibility <= private_visibility then
-                               if mclassdef.mmodule.namespace_for(mclassdef.mclass.visibility) != mproperty.intro_mclassdef.mmodule.mpackage then
-                                       res.add "::"
-                                       res.add mproperty.intro_mclassdef.mmodule.to_ns_ref
-                                       res.add "::"
-                               end
-                       end
-                       if mclassdef.mclass != mproperty.intro_mclassdef.mclass then
-                               res.add mproperty.intro_mclassdef.to_ns_ref
-                               res.add "::"
-                       end
-                       res.add to_ns_ref
-               end
-               return res
-       end
-
-       redef fun web_url do return "{mproperty.web_url}/lin#{full_name}"
-end
-
-redef class MClassType
-       redef var web_url = mclass.web_url is lazy
-end
-
-redef class MNullableType
-       redef var web_url = mtype.web_url is lazy
-end
-
-redef class MParameterType
-       redef var web_url = mclass.web_url is lazy
-end
-
-redef class MVirtualType
-       redef var web_url = mproperty.web_url is lazy
-end
-
-redef class POSetElement[E]
-       super Serializable
-
-       redef fun core_serialize_to(v) do
-               assert self isa POSetElement[MEntity]
-               v.serialize_attribute("direct_greaters", to_mentity_refs(direct_greaters))
-               v.serialize_attribute("direct_smallers", to_mentity_refs(direct_smallers))
-       end
-end
index 79da3ab..3bc599d 100644 (file)
@@ -1,3 +1,3 @@
-base_simple3.nit -c A
-base_simple3.nit -c foo
-base_simple3.nit -c base_simple3
+base_simple3.nit -c A --no-color
+base_simple3.nit -c foo --no-color
+base_simple3.nit -c "defs: base_simple3::base_simple3" --no-color
index ec462a0..4a0ef7e 100644 (file)
@@ -1,3 +1,3 @@
 Usage: nitx [OPTION]... <file.nit>... [query]
-Displays specific pieces of API information from Nit source files.
+Displays pieces of API information from Nit source files.
 Use --help for help
index d9ab058..040663e 100644 (file)
@@ -1,9 +1,9 @@
 
-\e[1m\e[34m# \e[m\e[m\e[1m\e[34mA\e[m\e[m
-\e[1m\e[30mclass A\e[m\e[m
-
-    \e[1m\e[32mclass A\e[m\e[m
-    \e[1m\e[30mbase_simple3.nit:29,1--32,3\e[m\e[m
+Warning: No documentation for `base_simple3::A`.
 
+Documentation for `base_simple3::A`:
 
+ + base_simple3::A
+   class A
+   base_simple3.nit:29,1--32,3
 
index 3f6b1f1..48c2f5f 100644 (file)
@@ -1,9 +1,9 @@
 
-\e[1m\e[34m# \e[m\e[m\e[1m\e[34mfoo\e[m\e[m
-\e[1m\e[30mfun foo\e[m\e[m
-
-    \e[1m\e[32mfun foo\e[m\e[m
-    \e[1m\e[30mbase_simple3.nit:49,1--19\e[m\e[m
+Warning: No documentation for `base_simple3::Sys::foo`.
 
+Documentation for `base_simple3::Sys::foo`:
 
+ + base_simple3::Sys::foo
+   fun foo
+   base_simple3.nit:49,1--19
 
index 9d71d91..e191640 100644 (file)
@@ -1,9 +1,31 @@
 
-\e[1m\e[34m# \e[m\e[m\e[1m\e[34mbase_simple3\e[m\e[m
-\e[1m\e[30mpackage base_simple3\e[m\e[m
+Features for `base_simple3::base_simple3`:
 
-    \e[1m\e[32mpackage base_simple3\e[m\e[m
-    \e[1m\e[30mbase_simple3.nit:17,1--66,13\e[m\e[m
+ + base_simple3$A
+   class A
+   base_simple3.nit:29,1--32,3
 
+ + base_simple3$B
+   class B
+   base_simple3.nit:34,1--42,3
 
+ + base_simple3$Bool
+   enum Bool
+   base_simple3.nit:22,1--23,3
+
+ + base_simple3$C
+   class C
+   base_simple3.nit:44,1--47,3
+
+ + base_simple3$Int
+   enum Int
+   base_simple3.nit:25,1--27,3
+
+ + base_simple3$Object
+   interface Object
+   base_simple3.nit:19,1--20,3
+
+ + base_simple3$Sys
+   class Sys
+   base_simple3.nit:49,1--19