diff options
author | Nindaleth <Nindaleth@users.noreply.github.com> | 2019-10-30 09:08:45 +0100 |
---|---|---|
committer | Miran <narimiran@disroot.org> | 2019-10-30 09:08:45 +0100 |
commit | 34dbc5699e8cb36e26bad5a57edc972b82f26c5f (patch) | |
tree | de04803327f19ef69b46ca46b4e16a09f77fa6d1 | |
parent | 1214960a1bde9b45c76caaff0cdea7d2d753b205 (diff) | |
download | Nim-34dbc5699e8cb36e26bad5a57edc972b82f26c5f.tar.gz |
fix several typos in documentation and comments (#12553)
29 files changed, 37 insertions, 37 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index dc2e6ab3f..1b51988b8 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -592,7 +592,7 @@ proc docstringSummary(rstText: string): string = ## ## Most docstrings will contain a one liner summary, so stripping at the ## first newline is usually fine. If after that the content is still too big, - ## it is stripped at the first comma, colon or dot, usual english sentence + ## it is stripped at the first comma, colon or dot, usual English sentence ## separators. ## ## No guarantees are made on the size of the output, but it should be small. diff --git a/doc/lib.rst b/doc/lib.rst index fdf2d0f56..154c493a3 100644 --- a/doc/lib.rst +++ b/doc/lib.rst @@ -248,7 +248,7 @@ Math libraries * `fenv <fenv.html>`_ Floating-point environment. Handling of floating-point rounding and - exceptions (overflow, zero-devide, etc.). + exceptions (overflow, zero-divide, etc.). * `math <math.html>`_ Mathematical operations like cosine, square root. diff --git a/lib/experimental/diff.nim b/lib/experimental/diff.nim index d98999912..5a69687a3 100644 --- a/lib/experimental/diff.nim +++ b/lib/experimental/diff.nim @@ -233,7 +233,7 @@ proc lcs(dataA: var DiffData; lowerA, upperA: int; dataB: var DiffData; lowerB, inc lowerA else: - # Find the middle snakea and length of an optimal path for A and B + # Find the middle snake and length of an optimal path for A and B let smsrd = sms(dataA, lowerA, upperA, dataB, lowerB, upperB, downVector, upVector) # Debug.Write(2, "MiddleSnakeData", String.Format("{0},{1}", smsrd.x, smsrd.y)) diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim index 22f786cd6..f0b3074f9 100644 --- a/lib/impure/nre.nim +++ b/lib/impure/nre.nim @@ -215,7 +215,7 @@ type pattern*: string ## the pattern that caused the problem StudyError* = ref object of RegexError - ## Thrown when studying the regular expression failes + ## Thrown when studying the regular expression fails ## for whatever reason. The message contains the error ## code. diff --git a/lib/nimhcr.nim b/lib/nimhcr.nim index 396747527..0f9ae918d 100644 --- a/lib/nimhcr.nim +++ b/lib/nimhcr.nim @@ -77,7 +77,7 @@ # - named `performCodeReload`, requires the hotcodereloading module # - explicitly called by the user - the current active callstack shouldn't contain # any functions which are defined in modules that will be reloaded (or crash!). -# The reason is that old dynalic libraries get unloaded. +# The reason is that old dynamic libraries get unloaded. # Example: # if A is the main module and it imports B, then only B is reloadable and only # if when calling hcrPerformCodeReload there is no function defined in B in the @@ -549,7 +549,7 @@ when defined(createNimHcr): # problems when the GC is executed while the reload is underway. # Future versions of NIMHCR won't use the GC, because all globals and the # metadata needed to access them will be placed in shared memory, so they - # can be manipulted from external programs without reloading. + # can be manipulated from external programs without reloading. GC_disable() defer: GC_enable() diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index 26222d951..eaefc7265 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -1605,7 +1605,7 @@ proc dirCodeBlock(p: var RstParser, nimExtension = false): PRstNode = ## <http://docutils.sourceforge.net/docs/ref/rst/directives.html#code>`_ and ## the nim extension ``.. code-block::``. If the block is an extension, we ## want the default language syntax highlighting to be Nim, so we create a - ## fake internal field to comminicate with the generator. The field is named + ## fake internal field to communicate with the generator. The field is named ## ``default-language``, which is unlikely to collide with a field specified ## by any random rst input file. ## diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index f9fd9e32b..abbf99fed 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -660,7 +660,7 @@ proc mergeIndexes*(dir: string): string = ## As convention this proc will split index files into two categories: ## documentation and API. API indices will be all joined together into a ## single big sorted index, making the bulk of the final index. This is good - ## for API documentation because many symbols are repated in different + ## for API documentation because many symbols are repeated in different ## modules. On the other hand, documentation indices are essentially table of ## contents plus a few special markers. These documents will be rendered in a ## separate section which tries to maintain the order and hierarchy of the diff --git a/lib/posix/posix_macos_amd64.nim b/lib/posix/posix_macos_amd64.nim index 41522fd17..0687267f0 100644 --- a/lib/posix/posix_macos_amd64.nim +++ b/lib/posix/posix_macos_amd64.nim @@ -562,7 +562,7 @@ when defined(macosx): var SO_NOSIGPIPE* {.importc, header: "<sys/socket.h>".}: cint elif defined(solaris): - # Solaris dont have MSG_NOSIGNAL + # Solaris doesn't have MSG_NOSIGNAL const MSG_NOSIGNAL* = 0'i32 else: diff --git a/lib/posix/posix_other.nim b/lib/posix/posix_other.nim index c582240d1..e42092513 100644 --- a/lib/posix/posix_other.nim +++ b/lib/posix/posix_other.nim @@ -572,7 +572,7 @@ when defined(macosx): var SO_NOSIGPIPE* {.importc, header: "<sys/socket.h>".}: cint elif defined(solaris): - # Solaris dont have MSG_NOSIGNAL + # Solaris doesn't have MSG_NOSIGNAL const MSG_NOSIGNAL* = 0'i32 else: diff --git a/lib/pure/bitops.nim b/lib/pure/bitops.nim index 710c8590a..9ebdabb7b 100644 --- a/lib/pure/bitops.nim +++ b/lib/pure/bitops.nim @@ -173,7 +173,7 @@ proc fastlog2Nim(x: uint64): int {.inline, noSideEffect.} = result = lookup[(v * 0x03F6EAF2CD271461'u64) shr 58].int # sets.nim cannot import bitops, but bitops can use include -# system/sets to eleminate code duplication. sets.nim defines defines +# system/sets to eliminate code duplication. sets.nim defines # countBits32 and countBits64. include system/sets diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 0207c2bde..9573753ff 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -1361,7 +1361,7 @@ when isMainModule: doAssert foo1(openArray[int]([identity(1), identity(2)])) == @[10, 20] doAssert counter == 2 - # Corner cases (openArray litterals should not be common) + # Corner cases (openArray literals should not be common) template foo2(x: openArray[int]): seq[int] = x.mapIt(it * 10) counter = 0 doAssert foo2(openArray[int]([identity(1), identity(2)])) == @[10, 20] diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index 930b7f0ed..9dd72cb56 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -904,7 +904,7 @@ proc `$`*[A](s: OrderedSet[A]): string = iterator items*[A](s: OrderedSet[A]): A = ## Iterates over keys in the ordered set `s` in insertion order. ## - ## If you need a sequence with the elelments you can use `sequtils.toSeq + ## If you need a sequence with the elements you can use `sequtils.toSeq ## template <sequtils.html#toSeq.t,untyped>`_. ## ## .. code-block:: diff --git a/lib/pure/colors.nim b/lib/pure/colors.nim index 1332b0738..57ae171dc 100644 --- a/lib/pure/colors.nim +++ b/lib/pure/colors.nim @@ -49,7 +49,7 @@ proc satMinus(a, b: int): int {.inline.} = proc `+`*(a, b: Color): Color = ## Adds two colors. ## - ## This uses saturated artithmetic, so that each color + ## This uses saturated arithmetic, so that each color ## component cannot overflow (255 is used as a maximum). ## runnableExamples: @@ -63,7 +63,7 @@ proc `+`*(a, b: Color): Color = proc `-`*(a, b: Color): Color = ## Subtracts two colors. ## - ## This uses saturated artithmetic, so that each color + ## This uses saturated arithmetic, so that each color ## component cannot underflow (0 is used as a minimum). ## runnableExamples: diff --git a/lib/pure/encodings.nim b/lib/pure/encodings.nim index 25e779217..e3be1764b 100644 --- a/lib/pure/encodings.nim +++ b/lib/pure/encodings.nim @@ -468,7 +468,7 @@ proc convert*(s: string, destEncoding = "UTF-8", srcEncoding = "CP1252"): string = ## converts `s` to `destEncoding`. It assumed that `s` is in `srcEncoding`. ## This opens a converter, uses it and closes it again and is thus more - ## convienent but also likely less efficient than re-using a converter. + ## convenient but also likely less efficient than re-using a converter. ## utf-16BE, utf-32 conversions not supported on windows var c = open(destEncoding, srcEncoding) try: diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 72002fbab..4e88b6528 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -99,7 +99,7 @@ ## Unmarshalling ## ------------- ## -## In addition to reading dynamic data, Nim can also unmarshall JSON directly +## In addition to reading dynamic data, Nim can also unmarshal JSON directly ## into a type with the ``to`` macro. ## ## .. code-block:: Nim diff --git a/lib/pure/math.nim b/lib/pure/math.nim index ee78b6c91..224791e5d 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -43,7 +43,7 @@ ## * `rationals module<rationals.html>`_ for rational numbers and their ## mathematical operations ## * `fenv module<fenv.html>`_ for handling of floating-point rounding -## and exceptions (overflow, zero-devide, etc.) +## and exceptions (overflow, zero-divide, etc.) ## * `random module<random.html>`_ for fast and tiny random number generator ## * `mersenne module<mersenne.html>`_ for Mersenne twister random number generator ## * `stats module<stats.html>`_ for statistical analysis diff --git a/lib/pure/os.nim b/lib/pure/os.nim index b27eee782..a43a9cb32 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -3025,7 +3025,7 @@ proc getFileInfo*(handle: FileHandle): FileInfo {.noNimScript.} = when defined(Windows): var rawInfo: BY_HANDLE_FILE_INFORMATION # We have to use the super special '_get_osfhandle' call (wrapped above) - # To transform the C file descripter to a native file handle. + # To transform the C file descriptor to a native file handle. var realHandle = get_osfhandle(handle) if getFileInformationByHandle(realHandle, addr rawInfo) == 0: raiseOSError(osLastError()) diff --git a/lib/system.nim b/lib/system.nim index 663ac1f66..54ced6c7c 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -800,7 +800,7 @@ type ## Raised if an array index is out of bounds. FieldError* = object of Defect ## \ - ## Raised if a record field is not accessible because its dicriminant's + ## Raised if a record field is not accessible because its discriminant's ## value does not fit. RangeError* = object of Defect ## \ ## Raised if a range check error occurred. @@ -1646,7 +1646,7 @@ proc `+`*[T](x, y: set[T]): set[T] {.magic: "PlusSet", noSideEffect.} ## b = {2, 3, 4} ## echo a + b # => {1, 2, 3, 4} proc `-`*[T](x, y: set[T]): set[T] {.magic: "MinusSet", noSideEffect.} - ## This operator computes the diference of two sets. + ## This operator computes the difference of two sets. ## ## .. code-block:: Nim ## let @@ -2230,13 +2230,13 @@ type BiggestInt* = int64 ## is an alias for the biggest signed integer type the Nim compiler - ## supports. Currently this is ``int64``, but it is platform-dependant + ## supports. Currently this is ``int64``, but it is platform-dependent ## in general. BiggestFloat* = float64 ## is an alias for the biggest floating point type the Nim ## compiler supports. Currently this is ``float64``, but it is - ## platform-dependant in general. + ## platform-dependent in general. when defined(JS): type BiggestUInt* = uint32 diff --git a/lib/system/gc_regions.nim b/lib/system/gc_regions.nim index 797eeeebf..b7d1d302b 100644 --- a/lib/system/gc_regions.nim +++ b/lib/system/gc_regions.nim @@ -213,7 +213,7 @@ proc dealloc(r: var MemRegion; p: pointer; size: int) = if it.typ != nil and it.typ.finalizer != nil: (cast[Finalizer](it.typ.finalizer))(p) it.typ = nil - # it is benefitial to not use the free lists here: + # it is beneficial to not use the free lists here: if r.bump -! size == p: dec r.bump, size when false: diff --git a/lib/system/io.nim b/lib/system/io.nim index a3ac235a9..76bf41b11 100644 --- a/lib/system/io.nim +++ b/lib/system/io.nim @@ -115,8 +115,8 @@ proc c_fprintf(f: File, frmt: cstring): cint {. proc c_fputc(c: char, f: File): cint {. importc: "fputc", header: "<stdio.h>".} -## When running nim in android app stdout goes no where, so echo gets ignored -## To redreict echo to the android logcat use -d:androidNDK +## When running nim in android app, stdout goes nowhere, so echo gets ignored +## To redirect echo to the android logcat, use -d:androidNDK when defined(androidNDK): const ANDROID_LOG_VERBOSE = 2.cint proc android_log_print(prio: cint, tag: cstring, fmt: cstring): cint diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index 6201a1c74..853397e0a 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -325,7 +325,7 @@ proc setLengthSeq(seq: PGenericSeq, elemSize, newLen: int): PGenericSeq {. # cell is aliased by another pointer (ie proc parameter or a let variable). # This is a tough problem, because even if we don't zeroMem here, in the # presence of user defined destructors, the user will expect the cell to be - # "destroyed" thus creating the same problem. We can destoy the cell in the + # "destroyed" thus creating the same problem. We can destroy the cell in the # finalizer of the sequence, but this makes destruction non-deterministic. zeroMem(cast[pointer](cast[ByteAddress](result) +% GenericSeqSize +% (newLen*%elemSize)), (result.len-%newLen) *% elemSize) @@ -361,7 +361,7 @@ proc setLengthSeqV2(s: PGenericSeq, typ: PNimType, newLen: int): PGenericSeq {. # cell is aliased by another pointer (ie proc parameter or a let variable). # This is a tough problem, because even if we don't zeroMem here, in the # presence of user defined destructors, the user will expect the cell to be - # "destroyed" thus creating the same problem. We can destoy the cell in the + # "destroyed" thus creating the same problem. We can destroy the cell in the # finalizer of the sequence, but this makes destruction non-deterministic. zeroMem(cast[pointer](cast[ByteAddress](result) +% GenericSeqSize +% (newLen*%elemSize)), (result.len-%newLen) *% elemSize) diff --git a/lib/wrappers/iup.nim b/lib/wrappers/iup.nim index dee2e14c7..1a9e6ab3e 100644 --- a/lib/wrappers/iup.nim +++ b/lib/wrappers/iup.nim @@ -57,7 +57,7 @@ type Icallback* = proc (arg: PIhandle): cint {.cdecl.} -# pre-defineded dialogs +# pre-defined dialogs proc fileDlg*: PIhandle {.importc: "IupFileDlg", dynlib: dllname, cdecl.} proc messageDlg*: PIhandle {.importc: "IupMessageDlg", dynlib: dllname, cdecl.} proc colorDlg*: PIhandle {.importc: "IupColorDlg", dynlib: dllname, cdecl.} diff --git a/lib/wrappers/mysql.nim b/lib/wrappers/mysql.nim index 1f523ac5f..f8d4739ae 100644 --- a/lib/wrappers/mysql.nim +++ b/lib/wrappers/mysql.nim @@ -579,7 +579,7 @@ type STATUS_READY, STATUS_GET_RESULT, STATUS_USE_RESULT Protocol_type* = enum # There are three types of queries - the ones that have to go to # the master, the ones that go to a slave, and the administrative - # type which must happen on the pivot connectioin + # type which must happen on the pivot connection PROTOCOL_DEFAULT, PROTOCOL_TCP, PROTOCOL_SOCKET, PROTOCOL_PIPE, PROTOCOL_MEMORY Rpl_type* = enum diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim index 482062617..cfe18b5c8 100644 --- a/lib/wrappers/openssl.nim +++ b/lib/wrappers/openssl.nim @@ -31,7 +31,7 @@ const useWinVersion = defined(Windows) or defined(nimdoc) # To force openSSL version use -d:sslVersion=1.0.0 # See: #10281, #10230 # General issue: -# Other dynamic libraries (like libpg) load diffetent openSSL version then what nim loads. +# Other dynamic libraries (like libpg) load different openSSL version then what nim loads. # Having two different openSSL loaded version causes a crash. # Use this compile time define to force the openSSL version that your other dynamic libraries want. const sslVersion {.strdefine.}: string = "" diff --git a/tests/gc/gcbench.nim b/tests/gc/gcbench.nim index 335e44095..9de558234 100644 --- a/tests/gc/gcbench.nim +++ b/tests/gc/gcbench.nim @@ -44,7 +44,7 @@ discard """ # - No way to check on memory use # - No cyclic data structures # - No attempt to measure variation with object size -# - Results are sensitive to locking cost, but we dont +# - Results are sensitive to locking cost, but we don't # check for proper locking # diff --git a/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim b/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim index b36b49823..d91f1cb35 100644 --- a/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim +++ b/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim @@ -114,7 +114,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped = packBody.add(newCall("pack", streamID, dotName)) readBody.add(resName := newCall("read" & $typeFields[i][1].ident, streamID)) else: - error("I dont know what to do with: " & treerepr(typeFields[i])) + error("I don't know what to do with: " & treerepr(typeFields[i])) var toStringFunc = newNimNode(nnkProcDef).und( diff --git a/tests/misc/tunsignedconv.nim b/tests/misc/tunsignedconv.nim index efe5f1302..17d137947 100644 --- a/tests/misc/tunsignedconv.nim +++ b/tests/misc/tunsignedconv.nim @@ -23,7 +23,7 @@ when false: var d32 = v8 + 10'i32 when false: - # these dont work yet because unsigned.nim is stupid. XXX We need to fix this. + # these don't work yet because unsigned.nim is stupid. XXX We need to fix this. var f8 = v16 + 10'u8 var f16 = v16 + 10'u16 var f32 = v16 + 10'u32 diff --git a/tests/objvariant/tadrdisc.nim b/tests/objvariant/tadrdisc.nim index a68dddf66..5e4e39a44 100644 --- a/tests/objvariant/tadrdisc.nim +++ b/tests/objvariant/tadrdisc.nim @@ -3,7 +3,7 @@ discard """ file: "tadrdisc.nim" line: 20 """ -# Test that the address of a dicriminants cannot be taken +# Test that the address of a discriminants cannot be taken type TKind = enum ka, kb, kc diff --git a/tests/tuples/tuple_with_nil.nim b/tests/tuples/tuple_with_nil.nim index 67d45254f..b3ed2a96b 100644 --- a/tests/tuples/tuple_with_nil.nim +++ b/tests/tuples/tuple_with_nil.nim @@ -87,7 +87,7 @@ proc has(c: Captures; i: range[0..pegs.MaxSubpatterns-1]): bool {.nosideeffect, result = b.first <= b.last proc get(str: string; c: Captures; i: range[0..MaxSubpatterns-1]; def: char): char {.nosideeffect, inline.} = - ## If capture `i` is non-empty return that portion of `str` casted + ## If capture `i` is non-empty return that portion of `str` cast ## to `char`, otherwise return `def`. result = if c.has(i): str[c.bounds(i).first] else: def @@ -344,7 +344,7 @@ proc writeformat(o: var Writer; p: pointer; fmt: Format) = ## Write pointer `i` according to format `fmt` using output object ## `o` and output function `add`. ## - ## Pointers are casted to unsigned int and formatted as hexadecimal + ## Pointers are cast to unsigned int and formatted as hexadecimal ## with prefix unless specified otherwise. var f = fmt if f.typ == 0.char: |