neo_doxygen: remove ambiguity in the use of Location
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 22 Aug 2017 17:49:08 +0000 (13:49 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 31 Aug 2017 14:16:36 +0000 (10:16 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/neo_doxygen/src/doxml/entitydef.nit
contrib/neo_doxygen/src/model/class_compound.nit
contrib/neo_doxygen/src/model/graph.nit
contrib/neo_doxygen/src/model/location.nit
contrib/neo_doxygen/src/model/module_compound.nit
contrib/neo_doxygen/src/tests/neo_doxygen_file_compound.nit

index 0f83aa1..6e43b24 100644 (file)
@@ -57,8 +57,8 @@ abstract class EntityDefListener
        end
 
        # Parse the attributes of a `location` element.
-       protected fun get_location(atts: Attributes): Location do
-               var location = new Location
+       protected fun get_location(atts: Attributes): neo_doxygen::Location do
+               var location = new neo_doxygen::Location
 
                location.path = atts.value_ns("", "bodyfile") or else atts.value_ns("", "file")
                # Doxygen may indicate `[generated]`.
index aca58cb..0fc5936 100644 (file)
@@ -50,7 +50,7 @@ class ClassCompound
                class_def.name = name
        end
 
-       redef fun location=(location: nullable Location) do
+       redef fun location=(location) do
                super
                class_def.location = location
        end
index 26c8e66..9df491a 100644 (file)
@@ -167,13 +167,13 @@ abstract class Entity
        fun ns_separator: String do return "::"
 
        # Set the location of the entity in the source code.
-       fun location=(location: nullable Location) do
+       fun location=(location: nullable neo_doxygen::Location) do
                self["location"] = location
        end
 
        # Get the location of the entity in the source code.
-       fun location: nullable Location do
-               return self["location"].as(nullable Location)
+       fun location: nullable neo_doxygen::Location do
+               return self["location"].as(nullable neo_doxygen::Location)
        end
 
        # Put the entity in the graph.
@@ -202,12 +202,12 @@ abstract class CodeBlock
        super Entity
 
        init do
-               self["location"] = new Location
+               self["location"] = new neo_doxygen::Location
        end
 
-       redef fun location=(location: nullable Location) do
+       redef fun location=(location) do
                if location == null then
-                       super(new Location)
+                       super(new neo_doxygen::Location)
                else
                        super
                end
index 576a087..4e58af0 100644 (file)
@@ -15,7 +15,6 @@
 # This module is used to model locations in source files.
 module location
 
-import json::static
 import json
 
 # A location inside a source file.
index 188d4c1..08b8205 100644 (file)
@@ -46,7 +46,7 @@ class FileCompound
                super
        end
 
-       redef fun location=(location: nullable Location) do
+       redef fun location=(location) do
                super
                for m in inner_namespaces do m.location = location
        end
index 3b1f6a4..a9dae43 100644 (file)
@@ -26,11 +26,11 @@ var c_ns = new Namespace(graph)
 var d_ns = new Namespace(graph)
 var buffer = new Buffer
 var root_ns = graph.by_id[""].as(Namespace)
-var location: Location
+var location
 
 file.name = "Bar.java"
 file.model_id = "_Bar_8java"
-location = new Location
+location = new neo_doxygen::Location
 location.path = "a/b/Bar.java"
 file.location = location
 file.declare_class("classa_b_bar", "a::b::Bar", "package")
@@ -41,7 +41,7 @@ file.put_in_graph
 
 file_2.name = "Bar.java"
 file_2.model_id = "_Bar_8java_2"
-location = new Location
+location = new neo_doxygen::Location
 location.path = "Bar.java"
 file_2.location = location
 file_2.declare_namespace("namespacec", "c")
@@ -50,7 +50,7 @@ file_2.put_in_graph
 
 bar_class.model_id = "classa_b_bar"
 bar_class.name = "Bar"
-location = new Location
+location = new neo_doxygen::Location
 location.path = "a/b/Bar.class"
 location.line_start = 5
 location.column_start = 1
@@ -61,7 +61,7 @@ bar_class.put_in_graph
 
 baz_class.model_id = "classbaz"
 baz_class.name = "Baz"
-location = new Location
+location = new neo_doxygen::Location
 location.path = "Baz.jar"
 baz_class.location = location
 baz_class.put_in_graph