lib/standard: fixes bad indent in comments
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 4 Dec 2014 20:16:20 +0000 (15:16 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 11 Dec 2014 02:01:17 +0000 (21:01 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/standard/collection/abstract_collection.nit
lib/standard/collection/array.nit
lib/standard/collection/range.nit
lib/standard/kernel.nit
lib/standard/math.nit
lib/standard/string.nit

index 3b7f908..d5621a9 100644 (file)
@@ -39,8 +39,8 @@ import kernel
 # var x: Collection[U]
 # # ...
 # for u in x do
-#     # u is a U
-#     # ...
+#      # u is a U
+#      # ...
 # end
 # ~~~
 #
@@ -50,7 +50,7 @@ import kernel
 # var x: Collection[U]
 # # ...
 # var i = x.iterator
-#     while i.is_ok do
+# while i.is_ok do
 #     var u = i.item # u is a U
 #     # ...
 #     i.next
@@ -110,7 +110,7 @@ interface Collection[E]
        # How many occurrences of `item` are in the collection?
        # Comparisons are done with ==
        #
-       #    assert [10,20,10].count(10)         == 2
+       #     assert [10,20,10].count(10)         == 2
        fun count(item: E): Int
        do
                var nb = 0
@@ -120,7 +120,7 @@ interface Collection[E]
 
        # Return the first item of the collection
        #
-       #    assert [1,2,3].first                == 1
+       #     assert [1,2,3].first                == 1
        fun first: E
        do
                assert length > 0
@@ -129,13 +129,13 @@ interface Collection[E]
 
        # Does the collection contain at least each element of `other`?
        #
-       #    assert [1,3,4,2].has_all([1..2])    == true
-       #    assert [1,3,4,2].has_all([1..5])    == false
+       #     assert [1,3,4,2].has_all([1..2])    == true
+       #     assert [1,3,4,2].has_all([1..5])    == false
        #
        # Repeated elements in the collections are not considered.
        #
-       #    assert [1,1,1].has_all([1])         == true
-       #    assert [1..5].has_all([1,1,1])      == true
+       #     assert [1,1,1].has_all([1])         == true
+       #     assert [1..5].has_all([1,1,1])      == true
        #
        # Note that the default implementation is general and correct for any lawful Collections.
        # It is memory-efficient but relies on `has` so may be CPU-inefficient for some kind of collections.
@@ -150,16 +150,16 @@ interface Collection[E]
        # The same elements must be present in both `self` and `other`,
        # but the order of the elements in the collections are not considered.
        #
-       #    assert [1..3].has_exactly([3,1,2]) == true  # the same elements
-       #    assert [1..3].has_exactly([3,1])   == false # 2 is not in the array
-       #    assert [1..2].has_exactly([3,1,2]) == false # 3 is not in the range
+       #     assert [1..3].has_exactly([3,1,2]) == true  # the same elements
+       #     assert [1..3].has_exactly([3,1])   == false # 2 is not in the array
+       #     assert [1..2].has_exactly([3,1,2]) == false # 3 is not in the range
        #
        # Repeated elements must be present in both collections in the same amount.
        # So basically it is a multi-set comparison.
        #
-       #    assert [1,2,3,2].has_exactly([1,2,2,3]) == true  # the same elements
-       #    assert [1,2,3,2].has_exactly([1,2,3])   == false # more 2 in the first array
-       #    assert [1,2,3].has_exactly([1,2,2,3])   == false # more 2 in the second array
+       #     assert [1,2,3,2].has_exactly([1,2,2,3]) == true  # the same elements
+       #     assert [1,2,3,2].has_exactly([1,2,3])   == false # more 2 in the first array
+       #     assert [1,2,3].has_exactly([1,2,2,3])   == false # more 2 in the second array
        #
        # Note that the default implementation is general and correct for any lawful Collections.
        # It is memory-efficient but relies on `count` so may be CPU-inefficient for some kind of collections.
index add6077..ffa8a94 100644 (file)
@@ -398,11 +398,11 @@ class Array[E]
        #
        # returns a new array built by concatenating `self` `repeat` times.
        #
-       #    var a = [1,2,3]
-       #    assert (a * 0).is_empty
-       #    assert a * 1  ==  [1,2,3]
-       #    assert a * 2  ==  [1,2,3,1,2,3]
-       #    assert (a * 10).length  ==  30
+       #     var a = [1,2,3]
+       #     assert (a * 0).is_empty
+       #     assert a * 1  ==  [1,2,3]
+       #     assert a * 2  ==  [1,2,3,1,2,3]
+       #     assert (a * 10).length  ==  30
        fun *(repeat: Int): Array[E]
        do
                assert repeat >= 0
index 61b5194..da68294 100644 (file)
@@ -139,12 +139,12 @@ end
 redef class Int
        # Returns the range from 0 to `self-1`, is used to do:
        #
-       #    var s = new Array[String]
-       #    for i in 3.times do s.add "cool"
-       #    assert s.join(" ") == "cool cool cool"
+       #     var s = new Array[String]
+       #     for i in 3.times do s.add "cool"
+       #     assert s.join(" ") == "cool cool cool"
        #
-       #    s.clear
-       #    for i in 10.times do s.add(i.to_s)
-       #    assert s.to_s == "0123456789"
+       #     s.clear
+       #     for i in 10.times do s.add(i.to_s)
+       #     assert s.to_s == "0123456789"
        fun times: Range[Int] do return [0 .. self[
 end
index d65b135..7d4596a 100644 (file)
@@ -489,8 +489,8 @@ universal Int
 
        # The character whose ASCII value is `self`.
        #
-       #      assert 65.ascii   == 'A'
-       #      assert 10.ascii   == '\n'
+       #     assert 65.ascii   == 'A'
+       #     assert 10.ascii   == '\n'
        fun ascii: Char is intern
 
        # Number of digits of an integer in base `b` (plus one if negative)
index 1d1437b..4a25b49 100644 (file)
@@ -26,27 +26,27 @@ redef class Int
 
        # Returns the result of a binary AND operation on `self` and `i`
        #
-       #    assert 0x10.bin_and(0x01) == 0
+       #     assert 0x10.bin_and(0x01) == 0
        fun bin_and(i: Int): Int is extern "kernel_Int_Int_binand_0"
 
        # Returns the result of a binary OR operation on `self` and `i`
        #
-       #    assert 0x10.bin_or(0x01) == 0x11
+       #     assert 0x10.bin_or(0x01) == 0x11
        fun bin_or(i: Int): Int is extern "kernel_Int_Int_binor_0"
 
        # Returns the result of a binary XOR operation on `self` and `i`
        #
-       #    assert 0x101.bin_xor(0x110) == 0x11
+       #     assert 0x101.bin_xor(0x110) == 0x11
        fun bin_xor(i: Int): Int is extern "kernel_Int_Int_binxor_0"
 
        # Returns the 1's complement of `self`
        #
-       #    assert 0x2F.bin_not == -48
+       #     assert 0x2F.bin_not == -48
        fun bin_not: Int is extern "kernel_Int_Int_binnot_0"
 
        # Returns the square root of `self`
        #
-       #    assert 16.sqrt == 4
+       #     assert 16.sqrt == 4
        fun sqrt: Int `{ return sqrt(recv); `}
 
        # Returns the greatest common divisor of `self` and `o`
@@ -76,17 +76,17 @@ redef class Int
 
        # Is `self` even ?
        #
-       #    assert 12.is_even
+       #     assert 12.is_even
        fun is_even: Bool do return self % 2 == 0
 
        # Is `self` odd ?
        #
-       #    assert not 13.is_even
+       #     assert not 13.is_even
        fun is_odd: Bool do return not is_even
 
        # Returns the `self` raised to the power of `e`.
        #
-       #    assert 2 ** 3 == 8
+       #     assert 2 ** 3 == 8
        fun **(e: Int): Int
        do
                return self.to_f.pow(e.to_f).to_i
@@ -96,10 +96,10 @@ redef class Int
        #
        # Returns `1 * 2 * 3 * ... * self-1 * self`
        #
-       #    assert 0.factorial == 1  # by convention for an empty product
-       #    assert 1.factorial == 1
-       #    assert 4.factorial == 24
-       #    assert 9.factorial == 362880
+       #     assert 0.factorial == 1  # by convention for an empty product
+       #     assert 1.factorial == 1
+       #     assert 4.factorial == 24
+       #     assert 9.factorial == 362880
        fun factorial: Int
        do
                assert self >= 0
index 604386f..bf59f0b 100644 (file)
@@ -947,9 +947,9 @@ abstract class String
        #
        # SEE : `Char::is_letter` for the definition of letter.
        #
-       #    assert "jAVASCRIPT".capitalized == "Javascript"
-       #    assert "i am root".capitalized == "I Am Root"
-       #    assert "ab_c -ab0c ab\nc".capitalized == "Ab_C -Ab0C Ab\nC"
+       #     assert "jAVASCRIPT".capitalized == "Javascript"
+       #     assert "i am root".capitalized == "I Am Root"
+       #     assert "ab_c -ab0c ab\nc".capitalized == "Ab_C -Ab0C Ab\nC"
        fun capitalized: SELFTYPE do
                if length == 0 then return self
 
@@ -1424,15 +1424,15 @@ abstract class Buffer
        #
        # SEE: `Char::is_letter` for the definition of a letter.
        #
-       #    var b = new FlatBuffer.from("jAVAsCriPt")
-       #    b.capitalize
-       #    assert b == "Javascript"
-       #    b = new FlatBuffer.from("i am root")
-       #    b.capitalize
-       #    assert b == "I Am Root"
-       #    b = new FlatBuffer.from("ab_c -ab0c ab\nc")
-       #    b.capitalize
-       #    assert b == "Ab_C -Ab0C Ab\nC"
+       #     var b = new FlatBuffer.from("jAVAsCriPt")
+       #     b.capitalize
+       #     assert b == "Javascript"
+       #     b = new FlatBuffer.from("i am root")
+       #     b.capitalize
+       #     assert b == "I Am Root"
+       #     b = new FlatBuffer.from("ab_c -ab0c ab\nc")
+       #     b.capitalize
+       #     assert b == "Ab_C -Ab0C Ab\nC"
        fun capitalize do
                if length == 0 then return
                var c = self[0].to_upper
@@ -1789,7 +1789,7 @@ redef class Object
 
        # The class name of the object.
        #
-       #    assert 5.class_name == "Int"
+       #     assert 5.class_name == "Int"
        fun class_name: String do return native_class_name.to_s
 
        # Developer readable representation of `self`.
@@ -1984,10 +1984,10 @@ redef class Char
 
        # Returns true if the char is a numerical digit
        #
-       #      assert '0'.is_numeric
-       #      assert '9'.is_numeric
-       #      assert not 'a'.is_numeric
-       #      assert not '?'.is_numeric
+       #     assert '0'.is_numeric
+       #     assert '9'.is_numeric
+       #     assert not 'a'.is_numeric
+       #     assert not '?'.is_numeric
        fun is_numeric: Bool
        do
                return self >= '0' and self <= '9'
@@ -1995,10 +1995,10 @@ redef class Char
 
        # Returns true if the char is an alpha digit
        #
-       #      assert 'a'.is_alpha
-       #      assert 'Z'.is_alpha
-       #      assert not '0'.is_alpha
-       #      assert not '?'.is_alpha
+       #     assert 'a'.is_alpha
+       #     assert 'Z'.is_alpha
+       #     assert not '0'.is_alpha
+       #     assert not '?'.is_alpha
        fun is_alpha: Bool
        do
                return (self >= 'a' and self <= 'z') or (self >= 'A' and self <= 'Z')
@@ -2006,11 +2006,11 @@ redef class Char
 
        # Returns true if the char is an alpha or a numeric digit
        #
-       #      assert 'a'.is_alphanumeric
-       #      assert 'Z'.is_alphanumeric
-       #      assert '0'.is_alphanumeric
-       #      assert '9'.is_alphanumeric
-       #      assert not '?'.is_alphanumeric
+       #     assert 'a'.is_alphanumeric
+       #     assert 'Z'.is_alphanumeric
+       #     assert '0'.is_alphanumeric
+       #     assert '9'.is_alphanumeric
+       #     assert not '?'.is_alphanumeric
        fun is_alphanumeric: Bool
        do
                return self.is_numeric or self.is_alpha