src: prepare for new constructors
authorJean Privat <jean@pryen.org>
Fri, 15 Aug 2014 10:25:35 +0000 (06:25 -0400)
committerJean Privat <jean@pryen.org>
Fri, 15 Aug 2014 10:25:35 +0000 (06:25 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/coloring.nit
src/doc/doc_templates.nit
src/test_parser.nit
src/toolcontext.nit
src/vm.nit

index 0b4532d..aa65f32 100644 (file)
@@ -177,18 +177,16 @@ class POSetColorer[E: Object]
                assert is_colored
                return poset_cache
        end
-       private var poset_cache: POSet[E]
+       private var poset_cache: POSet[E] is noinit
 
        # REQUIRE: is_colored
        fun conflicts: Map[E, Set[E]] do
                assert is_colored
                return conflicts_cache
        end
-       private var conflicts_cache: Map[E, Set[E]]
+       private var conflicts_cache: Map[E, Set[E]] is noinit
 
-       private var graph: POSetConflictGraph[E]
-
-       init do end
+       private var graph: POSetConflictGraph[E] is noinit
 
        # Start coloring on given POSet
        fun colorize(poset: POSet[E]) do
index edbc58b..7650feb 100644 (file)
@@ -23,25 +23,25 @@ class TplPage
        super Template
 
        # Page title in HTML header
-       var title: String writable
+       var title: String is writable, noinit
 
        # Directory where css, js and other assets can be found
-       var shareurl: String writable
+       var shareurl: String is writable, noinit
 
        # Attributes of the body tag element
        var body_attrs = new Array[TagAttribute]
 
        # Top menu template if any
-       var topmenu: TplTopMenu writable
+       var topmenu: TplTopMenu is writable, noinit
 
        # Sidebar template if any
-       var sidebar: nullable TplSidebar writable
+       var sidebar: nullable TplSidebar = null is writable
 
        # Content of the page in form a TplSection
        var sections = new Array[TplSection]
 
        # Footer content if any
-       var footer: nullable Streamable writable
+       var footer: nullable Streamable = null is writable
 
        # JS scripts to append at the end of the body
        var scripts = new Array[TplScript]
@@ -150,7 +150,7 @@ class TplTopMenu
        super Template
 
        # Brand link to display in first position of the top menu
-       private var brand: nullable Streamable writable
+       private var brand: nullable Streamable = null is writable
        # Elements of the topmenu
        private var elts = new Array[Streamable]
 
@@ -511,15 +511,13 @@ class TplDefinition
        super Template
 
        # Comment to display
-       var comment: nullable Streamable writable
+       var comment: nullable Streamable = null is writable
 
        # Namespace for this definition
-       var namespace: nullable Streamable writable
+       var namespace: nullable Streamable = null is writable
 
        # Location link to display
-       var location: nullable Streamable writable
-
-       init do end
+       var location: nullable Streamable = null is writable
 
        private fun render_info do
                add "<div class='info text-right'>"
@@ -802,7 +800,7 @@ class TplScript
        super Template
 
        var attrs = new Array[TagAttribute]
-       var content: nullable Streamable writable
+       var content: nullable Streamable = null is writable
 
        init do
                attrs.add(new TagAttribute("type", "text/javascript"))
index 193a734..f654f5b 100644 (file)
@@ -22,7 +22,7 @@ import parser_util
 
 class PrintTreeVisitor
        super Visitor
-       private var rank: Int
+       private var rank: Int = 0
        redef fun visit(n)
        do
                if n isa Token then
@@ -34,11 +34,6 @@ class PrintTreeVisitor
                n.visit_all(self)
                rank = rank - 1
        end
-
-       init
-       do
-               rank = 0
-       end
 end
 
 var no_print = false
index d25d3fd..5bfd18d 100644 (file)
@@ -300,7 +300,7 @@ class ToolContext
        end
 
        # The identified root directory of the Nit project
-       var nit_dir: nullable String
+       var nit_dir: nullable String = null
 
        private fun compute_nit_dir: nullable String
        do
index 73d8683..754b8ec 100644 (file)
@@ -357,18 +357,16 @@ end
 # and informations to perform subtyping tests
 class VTable
        # The mask to perform perfect hashing
-       var mask: Int
+       var mask: Int is noinit
 
        # Unique identifier given by perfect hashing
-       var id: Int
+       var id: Int is noinit
 
        # Pointer to the c-allocated area, represents the virtual table
-       var internal_vtable: Pointer
+       var internal_vtable: Pointer is noinit
 
        # The short classname of this class
-       var classname: String
-
-       init do end
+       var classname: String is noinit
 end
 
 redef class Instance