summary refs log tree commit diff stats
path: root/lib/std
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-02-21 21:53:28 -0600
committerGitHub <noreply@github.com>2021-02-21 19:53:28 -0800
commit455690157250e9108819a3cb32a574da48d0f9c9 (patch)
tree9f4300fb63fefea8818122d43b7cbf4ed57e8ee7 /lib/std
parent4f10dde64a504d982ef0e1d46e42f506a9a88a1b (diff)
downloadNim-455690157250e9108819a3cb32a574da48d0f9c9.tar.gz
use single backtick (#17141)
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/editdistance.nim24
-rw-r--r--lib/std/effecttraits.nim34
-rw-r--r--lib/std/logic.nim2
-rw-r--r--lib/std/sums.nim2
-rw-r--r--lib/std/time_t.nim2
-rw-r--r--lib/std/with.nim2
6 files changed, 33 insertions, 33 deletions
diff --git a/lib/std/editdistance.nim b/lib/std/editdistance.nim
index 2c9203d64..9f29c5c05 100644
--- a/lib/std/editdistance.nim
+++ b/lib/std/editdistance.nim
@@ -13,24 +13,24 @@
 import unicode
 
 proc editDistance*(a, b: string): int {.noSideEffect.} =
-  ## Returns the **unicode-rune** edit distance between ``a`` and ``b``.
+  ## Returns the **unicode-rune** edit distance between `a` and `b`.
   ##
   ## This uses the `Levenshtein`:idx: distance algorithm with only a linear
   ## memory overhead.
   runnableExamples: static: doAssert editdistance("Kitten", "Bitten") == 1
   if len(a) > len(b):
-    # make ``b`` the longer string
+    # make `b` the longer string
     return editDistance(b, a)
   # strip common prefix
   var
-    iStart = 0 ## The character starting index of the first rune in both strings ``a`` and ``b``
+    iStart = 0 ## The character starting index of the first rune in both strings `a` and `b`
     iNextA = 0
     iNextB = 0
     runeA, runeB: Rune
-    lenRunesA = 0 ## The number of relevant runes in string ``a``.
-    lenRunesB = 0 ## The number of relevant runes in string ``b``.
+    lenRunesA = 0 ## The number of relevant runes in string `a`.
+    lenRunesB = 0 ## The number of relevant runes in string `b`.
   block commonPrefix:
-    # ``a`` is the shorter string
+    # `a` is the shorter string
     while iStart < len(a):
       iNextA = iStart
       a.fastRuneAt(iNextA, runeA, doInc = true)
@@ -44,9 +44,9 @@ proc editDistance*(a, b: string): int {.noSideEffect.} =
   var
     # we know that we are either at the start of the strings
     # or that the current value of runeA is not equal to runeB
-    # => start search for common suffix after the current rune (``i_next_*``)
-    iEndA = iNextA ## The exclusive upper index bound of string ``a``.
-    iEndB = iNextB ## The exclusive upper index bound of string ``b``.
+    # => start search for common suffix after the current rune (`i_next_*`)
+    iEndA = iNextA ## The exclusive upper index bound of string `a`.
+    iEndB = iNextB ## The exclusive upper index bound of string `b`.
     iCurrentA = iNextA
     iCurrentB = iNextB
   block commonSuffix:
@@ -69,8 +69,8 @@ proc editDistance*(a, b: string): int {.noSideEffect.} =
         addRunesB = 0
       iCurrentA = iNextA
       iCurrentB = iNextB
-    if iCurrentA >= len(a): # ``a`` exhausted
-      if iCurrentB < len(b): # ``b`` not exhausted
+    if iCurrentA >= len(a): # `a` exhausted
+      if iCurrentB < len(b): # `b` not exhausted
         iEndA = iCurrentA
         iEndB = iCurrentB
         inc(lenRunesA, addRunesA)
@@ -79,7 +79,7 @@ proc editDistance*(a, b: string): int {.noSideEffect.} =
           b.fastRuneAt(iEndB, runeB)
           inc(lenRunesB)
           if iEndB >= len(b): break
-    elif iCurrentB >= len(b): # ``b`` exhausted and ``a`` not exhausted
+    elif iCurrentB >= len(b): # `b` exhausted and `a` not exhausted
       iEndA = iCurrentA
       iEndB = iCurrentB
       inc(lenRunesA, addRunesA)
diff --git a/lib/std/effecttraits.nim b/lib/std/effecttraits.nim
index 0f0a24492..358280db0 100644
--- a/lib/std/effecttraits.nim
+++ b/lib/std/effecttraits.nim
@@ -12,7 +12,7 @@
 ## **Since**: Version 1.4.
 ##
 ## One can test for the existance of this standard module
-## via ``defined(nimHasEffectTraitsModule)``.
+## via `defined(nimHasEffectTraitsModule)`.
 
 import macros
 
@@ -22,33 +22,33 @@ proc isGcSafeImpl(n: NimNode): bool = discard "see compiler/vmops.nim"
 proc hasNoSideEffectsImpl(n: NimNode): bool = discard "see compiler/vmops.nim"
 
 proc getRaisesList*(fn: NimNode): NimNode =
-  ## Extracts the ``.raises`` list of the func/proc/etc ``fn``.
-  ## ``fn`` has to be a resolved symbol of kind ``nnkSym``. This
-  ## implies that the macro that calls this proc should accept ``typed``
-  ## arguments and not ``untyped`` arguments.
+  ## Extracts the `.raises` list of the func/proc/etc `fn`.
+  ## `fn` has to be a resolved symbol of kind `nnkSym`. This
+  ## implies that the macro that calls this proc should accept `typed`
+  ## arguments and not `untyped` arguments.
   expectKind fn, nnkSym
   result = getRaisesListImpl(fn)
 
 proc getTagsList*(fn: NimNode): NimNode =
-  ## Extracts the ``.tags`` list of the func/proc/etc ``fn``.
-  ## ``fn`` has to be a resolved symbol of kind ``nnkSym``. This
-  ## implies that the macro that calls this proc should accept ``typed``
-  ## arguments and not ``untyped`` arguments.
+  ## Extracts the `.tags` list of the func/proc/etc `fn`.
+  ## `fn` has to be a resolved symbol of kind `nnkSym`. This
+  ## implies that the macro that calls this proc should accept `typed`
+  ## arguments and not `untyped` arguments.
   expectKind fn, nnkSym
   result = getTagsListImpl(fn)
 
 proc isGcSafe*(fn: NimNode): bool =
-  ## Return true if the func/proc/etc ``fn`` is `gcsafe`.
-  ## ``fn`` has to be a resolved symbol of kind ``nnkSym``. This
-  ## implies that the macro that calls this proc should accept ``typed``
-  ## arguments and not ``untyped`` arguments.
+  ## Return true if the func/proc/etc `fn` is `gcsafe`.
+  ## `fn` has to be a resolved symbol of kind `nnkSym`. This
+  ## implies that the macro that calls this proc should accept `typed`
+  ## arguments and not `untyped` arguments.
   expectKind fn, nnkSym
   result = isGcSafeImpl(fn)
 
 proc hasNoSideEffects*(fn: NimNode): bool =
-  ## Return true if the func/proc/etc ``fn`` has `noSideEffect`.
-  ## ``fn`` has to be a resolved symbol of kind ``nnkSym``. This
-  ## implies that the macro that calls this proc should accept ``typed``
-  ## arguments and not ``untyped`` arguments.
+  ## Return true if the func/proc/etc `fn` has `noSideEffect`.
+  ## `fn` has to be a resolved symbol of kind `nnkSym`. This
+  ## implies that the macro that calls this proc should accept `typed`
+  ## arguments and not `untyped` arguments.
   expectKind fn, nnkSym
   result = hasNoSideEffectsImpl(fn)
diff --git a/lib/std/logic.nim b/lib/std/logic.nim
index 3cc871a6e..84640d380 100644
--- a/lib/std/logic.nim
+++ b/lib/std/logic.nim
@@ -1,5 +1,5 @@
 ## This module provides further logic operators like 'forall' and 'exists'
-## They are only supported in ``.ensures`` etc pragmas.
+## They are only supported in `.ensures` etc pragmas.
 
 proc `->`*(a, b: bool): bool {.magic: "Implies".}
 proc `<->`*(a, b: bool): bool {.magic: "Iff".}
diff --git a/lib/std/sums.nim b/lib/std/sums.nim
index 5f4f74f0a..b68858ef7 100644
--- a/lib/std/sums.nim
+++ b/lib/std/sums.nim
@@ -60,7 +60,7 @@ func sumPairwise[T](x: openArray[T], i0, n: int): T =
     result = sumPairwise(x, i0, n2) + sumPairwise(x, i0 + n2, n - n2)
 
 func sumPairs*[T](x: openArray[T]): T =
-  ## Pairwise (cascade) summation of ``x[i0:i0+n-1]``, with O(log n) error growth
+  ## Pairwise (cascade) summation of `x[i0:i0+n-1]`, with O(log n) error growth
   ## (vs O(n) for a simple loop) with negligible performance cost if
   ## the base case is large enough.
   ##
diff --git a/lib/std/time_t.nim b/lib/std/time_t.nim
index 5fd2752c7..7fb6e6d46 100644
--- a/lib/std/time_t.nim
+++ b/lib/std/time_t.nim
@@ -11,7 +11,7 @@ when defined(nimdoc):
   type
     Impl = distinct int64
     Time* = Impl ## \
-      ## Wrapper for ``time_t``. On posix, this is an alias to ``posix.Time``.
+      ## Wrapper for `time_t`. On posix, this is an alias to `posix.Time`.
 elif defined(windows):
   when defined(i386) and defined(gcc):
     type Time* {.importc: "time_t", header: "<time.h>".} = distinct int32
diff --git a/lib/std/with.nim b/lib/std/with.nim
index e6784478c..79afd61a4 100644
--- a/lib/std/with.nim
+++ b/lib/std/with.nim
@@ -7,7 +7,7 @@
 #    distribution, for details about the copyright.
 #
 
-## This module implements the ``with`` macro for easy
+## This module implements the `with` macro for easy
 ## function chaining. See https://github.com/nim-lang/RFCs/issues/193
 ## and https://github.com/nim-lang/RFCs/issues/192 for details leading to this
 ## particular design.