case consistency part 3

This commit is contained in:
Araq 2013-12-27 21:46:43 +01:00
commit 706266d8b7
3 changed files with 9 additions and 9 deletions

View file

@ -1068,7 +1068,7 @@ proc newProcNode*(kind: TNodeKind, info: TLineInfo, body: PNode,
pragmas, exceptions, body] pragmas, exceptions, body]
proc NewType(kind: TTypeKind, owner: PSym): PType = proc newType(kind: TTypeKind, owner: PSym): PType =
new(result) new(result)
result.kind = kind result.kind = kind
result.owner = owner result.owner = owner
@ -1161,7 +1161,7 @@ proc newSym(symKind: TSymKind, Name: PIdent, owner: PSym,
result.offset = - 1 result.offset = - 1
result.id = getID() result.id = getID()
when debugIds: when debugIds:
RegisterId(result) registerId(result)
#if result.id < 2000: #if result.id < 2000:
# MessageOut(name.s & " has id: " & toString(result.id)) # MessageOut(name.s & " has id: " & toString(result.id))
@ -1276,7 +1276,7 @@ proc copyNode(src: PNode): PNode =
of nkSym: result.sym = src.sym of nkSym: result.sym = src.sym
of nkIdent: result.ident = src.ident of nkIdent: result.ident = src.ident
of nkStrLit..nkTripleStrLit: result.strVal = src.strVal of nkStrLit..nkTripleStrLit: result.strVal = src.strVal
else: nil else: discard
proc shallowCopy*(src: PNode): PNode = proc shallowCopy*(src: PNode): PNode =
# does not copy its sons, but provides space for them: # does not copy its sons, but provides space for them:
@ -1399,7 +1399,7 @@ proc isGenericRoutine*(s: PSym): bool =
of skProcKinds: of skProcKinds:
result = sfFromGeneric in s.flags or result = sfFromGeneric in s.flags or
(s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty) (s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty)
else: nil else: discard
proc skipGenericOwner*(s: PSym): PSym = proc skipGenericOwner*(s: PSym): PSym =
InternalAssert s.kind in skProcKinds InternalAssert s.kind in skProcKinds

View file

@ -50,7 +50,8 @@ proc overwriteFiles*() =
try: try:
var f = open(newFile, fmWrite) var f = open(newFile, fmWrite)
for line in gSourceFiles[i].lines: for line in gSourceFiles[i].lines:
f.writeln(line.strip(leading = false, trailing = true)) f.write line #.strip(leading = false, trailing = true)
f.write("\L")
f.close f.close
except EIO: except EIO:
rawMessage(errCannotOpenFile, newFile) rawMessage(errCannotOpenFile, newFile)

View file

@ -159,7 +159,7 @@ type
range*{.magic: "Range".}[T] ## Generic type to construct range types. range*{.magic: "Range".}[T] ## Generic type to construct range types.
array*{.magic: "Array".}[I, T] ## Generic type to construct array*{.magic: "Array".}[I, T] ## Generic type to construct
## fixed-length arrays. ## fixed-length arrays.
openarray*{.magic: "OpenArray".}[T] ## Generic type to construct open arrays. openArray*{.magic: "OpenArray".}[T] ## Generic type to construct open arrays.
## Open arrays are implemented as a ## Open arrays are implemented as a
## pointer to the array data and a ## pointer to the array data and a
## length field. ## length field.
@ -206,7 +206,7 @@ when not defined(JS) and not defined(NimrodVM):
include "system/hti" include "system/hti"
type type
Byte* = uInt8 ## this is an alias for ``uint8``, that is an unsigned Byte* = uint8 ## this is an alias for ``uint8``, that is an unsigned
## int 8 bits wide. ## int 8 bits wide.
Natural* = range[0..high(int)] Natural* = range[0..high(int)]
@ -937,7 +937,6 @@ template sysAssert(cond: bool, msg: string) =
if not cond: if not cond:
echo "[SYSASSERT] ", msg echo "[SYSASSERT] ", msg
quit 1 quit 1
nil
include "system/inclrtl" include "system/inclrtl"
@ -1376,7 +1375,7 @@ proc clamp*[T](x, a, b: T): T =
if x > b: return b if x > b: return b
return x return x
iterator items*[T](a: openarray[T]): T {.inline.} = iterator items*[T](a: openArray[T]): T {.inline.} =
## iterates over each item of `a`. ## iterates over each item of `a`.
var i = 0 var i = 0
while i < len(a): while i < len(a):