Remove confusing <//> (#17830)

This commit is contained in:
flywind 2021-04-26 15:04:52 +08:00 • committed by GitHub
commit 68e522ecec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 31 deletions

View file

@ -68,7 +68,7 @@ type
## A node of a doubly linked list.
##
## It consists of a `value` field, and pointers to `next` and `prev`.
next*: <//>(DoublyLinkedNode[T])
next*: DoublyLinkedNode[T]
prev* {.cursor.}: DoublyLinkedNode[T]
value*: T
DoublyLinkedNode*[T] = ref DoublyLinkedNodeObj[T]
@ -77,23 +77,23 @@ type
## A node of a singly linked list.
##
## It consists of a `value` field, and a pointer to `next`.
next*: <//>(SinglyLinkedNode[T])
next*: SinglyLinkedNode[T]
value*: T
SinglyLinkedNode*[T] = ref SinglyLinkedNodeObj[T]
SinglyLinkedList*[T] = object
## A singly linked list.
head*: <//>(SinglyLinkedNode[T])
head*: SinglyLinkedNode[T]
tail* {.cursor.}: SinglyLinkedNode[T]
DoublyLinkedList*[T] = object
## A doubly linked list.
head*: <//>(DoublyLinkedNode[T])
head*: DoublyLinkedNode[T]
tail* {.cursor.}: DoublyLinkedNode[T]
SinglyLinkedRing*[T] = object
## A singly linked ring.
head*: <//>(SinglyLinkedNode[T])
head*: SinglyLinkedNode[T]
tail* {.cursor.}: SinglyLinkedNode[T]
DoublyLinkedRing*[T] = object
@ -148,7 +148,7 @@ proc initDoublyLinkedRing*[T](): DoublyLinkedRing[T] =
discard
proc newDoublyLinkedNode*[T](value: T): <//>(DoublyLinkedNode[T]) =
proc newDoublyLinkedNode*[T](value: T): DoublyLinkedNode[T] =
## Creates a new doubly linked node with the given `value`.
runnableExamples:
let n = newDoublyLinkedNode[int](5)
@ -157,7 +157,7 @@ proc newDoublyLinkedNode*[T](value: T): <//>(DoublyLinkedNode[T]) =
new(result)
result.value = value
proc newSinglyLinkedNode*[T](value: T): <//>(SinglyLinkedNode[T]) =
proc newSinglyLinkedNode*[T](value: T): SinglyLinkedNode[T] =
## Creates a new singly linked node with the given `value`.
runnableExamples:
let n = newSinglyLinkedNode[int](5)

View file

@ -795,7 +795,7 @@ iterator allValues*[A, B](t: Table[A, B]; key: A): B {.deprecated:
# -------------------------------------------------------------------
proc newTable*[A, B](initialSize = defaultInitialSize): <//>TableRef[A, B] =
proc newTable*[A, B](initialSize = defaultInitialSize): TableRef[A, B] =
## Creates a new ref hash table that is empty.
##
## See also:
@ -810,7 +810,7 @@ proc newTable*[A, B](initialSize = defaultInitialSize): <//>TableRef[A, B] =
new(result)
result[] = initTable[A, B](initialSize)
proc newTable*[A, B](pairs: openArray[(A, B)]): <//>TableRef[A, B] =
proc newTable*[A, B](pairs: openArray[(A, B)]): TableRef[A, B] =
## Creates a new ref hash table that contains the given `pairs`.
##
## `pairs` is a container consisting of `(key, value)` tuples.
@ -826,7 +826,7 @@ proc newTable*[A, B](pairs: openArray[(A, B)]): <//>TableRef[A, B] =
new(result)
result[] = toTable[A, B](pairs)
proc newTableFrom*[A, B, C](collection: A, index: proc(x: B): C): <//>TableRef[C, B] =
proc newTableFrom*[A, B, C](collection: A, index: proc(x: B): C): TableRef[C, B] =
## Index the collection with the proc provided.
# TODO: As soon as supported, change collection: A to collection: A[B]
result = newTable[C, B]()
@ -1790,7 +1790,7 @@ iterator mvalues*[A, B](t: var OrderedTable[A, B]): var B =
# --------------------------- OrderedTableRef -------------------------------
# ---------------------------------------------------------------------------
proc newOrderedTable*[A, B](initialSize = defaultInitialSize): <//>OrderedTableRef[A, B] =
proc newOrderedTable*[A, B](initialSize = defaultInitialSize): OrderedTableRef[A, B] =
## Creates a new ordered ref hash table that is empty.
##
## See also:
@ -1805,7 +1805,7 @@ proc newOrderedTable*[A, B](initialSize = defaultInitialSize): <//>OrderedTableR
new(result)
result[] = initOrderedTable[A, B](initialSize)
proc newOrderedTable*[A, B](pairs: openArray[(A, B)]): <//>OrderedTableRef[A, B] =
proc newOrderedTable*[A, B](pairs: openArray[(A, B)]): OrderedTableRef[A, B] =
## Creates a new ordered ref hash table that contains the given `pairs`.
##
## `pairs` is a container consisting of `(key, value)` tuples.
@ -2610,7 +2610,7 @@ iterator mvalues*[A](t: var CountTable[A]): var int =
proc inc*[A](t: CountTableRef[A], key: A, val = 1)
proc newCountTable*[A](initialSize = defaultInitialSize): <//>CountTableRef[A] =
proc newCountTable*[A](initialSize = defaultInitialSize): CountTableRef[A] =
## Creates a new ref count table that is empty.
##
## See also:
@ -2621,7 +2621,7 @@ proc newCountTable*[A](initialSize = defaultInitialSize): <//>CountTableRef[A] =
new(result)
result[] = initCountTable[A](initialSize)
proc newCountTable*[A](keys: openArray[A]): <//>CountTableRef[A] =
proc newCountTable*[A](keys: openArray[A]): CountTableRef[A] =
## Creates a new ref count table with every member of a container `keys`
## having a count of how many times it occurs in that container.
result = newCountTable[A](keys.len)