uml: fix not escaped names
authorAlexandre Terrasa <alexandre@moz-code.org>
Fri, 18 Dec 2015 05:18:12 +0000 (00:18 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 20 Apr 2016 05:22:04 +0000 (01:22 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/uml/uml_class.nit
src/uml/uml_module.nit

index c6d4870..ee7f360 100644 (file)
@@ -52,6 +52,7 @@ end
 redef class MClass
 
        redef fun tpl_class(model) do
+               var name = name.escape_to_dot
                var t = new Template
                t.add "{name} [\n label = \"\{"
                if kind == abstract_kind then
@@ -121,12 +122,12 @@ redef class MSignature
                        params.add i
                end
                if params.length > 0 then
-                       t.add params.first.name
+                       t.add params.first.name.escape_to_dot
                        t.add ": "
                        t.add params.first.mtype.tpl_class(model)
                        for i in [1 .. params.length [ do
                                t.add ", "
-                               t.add params[i].name
+                               t.add params[i].name.escape_to_dot
                                t.add ": "
                                t.add params[i].mtype.tpl_class(model)
                        end
@@ -145,7 +146,7 @@ redef class MAttribute
                var tpl = new Template
                tpl.add visibility.tpl_class
                tpl.add " "
-               tpl.add name
+               tpl.add name.escape_to_dot
                tpl.add ": "
                tpl.add intro.static_mtype.tpl_class(model)
                return tpl
index 1720ff0..19726ed 100644 (file)
@@ -47,6 +47,7 @@ end
 
 redef class MModule
        redef fun tpl_module(model) do
+               var name = self.name.escape_to_dot
                var t = new Template
                t.add "subgraph cluster{name} \{\n"
                t.add "label = \"{name}\"\n"
@@ -72,8 +73,9 @@ redef class MClassDef
        var redef_colour = "#B24758"
 
        redef fun tpl_module(model) do
+               var name = self.name.escape_to_dot
                var t = new Template
-               t.add "{mmodule}{name} [\n\tlabel = \"\{"
+               t.add "{mmodule.name.escape_to_dot}{name} [\n\tlabel = \"\{"
                if mclass.kind == abstract_kind then
                        t.add "abstract\\n{name}"
                else if mclass.kind == interface_kind then