Merge: Kill oldstyle attributes
authorJean Privat <jean@pryen.org>
Thu, 4 Sep 2014 00:20:40 +0000 (20:20 -0400)
committerJean Privat <jean@pryen.org>
Thu, 4 Sep 2014 00:20:40 +0000 (20:20 -0400)
Remove remaining usage of old style attributes declarations `var _foo`.

Also remove the annotation `old_style_init` in the parser.

Pull-Request: #712
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

74 files changed:
contrib/online_ide/sources/nit/pnacl_nit.nit
src/annotation.nit
src/astbuilder.nit
src/astprinter.nit
src/astvalidation.nit
src/common_ffi/common_ffi.nit
src/common_ffi/pkgconfig.nit
src/compiler/abstract_compiler.nit [moved from src/abstract_compiler.nit with 99% similarity]
src/compiler/android_annotations.nit [moved from src/android_annotations.nit with 98% similarity]
src/compiler/android_platform.nit [moved from src/android_platform.nit with 99% similarity]
src/compiler/coloring.nit [moved from src/coloring.nit with 99% similarity]
src/compiler/compiler.nit [new file with mode: 0644]
src/compiler/compiler_ffi.nit [moved from src/compiler_ffi.nit with 99% similarity]
src/compiler/emscripten_platform.nit [moved from src/emscripten_platform.nit with 100% similarity]
src/compiler/global_compiler.nit [moved from src/global_compiler.nit with 100% similarity]
src/compiler/pnacl_platform.nit [moved from src/pnacl_platform.nit with 100% similarity]
src/compiler/separate_compiler.nit [moved from src/separate_compiler.nit with 100% similarity]
src/compiler/separate_erasure_compiler.nit [moved from src/separate_erasure_compiler.nit with 100% similarity]
src/frontend/cached.nit [moved from src/cached.nit with 99% similarity]
src/frontend/check_annotation.nit [moved from src/check_annotation.nit with 99% similarity]
src/frontend/div_by_zero.nit [moved from src/div_by_zero.nit with 97% similarity]
src/frontend/frontend.nit [moved from src/frontend.nit with 93% similarity]
src/frontend/serialization_phase.nit [moved from src/serialization_phase.nit with 98% similarity]
src/frontend/simple_misc_analysis.nit [moved from src/simple_misc_analysis.nit with 99% similarity]
src/highlight.nit
src/interpreter/breakpoint.nit [moved from src/breakpoint.nit with 100% similarity]
src/interpreter/debugger.nit [moved from src/debugger.nit with 99% similarity]
src/interpreter/debugger_socket.nit [moved from src/debugger_socket.nit with 100% similarity]
src/interpreter/interpreter.nit [new file with mode: 0644]
src/interpreter/naive_interpreter.nit [moved from src/naive_interpreter.nit with 99% similarity]
src/literal.nit
src/markdown.nit
src/metrics/ast_metrics.nit
src/metrics/generate_hierarchies.nit
src/metrics/inheritance_metrics.nit
src/metrics/mclasses_metrics.nit
src/metrics/mendel_metrics.nit
src/metrics/mmodules_metrics.nit
src/metrics/model_hyperdoc.nit
src/metrics/nullables_metrics.nit
src/metrics/poset_metrics.nit
src/metrics/refinement_metrics.nit
src/metrics/rta_metrics.nit
src/metrics/self_metrics.nit
src/metrics/static_types_metrics.nit
src/metrics/tables_metrics.nit
src/model/model.nit
src/model/model_viz.nit [moved from src/model_viz.nit with 100% similarity]
src/modelbuilder.nit
src/modelize/modelize.nit [new file with mode: 0644]
src/modelize/modelize_class.nit [moved from src/modelize_class.nit with 100% similarity]
src/modelize/modelize_property.nit [moved from src/modelize_property.nit with 99% similarity]
src/nit.nit
src/nitg.nit
src/nith.nit
src/nitvm.nit
src/nitx.nit
src/platform.nit
src/rapid_type_analysis.nit
src/semantize/auto_super_init.nit [moved from src/auto_super_init.nit with 99% similarity]
src/semantize/flow.nit [moved from src/flow.nit with 99% similarity]
src/semantize/local_var_init.nit [moved from src/local_var_init.nit with 99% similarity]
src/semantize/scope.nit [moved from src/scope.nit with 99% similarity]
src/semantize/semantize.nit [new file with mode: 0644]
src/semantize/typing.nit [moved from src/typing.nit with 99% similarity]
src/test_markdown.nit
src/testing/testing_base.nit
src/testing/testing_suite.nit
src/transform.nit
src/vm.nit
tests/sav/niti/error_annot_pkgconfig_alt1.res [new file with mode: 0644]
tests/sav/niti/error_annot_pkgconfig_alt2.res [new file with mode: 0644]
tests/sav/niti/error_annot_pkgconfig_alt3.res [new file with mode: 0644]
tests/sav/nitmetrics_args1.res

