modelize: accepts `noautoinit` the new name of `noinit`.
authorJean Privat <jean@pryen.org>
Fri, 20 Feb 2015 05:20:12 +0000 (12:20 +0700)
committerJean Privat <jean@pryen.org>
Fri, 20 Feb 2015 05:43:14 +0000 (12:43 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

src/frontend/check_annotation.nit
src/modelize/modelize_property.nit

index a51bece..9408e95 100644 (file)
@@ -83,6 +83,7 @@ noinit
 readonly
 writable
 autoinit
+noautoinit
 cached
 nosuper
 old_style_init
index 6cc7aff..83acc62 100644 (file)
@@ -976,10 +976,11 @@ redef class AAttrPropdef
                has_value = n_expr != null or n_block != null
 
                var atnoinit = self.get_single_annotation("noinit", modelbuilder)
+               if atnoinit == null then atnoinit = self.get_single_annotation("noautoinit", modelbuilder)
                if atnoinit != null then
                        noinit = true
                        if has_value then
-                               modelbuilder.error(atnoinit, "Error: `noinit` attributes cannot have an initial value")
+                               modelbuilder.error(atnoinit, "Error: `noautoinit` attributes cannot have an initial value")
                                return
                        end
                end