doc: fix some malformed documentation
authorJean Privat <jean@pryen.org>
Fri, 23 Aug 2013 18:42:24 +0000 (14:42 -0400)
committerJean Privat <jean@pryen.org>
Fri, 23 Aug 2013 18:42:24 +0000 (14:42 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/collection/abstract_collection.nit
lib/standard/string.nit
src/abstract_compiler.nit
src/model/model.nit

index 086098f..1217a70 100644 (file)
@@ -84,7 +84,7 @@ interface Collection[E]
        #     assert [1..3].has_only(1)          == false
        #     assert [3..3[.has_only(1)          == true # empty collection
        #
-       # ENSURE `is_empty implies (return) == true`
+       # ENSURE `is_empty implies result == true`
        fun has_only(item: E): Bool is abstract
 
        # How many occurrences of `item` are in the collection?
index 647eacd..f26a835 100644 (file)
@@ -38,10 +38,10 @@ abstract class AbstractString
 
        # Create a substring.
        #
-       #     assert "abcd".substring(1, 2)         ==  "bc"
-       #     assert "abcd".substring(-1, )         ==  "a"
-       #     assert "abcd".substring(1, 0)         ==  ""
-       #     assert "abcd".substring(2, 5)         ==  "cd"
+       #     assert "abcd".substring(1, 2)      ==  "bc"
+       #     assert "abcd".substring(-1, 2)     ==  "a"
+       #     assert "abcd".substring(1, 0)      ==  ""
+       #     assert "abcd".substring(2, 5)      ==  "cd"
        #
        # A `from` index < 0 will be replaced by 0.
        # Unless a `count` value is > 0 at the same time.
@@ -66,9 +66,9 @@ abstract class AbstractString
 
        # Create a substring from `self` beginning at the `from` position
        #
-       #     assert "abcd".substring_from(1)        ==  "bcd"
-       #     assert "abcd".substring_from(-1)       ==  "abcd"
-       #     assert "abcd".substring_from(2)       ==  "cd"
+       #     assert "abcd".substring_from(1)    ==  "bcd"
+       #     assert "abcd".substring_from(-1)   ==  "abcd"
+       #     assert "abcd".substring_from(2)    ==  "cd"
        #
        # As with substring, a `from` index < 0 will be replaced by 0
        fun substring_from(from: Int): String
@@ -124,7 +124,7 @@ abstract class AbstractString
        #
        #     assert "123".to_f        == 123.0
        #     assert "-1".to_f         == -1.0
-       #     assert "-1.2e-3".to_f    == -1.2e-3
+       #     assert "-1.2e-3".to_f    == -0.0012
        fun to_f: Float
        do
                # Shortcut
@@ -534,7 +534,7 @@ class String
 
        # The comparison between two strings is done on a lexicographical basis
        #
-       #     assert "aa" < "b"      ==  true
+       #     assert ("aa" < "b")      ==  true
        redef fun <(other)
        do
                if self.object_id == other.object_id then return false
index c4bd40b..fa14030 100644 (file)
@@ -614,7 +614,7 @@ abstract class AbstractCompilerVisitor
        # Unsafely cast a value to a new type
        # ie the result share the same C variable but my have a different mcasttype
        # NOTE: if the adaptation is useless then `value` is returned as it.
-       # ENSURE: `(return).name == value.name`
+       # ENSURE: `result.name == value.name`
        fun autoadapt(value: RuntimeVariable, mtype: MType): RuntimeVariable
        do
                mtype = self.anchor(mtype)
@@ -638,7 +638,7 @@ abstract class AbstractCompilerVisitor
        fun adapt_signature(m: MMethodDef, args: Array[RuntimeVariable]) is abstract
 
        # Box or unbox a value to another type iff a C type conversion is needed
-       # ENSURE: result.mtype.ctype == mtype.ctype
+       # ENSURE: `result.mtype.ctype == mtype.ctype`
        fun autobox(value: RuntimeVariable, mtype: MType): RuntimeVariable is abstract
 
        #  Generate a polymorphic subtype test
index 78035f5..284c62b 100644 (file)
@@ -674,8 +674,8 @@ abstract class MType
         # because "redef type U: Y". Therefore, Map[T, U] is bound to
        # Map[B, Y]
        #
-       # ENSURE: `not self.need_anchor` implies `(return) == self`
-       # ENSURE: `not (return).need_anchor`
+       # ENSURE: `not self.need_anchor` implies `result == self`
+       # ENSURE: `not result.need_anchor`
        fun anchor_to(mmodule: MModule, anchor: MClassType): MType
        do
                if not need_anchor then return self
@@ -701,7 +701,7 @@ abstract class MType
        #
        # REQUIRE: `super_mclass` is a super-class of `self`
        # REQUIRE: `self.need_anchor` implies `anchor != null and self.can_resolve_for(anchor, null, mmodule)`
-       # ENSURE: `(return).mclass = super_mclass`
+       # ENSURE: `result.mclass = super_mclass`
        fun supertype_to(mmodule: MModule, anchor: nullable MClassType, super_mclass: MClass): MClassType
        do
                if super_mclass.arity == 0 then return super_mclass.mclass_type
@@ -792,7 +792,7 @@ abstract class MType
        # two function instead of one seems also to be a bad idea.
        #
        # REQUIRE: `can_resolve_for(mtype, anchor, mmodule)`
-       # ENSURE: `not self.need_anchor` implies `(return) == self`
+       # ENSURE: `not self.need_anchor` implies `result == self`
        fun resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule, cleanup_virtual: Bool): MType is abstract
 
        # Can the type be resolved?
@@ -814,7 +814,7 @@ abstract class MType
        #
        # REQUIRE: `anchor != null` implies `not anchor.need_anchor`
        # REQUIRE: `mtype.need_anchor` implies `anchor != null and mtype.can_resolve_for(anchor, null, mmodule)`
-       # ENSURE: `not self.need_anchor` implies `(return) == true`
+       # ENSURE: `not self.need_anchor` implies `result == true`
        fun can_resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule): Bool is abstract
 
        # Return the nullable version of the type
@@ -908,7 +908,7 @@ class MClassType
        end
 
        # The formal arguments of the type
-       # ENSURE: `(return).length == self.mclass.arity`
+       # ENSURE: `result.length == self.mclass.arity`
        var arguments: Array[MType] = new Array[MType]
 
        redef fun to_s do return mclass.to_s