index 07db5ed..f4a02f2 100644 (file)
@@ -17,8 +17,8 @@
 # A version of the naive Nit interpreter for PNaCl.
 module pnacl_nit
 
-import naive_interpreter
-import debugger
+import interpreter::naive_interpreter
+import interpreter::debugger
 import pnacl
 intrude import toolcontext
 intrude import modelbuilder
index 8d9ca25..6641280 100644 (file)
@@ -15,9 +15,8 @@
 # Management and utilities on annotations
 module annotation
 
-import parser
 import modelbuilder
-import literal
+private import literal
 import model::mmodule_data
 
 redef class Prod
index 3b5aceb..8e17b4e 100644 (file)
 # Instantiation and transformation of semantic nodes in the AST of expressions and statements
 module astbuilder
 
-intrude import typing
-intrude import literal
-intrude import parser
-intrude import scope
+intrude import semantize::typing
+intrude import semantize::literal
+intrude import semantize::parser
+intrude import semantize::scope
 
 # General factory to build semantic nodes in the AST of expressions
 class ASTBuilder
index 97ff1fd..e0aceee 100644 (file)
 # print AST in an human form
 module astprinter
 
-import typing
-import phase
+import semantize
 intrude import parser
-import literal
+private import literal
 
 private class ASTPrinterVisitor
        super Visitor
index a3c4bbc..b78632b 100644 (file)
@@ -15,7 +15,6 @@
 # Check the consitency of AST
 module astvalidation
 
-private import typing
 intrude import parser
 import astbuilder
 
index 302c472..cb9c244 100644 (file)
@@ -19,7 +19,6 @@
 # to wrap foreign code in Nit methods.
 module common_ffi
 
-import parser
 import modelbuilder
 
 import nitni
index 5306b97..aa9add3 100644 (file)
@@ -20,6 +20,7 @@ module pkgconfig
 
 import c
 private import annotation
+private import literal
 
 redef class ToolContext
        var pkgconfig_phase: Phase = new PkgconfigPhase(self, [literal_phase])
similarity index 99%
rename from src/abstract_compiler.nit
rename to src/compiler/abstract_compiler.nit
index 9d441cc..c1d1120 100644 (file)
@@ -18,8 +18,7 @@
 module abstract_compiler
 
 import literal
-import typing
-import auto_super_init
+import semantize
 import platform
 import c_tools
 
@@ -395,7 +394,7 @@ class MakefileToolchain
                        if f.compiles_to_o_file then ofiles.add(o)
                        if f.add_to_jar then java_files.add(f)
                end
-               
+
                if not java_files.is_empty then
                        var jar_file = "{outpath}.jar"
 
@@ -643,10 +642,12 @@ extern void nitni_global_ref_decr( struct nitni_ref *ref );
        end
 
        # Generate the main C function.
+       #
        # This function:
-       #       * allocate the Sys object if it exists
-       #       * call init if is exists
-       #       * call main if it exists
+       #
+       # * allocate the Sys object if it exists
+       # * call init if is exists
+       # * call main if it exists
        fun compile_main_function
        do
                var v = self.new_visitor
