From 00dcf11cc13cd9177e410ea6df9f086b0a22ecbd Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Wed, 30 May 2018 10:14:20 -0400 Subject: [PATCH] lib: fix unrecognized code blocks in doc units Signed-off-by: Alexandre Terrasa --- lib/core/collection/abstract_collection.nit | 1 + lib/core/collection/union_find.nit | 2 ++ lib/core/kernel.nit | 3 +++ lib/perfect_hashing/perfect_hashing.nit | 1 + lib/trees/bintree.nit | 1 + 5 files changed, 8 insertions(+) diff --git a/lib/core/collection/abstract_collection.nit b/lib/core/collection/abstract_collection.nit index 04dabfa..b51cd22 100644 --- a/lib/core/collection/abstract_collection.nit +++ b/lib/core/collection/abstract_collection.nit @@ -396,6 +396,7 @@ interface SimpleCollection[E] fun add(item: E) is abstract # Add each item of `coll`. + # # var a = [1,2] # a.add_all([3..5]) # assert a.has(4) == true diff --git a/lib/core/collection/union_find.nit b/lib/core/collection/union_find.nit index b44b7f9..6c74ca2 100644 --- a/lib/core/collection/union_find.nit +++ b/lib/core/collection/union_find.nit @@ -14,6 +14,7 @@ module union_find import hash_collection # Data structure to keeps track of elements partitioned into disjoint subsets +# # var s = new DisjointSet[Int] # s.add(1) # s.add(2) @@ -139,6 +140,7 @@ class DisjointSet[E] end # Are all elements of `es` in the same subset? + # # var s = new DisjointSet[Int] # s.add_all([1,2,3,4,5,6]) # s.union_all([1,2,3]) diff --git a/lib/core/kernel.nit b/lib/core/kernel.nit index 45c3ccd..39a5958 100644 --- a/lib/core/kernel.nit +++ b/lib/core/kernel.nit @@ -858,8 +858,11 @@ universal Int # Return the corresponding digit character # If 0 <= `self` <= 9, return the corresponding character. + # # assert 5.to_c == '5' + # # If 10 <= `self` <= 36, return the corresponding letter [a..z]. + # # assert 15.to_c == 'f' fun to_c: Char do diff --git a/lib/perfect_hashing/perfect_hashing.nit b/lib/perfect_hashing/perfect_hashing.nit index d8ab3cb..585130e 100644 --- a/lib/perfect_hashing/perfect_hashing.nit +++ b/lib/perfect_hashing/perfect_hashing.nit @@ -101,6 +101,7 @@ class Perfecthashing # n : number of required free identifiers # idc : This array will be filled with n free identifiers # return the size of hashTable to create for theses identifiers (mask + 1) + # # var ph = new Perfecthashing # var idc = new Array[Int] # assert ph.pnand([3, 7, 10], 1, idc) == 6 diff --git a/lib/trees/bintree.nit b/lib/trees/bintree.nit index 610ec2e..447a33f 100644 --- a/lib/trees/bintree.nit +++ b/lib/trees/bintree.nit @@ -36,6 +36,7 @@ import abstract_tree # * delete average O(lg n) worst O(n) # # Usage: +# # var tree = new BinTreeMap[Int, String] # tree[1] = "n1" # assert tree.min == "n1" -- 1.7.9.5