Fix typos
This commit is contained in:
parent
d8c4c57637
commit
c95f6f117a
49 changed files with 115 additions and 115 deletions
|
|
@ -76,7 +76,7 @@ type
|
|||
TNimrodTypeKind* = enum
|
||||
ntyNone, ntyBool, ntyChar, ntyEmpty,
|
||||
ntyArrayConstr, ntyNil, ntyExpr, ntyStmt,
|
||||
ntyTypeDesc, ntyGenericInvokation, ntyGenericBody, ntyGenericInst,
|
||||
ntyTypeDesc, ntyGenericInvocation, ntyGenericBody, ntyGenericInst,
|
||||
ntyGenericParam, ntyDistinct, ntyEnum, ntyOrdinal,
|
||||
ntyArray, ntyObject, ntyTuple, ntySet,
|
||||
ntyRange, ntyPtr, ntyRef, ntyVar,
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ template foldl*(sequence, operation: expr): expr =
|
|||
##
|
||||
## The ``operation`` parameter should be an expression which uses the
|
||||
## variables ``a`` and ``b`` for each step of the fold. Since this is a left
|
||||
## fold, for non associative binary operations like substraction think that
|
||||
## fold, for non associative binary operations like subtraction think that
|
||||
## the sequence of numbers 1, 2 and 3 will be parenthesized as (((1) - 2) -
|
||||
## 3). Example:
|
||||
##
|
||||
|
|
@ -328,12 +328,12 @@ template foldl*(sequence, operation: expr): expr =
|
|||
## let
|
||||
## numbers = @[5, 9, 11]
|
||||
## addition = foldl(numbers, a + b)
|
||||
## substraction = foldl(numbers, a - b)
|
||||
## subtraction = foldl(numbers, a - b)
|
||||
## multiplication = foldl(numbers, a * b)
|
||||
## words = @["nim", "is", "cool"]
|
||||
## concatenation = foldl(words, a & b)
|
||||
## assert addition == 25, "Addition is (((5)+9)+11)"
|
||||
## assert substraction == -15, "Substraction is (((5)-9)-11)"
|
||||
## assert subtraction == -15, "Substraction is (((5)-9)-11)"
|
||||
## assert multiplication == 495, "Multiplication is (((5)*9)*11)"
|
||||
## assert concatenation == "nimiscool"
|
||||
assert sequence.len > 0, "Can't fold empty sequences"
|
||||
|
|
@ -356,7 +356,7 @@ template foldr*(sequence, operation: expr): expr =
|
|||
##
|
||||
## The ``operation`` parameter should be an expression which uses the
|
||||
## variables ``a`` and ``b`` for each step of the fold. Since this is a right
|
||||
## fold, for non associative binary operations like substraction think that
|
||||
## fold, for non associative binary operations like subtraction think that
|
||||
## the sequence of numbers 1, 2 and 3 will be parenthesized as (1 - (2 -
|
||||
## (3))). Example:
|
||||
##
|
||||
|
|
@ -364,12 +364,12 @@ template foldr*(sequence, operation: expr): expr =
|
|||
## let
|
||||
## numbers = @[5, 9, 11]
|
||||
## addition = foldr(numbers, a + b)
|
||||
## substraction = foldr(numbers, a - b)
|
||||
## subtraction = foldr(numbers, a - b)
|
||||
## multiplication = foldr(numbers, a * b)
|
||||
## words = @["nim", "is", "cool"]
|
||||
## concatenation = foldr(words, a & b)
|
||||
## assert addition == 25, "Addition is (5+(9+(11)))"
|
||||
## assert substraction == 7, "Substraction is (5-(9-(11)))"
|
||||
## assert subtraction == 7, "Substraction is (5-(9-(11)))"
|
||||
## assert multiplication == 495, "Multiplication is (5*(9*(11)))"
|
||||
## assert concatenation == "nimiscool"
|
||||
assert sequence.len > 0, "Can't fold empty sequences"
|
||||
|
|
@ -507,12 +507,12 @@ when isMainModule:
|
|||
let
|
||||
numbers = @[5, 9, 11]
|
||||
addition = foldl(numbers, a + b)
|
||||
substraction = foldl(numbers, a - b)
|
||||
subtraction = foldl(numbers, a - b)
|
||||
multiplication = foldl(numbers, a * b)
|
||||
words = @["nim", "is", "cool"]
|
||||
concatenation = foldl(words, a & b)
|
||||
assert addition == 25, "Addition is (((5)+9)+11)"
|
||||
assert substraction == -15, "Substraction is (((5)-9)-11)"
|
||||
assert subtraction == -15, "Substraction is (((5)-9)-11)"
|
||||
assert multiplication == 495, "Multiplication is (((5)*9)*11)"
|
||||
assert concatenation == "nimiscool"
|
||||
|
||||
|
|
@ -520,12 +520,12 @@ when isMainModule:
|
|||
let
|
||||
numbers = @[5, 9, 11]
|
||||
addition = foldr(numbers, a + b)
|
||||
substraction = foldr(numbers, a - b)
|
||||
subtraction = foldr(numbers, a - b)
|
||||
multiplication = foldr(numbers, a * b)
|
||||
words = @["nim", "is", "cool"]
|
||||
concatenation = foldr(words, a & b)
|
||||
assert addition == 25, "Addition is (5+(9+(11)))"
|
||||
assert substraction == 7, "Substraction is (5-(9-(11)))"
|
||||
assert subtraction == 7, "Substraction is (5-(9-(11)))"
|
||||
assert multiplication == 495, "Multiplication is (5*(9*(11)))"
|
||||
assert concatenation == "nimiscool"
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ proc parseColor*(name: string): Color =
|
|||
result = Color(parseHexInt(name))
|
||||
else:
|
||||
var idx = binaryStrSearch(colorNames, name)
|
||||
if idx < 0: raise newException(ValueError, "unkown color: " & name)
|
||||
if idx < 0: raise newException(ValueError, "unknown color: " & name)
|
||||
result = colorNames[idx][1]
|
||||
|
||||
proc isColor*(name: string): bool =
|
||||
|
|
|
|||
|
|
@ -552,7 +552,7 @@ proc parse(x: var XmlParser, errors: var seq[string]): XmlNode =
|
|||
proc parseHtml*(s: Stream, filename: string,
|
||||
errors: var seq[string]): XmlNode =
|
||||
## parses the XML from stream `s` and returns a ``PXmlNode``. Every
|
||||
## occured parsing error is added to the `errors` sequence.
|
||||
## occurred parsing error is added to the `errors` sequence.
|
||||
var x: XmlParser
|
||||
open(x, s, filename, {reportComments, reportWhitespace})
|
||||
next(x)
|
||||
|
|
@ -581,7 +581,7 @@ proc parseHtml*(s: Stream): XmlNode =
|
|||
|
||||
proc loadHtml*(path: string, errors: var seq[string]): XmlNode =
|
||||
## Loads and parses HTML from file specified by ``path``, and returns
|
||||
## a ``PXmlNode``. Every occured parsing error is added to
|
||||
## a ``PXmlNode``. Every occurred parsing error is added to
|
||||
## the `errors` sequence.
|
||||
var s = newFileStream(path, fmRead)
|
||||
if s == nil: raise newException(IOError, "Unable to read file: " & path)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ import
|
|||
|
||||
type
|
||||
JsonEventKind* = enum ## enumeration of all events that may occur when parsing
|
||||
jsonError, ## an error ocurred during parsing
|
||||
jsonError, ## an error occurred during parsing
|
||||
jsonEof, ## end of file reached
|
||||
jsonString, ## a string literal
|
||||
jsonInt, ## an integer literal
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ proc socketError*(socket: Socket, err: int = -1, async = false,
|
|||
of SSL_ERROR_WANT_X509_LOOKUP:
|
||||
raiseSSLError("Function for x509 lookup has been called.")
|
||||
of SSL_ERROR_SYSCALL:
|
||||
var errStr = "IO error has occured "
|
||||
var errStr = "IO error has occurred "
|
||||
let sslErr = ErrPeekLastError()
|
||||
if sslErr == 0 and err == 0:
|
||||
errStr.add "because an EOF was observed that violates the protocol"
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ const
|
|||
proc osErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} =
|
||||
## Retrieves the operating system's error flag, ``errno``.
|
||||
## On Windows ``GetLastError`` is checked before ``errno``.
|
||||
## Returns "" if no error occured.
|
||||
## Returns "" if no error occurred.
|
||||
##
|
||||
## **Deprecated since version 0.9.4**: use the other ``osErrorMsg`` proc.
|
||||
|
||||
|
|
@ -1099,7 +1099,7 @@ when defined(windows):
|
|||
var
|
||||
env = getEnvironmentStringsW()
|
||||
e = env
|
||||
if e == nil: return # an error occured
|
||||
if e == nil: return # an error occurred
|
||||
while true:
|
||||
var eend = strEnd(e)
|
||||
add(environment, $e)
|
||||
|
|
@ -1110,7 +1110,7 @@ when defined(windows):
|
|||
var
|
||||
env = getEnvironmentStringsA()
|
||||
e = env
|
||||
if e == nil: return # an error occured
|
||||
if e == nil: return # an error occurred
|
||||
while true:
|
||||
var eend = strEnd(e)
|
||||
add(environment, $e)
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ proc startProcess*(command: string,
|
|||
## of `args` to `command` carefully escaping/quoting any special characters,
|
||||
## since it will be passed *as is* to the system shell. Each system/shell may
|
||||
## feature different escaping rules, so try to avoid this kind of shell
|
||||
## invokation if possible as it leads to non portable software.
|
||||
## invocation if possible as it leads to non portable software.
|
||||
##
|
||||
## Return value: The newly created process object. Nil is never returned,
|
||||
## but ``EOS`` is raised in case of an error.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ type
|
|||
cfgSectionStart, ## a ``[section]`` has been parsed
|
||||
cfgKeyValuePair, ## a ``key=value`` pair has been detected
|
||||
cfgOption, ## a ``--key=value`` command line option
|
||||
cfgError ## an error ocurred during parsing
|
||||
cfgError ## an error occurred during parsing
|
||||
|
||||
CfgEvent* = object of RootObj ## describes a parsing event
|
||||
case kind*: CfgEventKind ## the kind of the event
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ proc parseBiggestFloat*(s: string, number: var BiggestFloat, start = 0): int {.
|
|||
proc parseFloat*(s: string, number: var float, start = 0): int {.
|
||||
rtl, extern: "npuParseFloat", noSideEffect.} =
|
||||
## parses a float starting at `start` and stores the value into `number`.
|
||||
## Result is the number of processed chars or 0 if there occured a parsing
|
||||
## Result is the number of processed chars or 0 if there occurred a parsing
|
||||
## error.
|
||||
var bf: BiggestFloat
|
||||
result = parseBiggestFloat(s, bf, start)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ import
|
|||
|
||||
type
|
||||
XmlEventKind* = enum ## enumation of all events that may occur when parsing
|
||||
xmlError, ## an error ocurred during parsing
|
||||
xmlError, ## an error occurred during parsing
|
||||
xmlEof, ## end of file reached
|
||||
xmlCharData, ## character data
|
||||
xmlWhitespace, ## whitespace has been parsed
|
||||
|
|
|
|||
|
|
@ -1467,7 +1467,7 @@ proc recvAsync*(socket: Socket, s: var TaintedString): bool {.
|
|||
of SSL_ERROR_ZERO_RETURN:
|
||||
raiseSslError("TLS/SSL connection failed to initiate, socket closed prematurely.")
|
||||
of SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT:
|
||||
raiseSslError("Unexpected error occured.") # This should just not happen.
|
||||
raiseSslError("Unexpected error occurred.") # This should just not happen.
|
||||
of SSL_ERROR_WANT_WRITE, SSL_ERROR_WANT_READ:
|
||||
return false
|
||||
of SSL_ERROR_WANT_X509_LOOKUP:
|
||||
|
|
@ -1610,7 +1610,7 @@ proc sendAsync*(socket: Socket, data: string): int {.tags: [WriteIOEffect].} =
|
|||
of SSL_ERROR_ZERO_RETURN:
|
||||
raiseSslError("TLS/SSL connection failed to initiate, socket closed prematurely.")
|
||||
of SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT:
|
||||
raiseSslError("Unexpected error occured.") # This should just not happen.
|
||||
raiseSslError("Unexpected error occurred.") # This should just not happen.
|
||||
of SSL_ERROR_WANT_WRITE, SSL_ERROR_WANT_READ:
|
||||
return 0
|
||||
of SSL_ERROR_WANT_X509_LOOKUP:
|
||||
|
|
|
|||
|
|
@ -122,41 +122,41 @@ proc read[T](s: Stream, result: var T) =
|
|||
raise newEIO("cannot read from stream")
|
||||
|
||||
proc readChar*(s: Stream): char =
|
||||
## reads a char from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads a char from the stream `s`. Raises `EIO` if an error occurred.
|
||||
## Returns '\0' as an EOF marker.
|
||||
if readData(s, addr(result), sizeof(result)) != 1: result = '\0'
|
||||
|
||||
proc readBool*(s: Stream): bool =
|
||||
## reads a bool from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads a bool from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readInt8*(s: Stream): int8 =
|
||||
## reads an int8 from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads an int8 from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readInt16*(s: Stream): int16 =
|
||||
## reads an int16 from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads an int16 from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readInt32*(s: Stream): int32 =
|
||||
## reads an int32 from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads an int32 from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readInt64*(s: Stream): int64 =
|
||||
## reads an int64 from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads an int64 from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readFloat32*(s: Stream): float32 =
|
||||
## reads a float32 from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads a float32 from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readFloat64*(s: Stream): float64 =
|
||||
## reads a float64 from the stream `s`. Raises `EIO` if an error occured.
|
||||
## reads a float64 from the stream `s`. Raises `EIO` if an error occurred.
|
||||
read(s, result)
|
||||
|
||||
proc readStr*(s: Stream, length: int): TaintedString =
|
||||
## reads a string of length `length` from the stream `s`. Raises `EIO` if
|
||||
## an error occured.
|
||||
## an error occurred.
|
||||
result = newString(length).TaintedString
|
||||
var L = readData(s, addr(string(result)[0]), length)
|
||||
if L != length: setLen(result.string, L)
|
||||
|
|
@ -183,7 +183,7 @@ proc readLine*(s: Stream, line: var TaintedString): bool =
|
|||
|
||||
proc readLine*(s: Stream): TaintedString =
|
||||
## Reads a line from a stream `s`. Note: This is not very efficient. Raises
|
||||
## `EIO` if an error occured.
|
||||
## `EIO` if an error occurred.
|
||||
result = TaintedString""
|
||||
while true:
|
||||
var c = readChar(s)
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ proc parse(x: var XmlParser, errors: var seq[string]): XmlNode =
|
|||
proc parseXml*(s: Stream, filename: string,
|
||||
errors: var seq[string]): XmlNode =
|
||||
## parses the XML from stream `s` and returns a ``PXmlNode``. Every
|
||||
## occured parsing error is added to the `errors` sequence.
|
||||
## occurred parsing error is added to the `errors` sequence.
|
||||
var x: XmlParser
|
||||
open(x, s, filename, {reportComments})
|
||||
while true:
|
||||
|
|
@ -129,7 +129,7 @@ proc parseXml*(s: Stream): XmlNode =
|
|||
|
||||
proc loadXml*(path: string, errors: var seq[string]): XmlNode =
|
||||
## Loads and parses XML from file specified by ``path``, and returns
|
||||
## a ``PXmlNode``. Every occured parsing error is added to the `errors`
|
||||
## a ``PXmlNode``. Every occurred parsing error is added to the `errors`
|
||||
## sequence.
|
||||
var s = newFileStream(path, fmRead)
|
||||
if s == nil: raise newException(IOError, "Unable to read file: " & path)
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ type
|
|||
##
|
||||
## See the full `exception hierarchy`_.
|
||||
IOError* = object of SystemError ## \
|
||||
## Raised if an IO error occured.
|
||||
## Raised if an IO error occurred.
|
||||
##
|
||||
## See the full `exception hierarchy`_.
|
||||
OSError* = object of SystemError ## \
|
||||
|
|
@ -374,7 +374,7 @@ type
|
|||
##
|
||||
## See the full `exception hierarchy`_.
|
||||
ArithmeticError* = object of Exception ## \
|
||||
## Raised if any kind of arithmetic error occured.
|
||||
## Raised if any kind of arithmetic error occurred.
|
||||
##
|
||||
## See the full `exception hierarchy`_.
|
||||
DivByZeroError* = object of ArithmeticError ## \
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ type
|
|||
tyExpr,
|
||||
tyStmt,
|
||||
tyTypeDesc,
|
||||
tyGenericInvokation, # ``T[a, b]`` for types to invoke
|
||||
tyGenericInvocation, # ``T[a, b]`` for types to invoke
|
||||
tyGenericBody, # ``T[a, b, body]`` last parameter is the body
|
||||
tyGenericInst, # ``T[a, b, realInstance]`` instantiated generic type
|
||||
tyGenericParam, # ``a`` in the example
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ noclean:
|
|||
|
||||
// If the return value pointer is NULL, assume no return value.
|
||||
/*
|
||||
Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction,
|
||||
Intel asm is weird. We have to explicitly specify 'DWORD PTR' in the nexr instruction,
|
||||
otherwise only one BYTE will be compared (instead of a DWORD)!
|
||||
*/
|
||||
cmp DWORD PTR [ebp + 24], 0
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ proc server_init*(argc: cint, argv: cstringArray, groups: cstringArray): cint{.
|
|||
proc server_end*(){.cdecl, dynlib: lib, importc: "mysql_server_end".}
|
||||
# mysql_server_init/end need to be called when using libmysqld or
|
||||
# libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
|
||||
# you don't need to call it explicitely; but you need to call
|
||||
# you don't need to call it explicitly; but you need to call
|
||||
# mysql_server_end() to free memory). The names are a bit misleading
|
||||
# (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
|
||||
# names which suit well whether you're using libmysqld or libmysqlclient. We
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ proc history_truncate_file*(a2: cstring, a3: cint): cint{.cdecl,
|
|||
# -1) If there was an error in expansion.
|
||||
# 2) If the returned line should just be printed.
|
||||
#
|
||||
# If an error ocurred in expansion, then OUTPUT contains a descriptive
|
||||
# If an error occurred in expansion, then OUTPUT contains a descriptive
|
||||
# error message.
|
||||
|
||||
proc history_expand*(a2: cstring, a3: cstringArray): cint{.cdecl,
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ extern int history_truncate_file PARAMS((const char *, int));
|
|||
-1) If there was an error in expansion.
|
||||
2) If the returned line should just be printed.
|
||||
|
||||
If an error ocurred in expansion, then OUTPUT contains a descriptive
|
||||
If an error occurred in expansion, then OUTPUT contains a descriptive
|
||||
error message. */
|
||||
extern int history_expand PARAMS((char *, char **));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue