From: Jean Privat Date: Wed, 27 May 2015 16:55:50 +0000 (-0400) Subject: modelize: rename annotation `autoinit` on attributes as `lateinit` X-Git-Tag: v0.7.5~13^2~1 X-Git-Url: http://nitlanguage.org modelize: rename annotation `autoinit` on attributes as `lateinit` Signed-off-by: Jean Privat --- diff --git a/src/frontend/check_annotation.nit b/src/frontend/check_annotation.nit index 6d9bb60..eb05a14 100644 --- a/src/frontend/check_annotation.nit +++ b/src/frontend/check_annotation.nit @@ -84,6 +84,7 @@ readonly writable autoinit noautoinit +lateinit nosuper old_style_init abstract diff --git a/src/modelize/modelize_property.nit b/src/modelize/modelize_property.nit index 66d5e9f..0d0e51a 100644 --- a/src/modelize/modelize_property.nit +++ b/src/modelize/modelize_property.nit @@ -206,9 +206,9 @@ redef class ModelBuilder var mreadpropdef = npropdef.mreadpropdef if mreadpropdef == null or mreadpropdef.msignature == null then return # Skip broken attribute if npropdef.noinit then continue # Skip noinit attribute - var atautoinit = npropdef.get_single_annotation("autoinit", self) - if atautoinit != null then - # For autoinit attributes, call the reader to force + var atlateinit = npropdef.get_single_annotation("lateinit", self) + if atlateinit != null then + # For lateinit attributes, call the reader to force # the lazy initialization of the attribute. initializers.add(mreadpropdef.mproperty) mreadpropdef.mproperty.is_autoinit = true @@ -1187,17 +1187,17 @@ redef class AAttrPropdef end var atlazy = self.get_single_annotation("lazy", modelbuilder) - var atautoinit = self.get_single_annotation("autoinit", modelbuilder) - if atlazy != null or atautoinit != null then - if atlazy != null and atautoinit != null then - modelbuilder.error(atlazy, "Error: `lazy` incompatible with `autoinit`.") + var atlateinit = self.get_single_annotation("lateinit", modelbuilder) + if atlazy != null or atlateinit != null then + if atlazy != null and atlateinit != null then + modelbuilder.error(atlazy, "Error: `lazy` incompatible with `lateinit`.") return end if not has_value then if atlazy != null then modelbuilder.error(atlazy, "Error: `lazy` attributes need a value.") - else if atautoinit != null then - modelbuilder.error(atautoinit, "Error: `autoinit` attributes need a value.") + else if atlateinit != null then + modelbuilder.error(atlateinit, "Error: `lateinit` attributes need a value.") end has_value = true return