Fix spelling errors (#10379)

This commit is contained in:
Federico Ceratto 2019-01-19 15:01:27 +00:00 • committed by Miran
commit 095eaacf21
4 changed files with 23 additions and 23 deletions

View file

@ -230,7 +230,7 @@ proc semConv(c: PContext, n: PNode): PNode =
# special case to make MyObject(x = 3) produce a nicer error message: # special case to make MyObject(x = 3) produce a nicer error message:
if n[1].kind == nkExprEqExpr and if n[1].kind == nkExprEqExpr and
targetType.skipTypes(abstractPtrs).kind == tyObject: targetType.skipTypes(abstractPtrs).kind == tyObject:
localError(c.config, n.info, "object contruction uses ':', not '='") localError(c.config, n.info, "object construction uses ':', not '='")
var op = semExprWithType(c, n.sons[1]) var op = semExprWithType(c, n.sons[1])
if targetType.isMetaType: if targetType.isMetaType:
let final = inferWithMetatype(c, targetType, op, true) let final = inferWithMetatype(c, targetType, op, true)

View file

@ -85,9 +85,9 @@ elif doslikeFileSystem:
const const
CurDir* = '.' CurDir* = '.'
ParDir* = ".." ParDir* = ".."
DirSep* = '\\' # seperator within paths DirSep* = '\\' # separator within paths
AltSep* = '/' AltSep* = '/'
PathSep* = ';' # seperator between paths PathSep* = ';' # separator between paths
FileSystemCaseSensitive* = false FileSystemCaseSensitive* = false
ExeExt* = "exe" ExeExt* = "exe"
ScriptExt* = "bat" ScriptExt* = "bat"

View file

@ -233,7 +233,7 @@ proc parseIPv4Address(addressStr: string): IpAddress =
var var
byteCount = 0 byteCount = 0
currentByte:uint16 = 0 currentByte:uint16 = 0
seperatorValid = false separatorValid = false
result.family = IpAddressFamily.IPv4 result.family = IpAddressFamily.IPv4
@ -244,20 +244,20 @@ proc parseIPv4Address(addressStr: string): IpAddress =
if currentByte > 255'u16: if currentByte > 255'u16:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Value is out of range") "Invalid IP Address. Value is out of range")
seperatorValid = true separatorValid = true
elif addressStr[i] == '.': # IPv4 address separator elif addressStr[i] == '.': # IPv4 address separator
if not seperatorValid or byteCount >= 3: if not separatorValid or byteCount >= 3:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. The address consists of too many groups") "Invalid IP Address. The address consists of too many groups")
result.address_v4[byteCount] = cast[uint8](currentByte) result.address_v4[byteCount] = cast[uint8](currentByte)
currentByte = 0 currentByte = 0
byteCount.inc byteCount.inc
seperatorValid = false separatorValid = false
else: else:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Address contains an invalid character") "Invalid IP Address. Address contains an invalid character")
if byteCount != 3 or not seperatorValid: if byteCount != 3 or not separatorValid:
raise newException(ValueError, "Invalid IP Address") raise newException(ValueError, "Invalid IP Address")
result.address_v4[byteCount] = cast[uint8](currentByte) result.address_v4[byteCount] = cast[uint8](currentByte)
@ -272,7 +272,7 @@ proc parseIPv6Address(addressStr: string): IpAddress =
groupCount = 0 groupCount = 0
currentGroupStart = 0 currentGroupStart = 0
currentShort:uint32 = 0 currentShort:uint32 = 0
seperatorValid = true separatorValid = true
dualColonGroup = -1 dualColonGroup = -1
lastWasColon = false lastWasColon = false
v4StartPos = -1 v4StartPos = -1
@ -280,15 +280,15 @@ proc parseIPv6Address(addressStr: string): IpAddress =
for i,c in addressStr: for i,c in addressStr:
if c == ':': if c == ':':
if not seperatorValid: if not separatorValid:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Address contains an invalid seperator") "Invalid IP Address. Address contains an invalid separator")
if lastWasColon: if lastWasColon:
if dualColonGroup != -1: if dualColonGroup != -1:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Address contains more than one \"::\" seperator") "Invalid IP Address. Address contains more than one \"::\" separator")
dualColonGroup = groupCount dualColonGroup = groupCount
seperatorValid = false separatorValid = false
elif i != 0 and i != high(addressStr): elif i != 0 and i != high(addressStr):
if groupCount >= 8: if groupCount >= 8:
raise newException(ValueError, raise newException(ValueError,
@ -297,7 +297,7 @@ proc parseIPv6Address(addressStr: string): IpAddress =
result.address_v6[groupCount*2+1] = cast[uint8](currentShort and 0xFF) result.address_v6[groupCount*2+1] = cast[uint8](currentShort and 0xFF)
currentShort = 0 currentShort = 0
groupCount.inc() groupCount.inc()
if dualColonGroup != -1: seperatorValid = false if dualColonGroup != -1: separatorValid = false
elif i == 0: # only valid if address starts with :: elif i == 0: # only valid if address starts with ::
if addressStr[1] != ':': if addressStr[1] != ':':
raise newException(ValueError, raise newException(ValueError,
@ -309,11 +309,11 @@ proc parseIPv6Address(addressStr: string): IpAddress =
lastWasColon = true lastWasColon = true
currentGroupStart = i + 1 currentGroupStart = i + 1
elif c == '.': # Switch to parse IPv4 mode elif c == '.': # Switch to parse IPv4 mode
if i < 3 or not seperatorValid or groupCount >= 7: if i < 3 or not separatorValid or groupCount >= 7:
raise newException(ValueError, "Invalid IP Address") raise newException(ValueError, "Invalid IP Address")
v4StartPos = currentGroupStart v4StartPos = currentGroupStart
currentShort = 0 currentShort = 0
seperatorValid = false separatorValid = false
break break
elif c in strutils.HexDigits: elif c in strutils.HexDigits:
if c in strutils.Digits: # Normal digit if c in strutils.Digits: # Normal digit
@ -326,14 +326,14 @@ proc parseIPv6Address(addressStr: string): IpAddress =
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Value is out of range") "Invalid IP Address. Value is out of range")
lastWasColon = false lastWasColon = false
seperatorValid = true separatorValid = true
else: else:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Address contains an invalid character") "Invalid IP Address. Address contains an invalid character")
if v4StartPos == -1: # Don't parse v4. Copy the remaining v6 stuff if v4StartPos == -1: # Don't parse v4. Copy the remaining v6 stuff
if seperatorValid: # Copy remaining data if separatorValid: # Copy remaining data
if groupCount >= 8: if groupCount >= 8:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. The address consists of too many groups") "Invalid IP Address. The address consists of too many groups")
@ -347,19 +347,19 @@ proc parseIPv6Address(addressStr: string): IpAddress =
if currentShort > 255'u32: if currentShort > 255'u32:
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Value is out of range") "Invalid IP Address. Value is out of range")
seperatorValid = true separatorValid = true
elif c == '.': # IPv4 address separator elif c == '.': # IPv4 address separator
if not seperatorValid or byteCount >= 3: if not separatorValid or byteCount >= 3:
raise newException(ValueError, "Invalid IP Address") raise newException(ValueError, "Invalid IP Address")
result.address_v6[groupCount*2 + byteCount] = cast[uint8](currentShort) result.address_v6[groupCount*2 + byteCount] = cast[uint8](currentShort)
currentShort = 0 currentShort = 0
byteCount.inc() byteCount.inc()
seperatorValid = false separatorValid = false
else: # Invalid character else: # Invalid character
raise newException(ValueError, raise newException(ValueError,
"Invalid IP Address. Address contains an invalid character") "Invalid IP Address. Address contains an invalid character")
if byteCount != 3 or not seperatorValid: if byteCount != 3 or not separatorValid:
raise newException(ValueError, "Invalid IP Address") raise newException(ValueError, "Invalid IP Address")
result.address_v6[groupCount*2 + byteCount] = cast[uint8](currentShort) result.address_v6[groupCount*2 + byteCount] = cast[uint8](currentShort)
groupCount += 2 groupCount += 2

View file

@ -253,7 +253,7 @@ suite "ttimes":
parseTestExcp("+1", "mm") parseTestExcp("+1", "mm")
parseTestExcp("+1", "ss") parseTestExcp("+1", "ss")
test "_ as a seperator": test "_ as a separator":
discard parse("2000_01_01", "YYYY'_'MM'_'dd") discard parse("2000_01_01", "YYYY'_'MM'_'dd")
test "dynamic timezone": test "dynamic timezone":