@@ -930,12 +931,13 @@ extern void nitni_global_ref_decr( struct nitni_ref *ref ) {
        end
 
        # Display stats about compilation process
+       #
        # Metrics used:
-       #       * type tests against resolved types (`x isa Collection[Animal]`)
-       #       * type tests against unresolved types (`x isa Collection[E]`)
-       #       * type tests skipped
-       #       * type tests total
-       #       *
+       #
+       # * type tests against resolved types (`x isa Collection[Animal]`)
+       # * type tests against unresolved types (`x isa Collection[E]`)
+       # * type tests skipped
+       # * type tests total
        fun display_stats
        do
                if self.modelbuilder.toolcontext.opt_typing_test_metrics.value then
@@ -1251,7 +1253,7 @@ abstract class AbstractCompilerVisitor
        private var escapemark_names = new HashMap[EscapeMark, String]
 
        # Return a "const char*" variable associated to the classname of the dynamic type of an object
-       # NOTE: we do not return a `RuntimeVariable` "NativeString" as the class may not exist in the module/program
+       # NOTE: we do not return a `RuntimeVariable` "NativeString" as the class may not exist in the module/program
        fun class_name_string(value: RuntimeVariable): String is abstract
 
        # Variables handling
@@ -1312,7 +1314,7 @@ abstract class AbstractCompilerVisitor
                var mtype = recv.mtype
                var finalizable_type = compiler.mainmodule.finalizable_type
                if finalizable_type != null and not mtype.need_anchor and
-                  mtype.is_subtype(compiler.mainmodule, null, finalizable_type) then
+                               mtype.is_subtype(compiler.mainmodule, null, finalizable_type) then
                        add "gc_register_finalizer({recv});"
                end
        end
@@ -3019,4 +3021,3 @@ for mmodule in mmodules do
        end
        toolcontext.run_global_phases(ms)
 end
-
similarity index 98%
rename from src/android_annotations.nit
rename to src/compiler/android_annotations.nit
index ec0d2dc..a6fc4e2 100644 (file)
 # by calling `ModelBuilder::android_project_for`.
 module android_annotations
 
-import parser_util
-import modelbuilder
-import modelize_property
+private import parser_util
+import modelize
 import literal
-import typing
+import semantize
 private import annotation
 
 # Metadata associated to an Android project
@@ -137,7 +136,7 @@ redef class AAnnotation
                else
                        for arg in args do
                                var format_error = "Annotation error: \"{name}\" expects its arguments to be of type Int or a call to `git_revision`"
-                               
+
                                var value
                                value = arg.as_int
                                if value != null then
similarity index 99%
rename from src/android_platform.nit
rename to src/compiler/android_platform.nit
index 8532cf8..c06a374 100644 (file)
@@ -1,3 +1,4 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
 #
 # Copyright 2014 Alexis Laferrière <alexis.laf@xymus.net>
 #
similarity index 99%
rename from src/coloring.nit
rename to src/compiler/coloring.nit
index aa65f32..ed9b466 100644 (file)
@@ -386,5 +386,3 @@ class POSetBucketsColorer[H: Object, E: Object]
                return true
        end
 end
-
-
diff --git a/src/compiler/compiler.nit b/src/compiler/compiler.nit
new file mode 100644 (file)
index 0000000..902a656
--- /dev/null
@@ -0,0 +1,24 @@
+# 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.
+
+# Compilation to C
+module compiler
+
+import separate_erasure_compiler
+import global_compiler
+import compiler_ffi
+
+import android_platform
+import pnacl_platform
+import emscripten_platform
similarity index 99%
rename from src/compiler_ffi.nit
rename to src/compiler/compiler_ffi.nit
index 9a83ba4..f3ac581 100644 (file)
@@ -342,7 +342,7 @@ redef class MNullableType
                var base_cname = "null_{mtype.mangled_cname}"
                var full_cname = "NIT_NULL___{base_cname}"
 
-               # In nitni files, declare internal function as extern 
+               # In nitni files, declare internal function as extern
                var full_friendly_csignature = "{cname_blind} {full_cname}()"
                ccu.header_decl.add("extern {full_friendly_csignature};\n")
 
@@ -374,7 +374,7 @@ redef class MExplicitCall
                var mproperty = mproperty
                assert mproperty isa MMethod
 
-               # In nitni files, declare internal function as extern 
+               # In nitni files, declare internal function as extern
                var full_friendly_csignature = mproperty.build_csignature(recv_mtype, v.compiler.mainmodule, null, long_signature, internal_call_context)
                ccu.header_decl.add("extern {full_friendly_csignature};\n")
 
@@ -489,7 +489,7 @@ redef class MExplicitCast
                ## check type
                #
 
-               # In nitni files, declare internal function as extern 
+               # In nitni files, declare internal function as extern
                var full_friendly_csignature = "int {v.compiler.mainmodule.name }___{from.mangled_cname}_is_a_{to.mangled_cname}({from.cname_blind})"
                ccu.header_decl.add("extern {full_friendly_csignature};\n")
 
similarity index 99%
rename from src/cached.nit
rename to src/frontend/cached.nit
index ead285f..830ff66 100644 (file)
@@ -18,8 +18,8 @@
 # complex annotation that modify both the model and the AST of a Nit program
 module cached
 
-import modelize_property
-import parser_util
+import modelize
+private import parser_util
 import simple_misc_analysis
 private import annotation
 
similarity index 99%
rename from src/check_annotation.nit
rename to src/frontend/check_annotation.nit
index f91dc55..367ba4d 100644 (file)
@@ -19,7 +19,7 @@
 module check_annotation
 
 import phase
-import annotation
+private import annotation
 
 redef class ToolContext
        var check_annotation_phase: Phase = new CheckAnnotationPhase(self, null)
similarity index 97%
rename from src/div_by_zero.nit
rename to src/frontend/div_by_zero.nit
index 6debbd0..5833009 100644 (file)
@@ -16,9 +16,8 @@
 # This module is only an example of how to implements a simple phase in the nit tools
 module div_by_zero
 
-import phase
 import literal # Because we need the real value of literal in the AST
-import typing # Because we need the static type of receivers
+import semantize # Because we need the static type of receivers
 
 # Note, `ToolContext` is the main overlord class
 # Among its jobs, it orchestrates and executes the various phases
similarity index 93%
rename from src/frontend.nit
rename to src/frontend/frontend.nit
index 9b6e84b..cfdf85b 100644 (file)
 # Collect and orchestration of main frontend phases
 module frontend
 
-import phase
 import simple_misc_analysis
 import literal
-import scope
-import flow
-import local_var_init
-import typing
-import auto_super_init
+import modelize
+import semantize
 import div_by_zero
 import cached
 import serialization_phase
similarity index 98%
rename from src/serialization_phase.nit
rename to src/frontend/serialization_phase.nit
index ec472c2..25574e7 100644 (file)
 # Phase generating methods to serialize Nit objects to different formats
 module serialization_phase
 
-import phase
-import parser_util
-import modelize_property
-intrude import modelize_class
+private import parser_util
+import modelize
+private import annotation
 
 redef class ToolContext
        var serialization_phase_pre_model: Phase = new SerializationPhasePreModel(self, null)
similarity index 99%
rename from src/simple_misc_analysis.nit
rename to src/frontend/simple_misc_analysis.nit
index 35fa66c..26d6710 100644 (file)
@@ -21,8 +21,6 @@
 #  * use of "while true" instead of "loop"
 module simple_misc_analysis
 
-import toolcontext
-import parser
 import phase
 
 redef class ToolContext
index bfa0d0f..a93fec9 100644 (file)
@@ -15,7 +15,6 @@
 # Highliting of Nit AST
 module highlight
 
-import modelize_property
 import frontend
 import html
 import pipeline
similarity index 99%
rename from src/debugger.nit
rename to src/interpreter/debugger.nit
index 24df936..52444f7 100644 (file)
@@ -20,9 +20,10 @@ module debugger
 import breakpoint
 intrude import naive_interpreter
 import nitx
-intrude import local_var_init
-intrude import scope
+intrude import semantize::local_var_init
+intrude import semantize::scope
 intrude import toolcontext
+private import parser_util
 
 redef class Model
        # Cleans the model to remove a module and what it defines when semantic analysis fails on injected code
diff --git a/src/interpreter/interpreter.nit b/src/interpreter/interpreter.nit
new file mode 100644 (file)
index 0000000..2063760
--- /dev/null
@@ -0,0 +1,20 @@
+# 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.
+
+# Interpretation of Nit programs
+module interpreter
+
+import naive_interpreter
+import debugger
+import debugger_socket
similarity index 99%
rename from src/naive_interpreter.nit
rename to src/interpreter/naive_interpreter.nit
index c741f04..cd264f1 100644 (file)
 module naive_interpreter
 
 import literal
-import typing
-import auto_super_init
-import frontend
-import common_ffi
+import semantize
 private import parser::tables
 
 redef class ToolContext
index 0395299..ef4851b 100644 (file)
@@ -17,8 +17,6 @@
 # Parsing of literal values in the abstract syntax tree.
 module literal
 
-import parser
-import toolcontext
 import phase
 
 redef class ToolContext
index 90cb227..01a054c 100644 (file)
@@ -18,6 +18,7 @@ module markdown
 private import parser
 import html
 private import highlight
+private import parser_util
 
 # The class that does the convertion from a `ADoc` to HTML
 private class Doc2Mdwn
index c1442c0..d34899e 100644 (file)
@@ -16,9 +16,7 @@
 
 # Metrics about the nodes and identifiers in the AST
 module ast_metrics
-import modelbuilder
-private import metrics_base
-import frontend
+import metrics_base
 
 redef class ToolContext
        var ast_metrics_phase: Phase = new AstMetricsPhase(self, null)
index 455ed83..e902b05 100644 (file)
 # See graphviz http://www.graphviz.org/
 module generate_hierarchies
 
-import model
-private import metrics_base
-import frontend
-import model_viz
+import metrics_base
+import model::model_viz
 
 redef class ToolContext
        var generate_hierarchies_phase: Phase = new GenerateHierarchyPhase(self, null)
index 00d03f2..d475562 100644 (file)
 # Collect metrics about inheritance usage
 module inheritance_metrics
 
-import model
+import metrics_base
 import mmodules_metrics
 import mclasses_metrics
-import phase
-import frontend
 
 redef class ToolContext
        var inheritance_metrics_phase: Phase = new InheritanceMetricsPhase(self, null)
index ffdf69c..fabd573 100644 (file)
 # Collect common metrics about mclasses
 module mclasses_metrics
 
-import model
 import metrics_base
-import phase
-import frontend
 
 redef class ToolContext
        var mclasses_metrics_phase: Phase = new MClassesMetricsPhase(self, null)
index 65e104f..6c63925 100644 (file)
 #  in Proceedings of the 16th IEEE International Conference on Program Comprehension (OCPC'08)
 module mendel_metrics
 
-import model
 import metrics_base
 import mclasses_metrics
-import phase
-import frontend
+import modelize
 
 redef class ToolContext
        var mendel_metrics_phase: Phase = new MendelMetricsPhase(self, null)
index ca87fdf..a7ac696 100644 (file)
 # Collect common metrics about modules
 module mmodules_metrics
 
-import model
 import metrics_base
-import phase
-import frontend
 
 redef class ToolContext
        var mmodules_metrics_phase: Phase = new MModulesMetricsPhase(self, null)
index dbc7f45..43384d9 100644 (file)
 # Dump of Nit model into hypertext human-readable format.
 module model_hyperdoc
 
-import model
 import metrics_base
-import phase
-import frontend
 
 redef class ToolContext
        var model_hyperdoc_phase: Phase = new ModelHyperdocPhase(self, null)
index 895f7d5..7f1b898 100644 (file)
 # Statistics about the usage of nullables
 module nullables_metrics
 
-import modelbuilder
-private import typing
-import model_utils
+import metrics_base
 import mclasses_metrics
-import frontend
+import semantize
 
 redef class ToolContext
        var nullables_metrics_phase: Phase = new NullablesMetricsPhase(self, null)
index 5ff2a6f..1fc8be5 100644 (file)
@@ -15,9 +15,7 @@
 # Metrics about the various posets of the model of a Nit program
 module poset_metrics
 
-import poset
 import metrics_base
-import frontend
 
 redef class ToolContext
        var poset_metrics_phase: Phase = new PosetMetricsPhase(self, null)
index 2c9ac5a..7ba18e8 100644 (file)
@@ -18,8 +18,7 @@
 module refinement_metrics
 
 import model
-private import metrics_base
-import frontend
+import metrics_base
 
 redef class ToolContext
        var refinement_metrics_phase: Phase = new RefinementMetricsPhase(self, null)
index 1224513..1527731 100644 (file)
 # Metrics from RTA
 module rta_metrics
 
-import modelbuilder
 private import rapid_type_analysis
-private import metrics_base
+import metrics_base
 import mmodules_metrics
 import mclasses_metrics
-import frontend
 
 redef class ToolContext
        var rta_metrics_phase: Phase = new RTAMetricsPhase(self, null)
index 12b2f64..ba7ea78 100644 (file)
@@ -16,9 +16,8 @@
 
 # Metrics about the usage of explicit and implicit self
 module self_metrics
-import modelbuilder
-private import metrics_base
-import frontend
+
+import metrics_base
 
 redef class ToolContext
        var self_metrics_phase: Phase = new SelfMetricsPhase(self, null)
index 888c8e2..aa4f1ef 100644 (file)
 # Metrics on the usage of explicit static types.
 module static_types_metrics
 
-private import metrics_base
-import modelbuilder
-import modelize_class
-import frontend
+import metrics_base
+import modelize
 
 redef class ToolContext
        var static_types_metrics_phase: Phase = new StaticTypesMetricsPhase(self, null)
index 42dae2a..664415a 100644 (file)
@@ -17,9 +17,7 @@
 # Metrics on table generation
 module tables_metrics
 
-import model
-private import metrics_base
-import frontend
+import metrics_base
 
 redef class ToolContext
        var tables_metrics_phase: Phase = new TablesMetricsPhase(self, null)
index f3c3164..d4d2c1c 100644 (file)
@@ -25,8 +25,6 @@
 # FIXME: better handling of the types
 module model
 
-import poset
-import location
 import mmodule
 import mdoc
 import ordered_tree
similarity index 100%
rename from src/model_viz.nit
rename to src/model/model_viz.nit
index cebbe1b..eac98df 100644 (file)
 # FIXME add missing error checks
 module modelbuilder
 
-import parser
 import model
-import poset
-import opts
-import toolcontext
 import phase
 
 private import more_collections
diff --git a/src/modelize/modelize.nit b/src/modelize/modelize.nit
new file mode 100644 (file)
index 0000000..c0ed4c9
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+# Create a model from nit source files
+module modelize
+
+import modelize_property
similarity index 99%
rename from src/modelize_property.nit
rename to src/modelize/modelize_property.nit
index 146125b..57e847b 100644 (file)
@@ -18,7 +18,7 @@
 module modelize_property
 
 import modelize_class
-import annotation
+private import annotation
 
 redef class ToolContext
        var modelize_property_phase: Phase = new ModelizePropertyPhase(self, [modelize_class_phase])
index 2481ce8..6e24920 100644 (file)
@@ -17,9 +17,8 @@
 # A naive Nit interpreter
 module nit
 
-import naive_interpreter
-import debugger
-import debugger_socket
+import interpreter
+import frontend
 
 # Create a tool context to handle options and paths
 var toolcontext = new ToolContext
index 66cd891..69b99f0 100644 (file)
 # A global Nit compiler
 module nitg
 
-import modelbuilder
 import frontend
+import compiler
 import transform
-import rapid_type_analysis
-import global_compiler
-import separate_erasure_compiler
-import separate_compiler
-import android_platform
-import compiler_ffi
-import pnacl_platform
-import emscripten_platform
 
 redef class ToolContext
        redef fun process_options(args)
index 6fb477d..bf12e9d 100644 (file)
 # A ligHt Nit compiler
 module nith
 
-import phase
-import literal
-import scope
-import flow
-import local_var_init
-import typing
-import auto_super_init
-import modelbuilder
-import rapid_type_analysis
-import separate_erasure_compiler
+import modelize
 import transform
 
+import rapid_type_analysis
+import compiler::separate_erasure_compiler
+
 redef class ToolContext
        redef fun process_options(args)
        do
index c0887db..fe12c15 100644 (file)
@@ -18,6 +18,7 @@
 module nitvm
 
 import vm
+import frontend
 
 # Create a tool context to handle options and paths
 var toolcontext = new ToolContext
index 29be82b..218f47b 100644 (file)
@@ -16,7 +16,7 @@
 module nitx
 
 import model_utils
-import modelize_property
+import modelize
 
 # Main class of the nit index tool
 # NitIndex build the model using the toolcontext argument
index 9e3e92e..80aab8b 100644 (file)
@@ -16,9 +16,8 @@
 # to the target platform. Also detects conflicts between targetted platforms.
 module platform
 
-import modelize_property
-import parser_util
-import modelbuilder
+import modelize
+private import parser_util
 private import annotation
 
 redef class ToolContext
index 6518860..ea0dcaf 100644 (file)
 # It is quite efficient but the type set is global and pollutes each call site.
 module rapid_type_analysis
 
-import model
-import modelbuilder
-import typing
-import auto_super_init
+import semantize
 
-import csv # for live_types_to_csv
-import ordered_tree # for live_methods_to_tree
+private import csv # for live_types_to_csv
+private import ordered_tree # for live_methods_to_tree
 
 private import more_collections
 
similarity index 99%
rename from src/auto_super_init.nit
rename to src/semantize/auto_super_init.nit
index 8891df3..19d60f5 100644 (file)
@@ -19,8 +19,7 @@
 module auto_super_init
 
 import typing
-import modelbuilder
-import phase
+private import annotation
 
 redef class ToolContext
        var auto_super_init_phase: Phase = new AutoSuperInitPhase(self, [typing_phase])
similarity index 99%
rename from src/flow.nit
rename to src/semantize/flow.nit
index bbee8bb..4717d9b 100644 (file)
 # Intraprocedural static flow.
 module flow
 
-import parser
-import toolcontext
 import scope
-import phase
 
 redef class ToolContext
        var flow_phase: Phase = new FlowPhase(self, [scope_phase])
similarity index 99%
rename from src/local_var_init.nit
rename to src/semantize/local_var_init.nit
index 4ed1ff8..4b9a4ab 100644 (file)
@@ -18,9 +18,7 @@
 # Require that the scope and the flow analaysis are already performed
 module local_var_init
 
-import scope
 import flow
-import phase
 
 redef class ToolContext
        var local_var_init_phase: Phase = new LocalVarInitPhase(self, [flow_phase])
similarity index 99%
rename from src/scope.nit
rename to src/semantize/scope.nit
index 2d2c00a..83c5fe4 100644 (file)
@@ -17,8 +17,6 @@
 # Identification and scping of local variables and labels.
 module scope
 
-import parser
-import toolcontext
 import phase
 
 redef class ToolContext
diff --git a/src/semantize/semantize.nit b/src/semantize/semantize.nit
new file mode 100644 (file)
index 0000000..cf01ce9
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+# Process bodies of methods in regard with the model.
+module semantize
+
+import auto_super_init
similarity index 99%
rename from src/typing.nit
rename to src/semantize/typing.nit
index a415667..462fe04 100644 (file)
@@ -18,9 +18,7 @@
 # By OO-services we mean message sending, attribute access, instantiation, etc.
 module typing
 
-import flow
-import modelize_property
-import phase
+import modelize
 import local_var_init
 
 redef class ToolContext
index 6e6ccc3..9d73b67 100644 (file)
@@ -15,7 +15,7 @@
 # Program to test the `markdown` module on real source files.
 module test_markdown
 
-import modelize_property
+import modelize
 import highlight
 import markdown
 
index 243a51e..62cfb08 100644 (file)
@@ -15,8 +15,8 @@
 # Base options for testing tools.
 module testing_base
 
-import modelize_property
-import parser_util
+import modelize
+private import parser_util
 
 redef class ToolContext
        # opt --full
index acf5650..30cbed5 100644 (file)
@@ -17,6 +17,7 @@ module testing_suite
 
 import testing_base
 import html
+private import annotation
 
 redef class ToolContext
        # -- target-file
index 6829d75..6a209c3 100644 (file)
@@ -17,8 +17,8 @@
 module transform
 
 import astbuilder
-import auto_super_init
 import astvalidation
+import semantize
 
 redef class ToolContext
        var transform_phase: Phase = new TransformPhase(self, [typing_phase, auto_super_init_phase])
index 754b8ec..7e87f8c 100644 (file)
@@ -17,7 +17,7 @@
 # Implementation of the Nit virtual machine
 module vm
 
-intrude import naive_interpreter
+intrude import interpreter::naive_interpreter
 import model_utils
 import perfect_hashing
 
diff --git a/tests/sav/niti/error_annot_pkgconfig_alt1.res b/tests/sav/niti/error_annot_pkgconfig_alt1.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/sav/niti/error_annot_pkgconfig_alt2.res b/tests/sav/niti/error_annot_pkgconfig_alt2.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/sav/niti/error_annot_pkgconfig_alt3.res b/tests/sav/niti/error_annot_pkgconfig_alt3.res
new file mode 100644 (file)
index 0000000..e69de29
index ab778d5..979a95a 100644 (file)
@@ -460,22 +460,6 @@ Number of property definitions: 20
 Number of redefined properties: 1 (5.55%)
 Average number of property redefinitions by property: 0.11
 Average number of property redefinitions by redefined property: 2.00
---- Metrics of the explitic static types ---
-Total number of explicit static types: 9
-Statistics of type usage:
- population: 4
- minimum value: 1
- maximum value: 6
- total value: 9
- average value: 2.25
- distribution:
-  <=1: sub-population=3 (75.00%); cumulated value=3 (33.33%)
-  <=8: sub-population=1 (25.00%); cumulated value=6 (66.66%)
- list:
-  Int: 6 (66.66%)
-  C: 1 (11.11%)
-  B: 1 (11.11%)
-  A: 1 (11.11%)
 --- Explicit vs. Implicit Self ---
 Total number of self: 5
 Total number of implicit self: 4 (80.00%)
@@ -485,50 +469,9 @@ Average number of composing class definition by runtime class: 2.00
 Total size of tables (classes and instances): 38 (not including stuff like info for subtyping or call-next-method)
 Average size of table by runtime class: 6.33
 Values never redefined: 32 (84.21%)
-
-# Mendel metrics
-       large mclasses (threshold: 2.291)
-          B: 3
-          C: 3
-       budding mclasses (threshold: 0.693)
-          B: 0.75
-          C: 0.75
-       blooming mclasses (threshold: 1.935)
-          B: 2.25
-          C: 2.25
-       blooming mclasses (threshold: 1.935)
-          B: 2.25
-          C: 2.25
 generating out/nitmetrics_args1.write/project_hierarchy.dot
 generating out/nitmetrics_args1.write/module_hierarchy.dot
 
-# Nullable metrics
-
- ## project base_simple3
-  `- group base_simple3
-       cnba: number of accessible attributes (inherited + local)
-         avg: 0.0
-         max: C (2)
-         min: Object (0)
-         std: 0.845
-         sum: 3
-       cnbna: number of accessible nullable attributes (inherited + local) -- nothing
-         sum: 0
-
- ## global metrics
-       cnba: number of accessible attributes (inherited + local)
-         avg: 0.0
-         max: C (2)
-         min: Object (0)
-         std: 0.845
-         sum: 3
-       cnbna: number of accessible nullable attributes (inherited + local) -- nothing
-         sum: 0
---- Sends on Nullable Receiver ---
-Total number of sends: 19
-Number of sends on a nullable receiver: 0 (0.0%)
-Number of buggy sends (cannot determine the type of the receiver): 0 (0.0%)
-
 # Inheritance metrics
 
  ## project base_simple3
@@ -715,6 +658,63 @@ Number of buggy sends (cannot determine the type of the receiver): 0 (0.0%)
          min: base_simple3 (0.143)
          std: 0.0
          sum: 0.143
+--- Metrics of the explitic static types ---
+Total number of explicit static types: 9
+Statistics of type usage:
+ population: 4
+ minimum value: 1
+ maximum value: 6
+ total value: 9
+ average value: 2.25
+ distribution:
+  <=1: sub-population=3 (75.00%); cumulated value=3 (33.33%)
+  <=8: sub-population=1 (25.00%); cumulated value=6 (66.66%)
+ list:
+  Int: 6 (66.66%)
+  C: 1 (11.11%)
+  B: 1 (11.11%)
+  A: 1 (11.11%)
+
+# Mendel metrics
+       large mclasses (threshold: 2.291)
+          B: 3
+          C: 3
+       budding mclasses (threshold: 0.693)
+          B: 0.75
+          C: 0.75
+       blooming mclasses (threshold: 1.935)
+          B: 2.25
+          C: 2.25
+       blooming mclasses (threshold: 1.935)
+          B: 2.25
+          C: 2.25
+
+# Nullable metrics
+
+ ## project base_simple3
+  `- group base_simple3
+       cnba: number of accessible attributes (inherited + local)
+         avg: 0.0
+         max: C (2)
+         min: Object (0)
+         std: 0.845
+         sum: 3
+       cnbna: number of accessible nullable attributes (inherited + local) -- nothing
+         sum: 0
+
+ ## global metrics
+       cnba: number of accessible attributes (inherited + local)
+         avg: 0.0
+         max: C (2)
+         min: Object (0)
+         std: 0.845
+         sum: 3
+       cnbna: number of accessible nullable attributes (inherited + local) -- nothing
+         sum: 0
+--- Sends on Nullable Receiver ---
+Total number of sends: 19
+Number of sends on a nullable receiver: 0 (0.0%)
+Number of buggy sends (cannot determine the type of the receiver): 0 (0.0%)
 
 # RTA metrics