diff options
author | Araq <rumpf_a@web.de> | 2014-01-19 01:25:48 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-01-19 01:25:48 +0100 |
commit | a59939d29500f7a00cfd45b4990c5e34a9548add (patch) | |
tree | 54260a080eb15b74cff5c485d55f104ea20c3daa | |
parent | 6df259f15b8507b1d7be6f72759daeb537ff7ac5 (diff) | |
download | Nim-a59939d29500f7a00cfd45b4990c5e34a9548add.tar.gz |
it's the year 2014
-rw-r--r-- | compiler/astalgo.nim | 14 | ||||
-rw-r--r-- | compiler/cgen.nim | 8 | ||||
-rw-r--r-- | compiler/commands.nim | 2 | ||||
-rw-r--r-- | compiler/jsgen.nim | 4 | ||||
-rw-r--r-- | compiler/main.nim | 2 | ||||
-rw-r--r-- | compiler/semgnrc.nim | 6 | ||||
-rw-r--r-- | compiler/semthreads.nim | 4 | ||||
-rw-r--r-- | todo.txt | 6 |
8 files changed, 22 insertions, 24 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 110ee191f..2505bc687 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -455,18 +455,18 @@ proc nextTry(h, maxHash: THash): THash = # generates each int in range(maxHash) exactly once (see any text on # random-number generation for proof). -proc objectSetContains(t: TObjectSet, obj: PObject): bool = +proc objectSetContains(t: TObjectSet, obj: PObject): bool = # returns true whether n is in t var h: THash = hashNode(obj) and high(t.data) # start with real hash value - while t.data[h] != nil: - if (t.data[h] == obj): + while t.data[h] != nil: + if t.data[h] == obj: return true h = nextTry(h, high(t.data)) result = false -proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = +proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = var h: THash = hashNode(obj) and high(data) - while data[h] != nil: + while data[h] != nil: assert(data[h] != obj) h = nextTry(h, high(data)) assert(data[h] == nil) @@ -475,7 +475,7 @@ proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = proc objectSetEnlarge(t: var TObjectSet) = var n: TObjectSeq newSeq(n, len(t.data) * GrowthFactor) - for i in countup(0, high(t.data)): + for i in countup(0, high(t.data)): if t.data[i] != nil: objectSetRawInsert(n, t.data[i]) swap(t.data, n) @@ -699,7 +699,7 @@ proc idTableRawGet(t: TIdTable, key: int): int = var h: THash h = key and high(t.data) # start with real hash value while t.data[h].key != nil: - if (t.data[h].key.id == key): + if t.data[h].key.id == key: return h h = nextTry(h, high(t.data)) result = - 1 diff --git a/compiler/cgen.nim b/compiler/cgen.nim index b08647512..c7de1091b 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -914,18 +914,18 @@ proc addIntTypes(result: var PRope) {.inline.} = proc getCopyright(cfilenoext: string): PRope = if optCompileOnly in gGlobalOptions: result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & - "/* (c) 2012 Andreas Rumpf */$n" & + "/* (c) 2014 Andreas Rumpf */$n" & "/* The generated code is subject to the original license. */$n", "; Generated by Nimrod Compiler v$1$n" & "; (c) 2012 Andreas Rumpf$n", [toRope(VersionAsString)]) else: result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & - "/* (c) 2012 Andreas Rumpf */$n" & + "/* (c) 2014 Andreas Rumpf */$n" & "/* The generated code is subject to the original license. */$n" & "/* Compiled for: $2, $3, $4 */$n" & "/* Command for C compiler:$n $5 */$n", "; Generated by Nimrod Compiler v$1$n" & - "; (c) 2012 Andreas Rumpf$n" & + "; (c) 2014 Andreas Rumpf$n" & "; Compiled for: $2, $3, $4$n" & "; Command for LLVM compiler:$n $5$n", [toRope(VersionAsString), toRope(platform.OS[targetOS].name), diff --git a/compiler/commands.nim b/compiler/commands.nim index 7179b07c1..18bdb54d3 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -28,7 +28,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) const HelpMessage = "Nimrod Compiler Version $1 (" & CompileDate & ") [$2: $3]\n" & - "Copyright (c) 2004-2013 by Andreas Rumpf\n" + "Copyright (c) 2006-2014 by Andreas Rumpf\n" const Usage = slurp"doc/basicopt.txt".replace("//", "") diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index b4e696d0a..dd06b0235 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -1652,7 +1652,7 @@ proc newModule(module: PSym): BModule = proc genHeader(): PRope = result = ropef("/* Generated by the Nimrod Compiler v$1 */$n" & - "/* (c) 2013 Andreas Rumpf */$n$n" & + "/* (c) 2014 Andreas Rumpf */$n$n" & "$nvar Globals = this;$n" & "var framePtr = null;$n" & "var excHandler = null;$n", diff --git a/compiler/main.nim b/compiler/main.nim index 4cea24f9d..cdea7b5ca 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index b40e86cbf..89a167b96 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -103,7 +103,7 @@ proc semGenericStmt(c: PContext, n: PNode, # not work. Copying the symbol does not work either because we're already # the owner of the symbol! What we need to do is to copy the symbol # in the generic instantiation process... - nil + discard of nkBind: result = semGenericStmt(c, n.sons[0], flags+{withinBind}, ctx) of nkMixinStmt: @@ -271,7 +271,7 @@ proc semGenericStmt(c: PContext, n: PNode, else: illFormedAst(n) addDecl(c, newSymS(skUnknown, getIdentNode(a.sons[i]), c)) of nkObjectTy, nkTupleTy: - nil + discard of nkFormalParams: checkMinSonsLen(n, 1) if n.sons[0].kind != nkEmpty: @@ -304,7 +304,7 @@ proc semGenericStmt(c: PContext, n: PNode, else: body = n.sons[bodyPos] n.sons[bodyPos] = semGenericStmtScope(c, body, flags, ctx) closeScope(c) - of nkPragma, nkPragmaExpr: nil + of nkPragma, nkPragmaExpr: discard of nkExprColonExpr, nkExprEqExpr: checkMinSonsLen(n, 2) result.sons[1] = semGenericStmt(c, n.sons[1], flags, ctx) diff --git a/compiler/semthreads.nim b/compiler/semthreads.nim index c96acf2f1..f7322db80 100644 --- a/compiler/semthreads.nim +++ b/compiler/semthreads.nim @@ -160,7 +160,7 @@ proc writeAccess(c: PProcCtx, n: PNode, owner: TThreadOwner) = # we could not backtrack to a concrete symbol, but that's fine: var lastOwner = analyse(c, n) case lastOwner - of toNil: nil # fine, toNil can be overwritten + of toNil: discard # fine, toNil can be overwritten of toVoid, toUndefined: internalError(n.info, "writeAccess") of toTheirs: message(n.info, warnWriteToForeignHeap) of toMine: @@ -369,7 +369,7 @@ proc analyse(c: PProcCtx, n: PNode): TThreadOwner = result = toMine of nkAsmStmt, nkPragma, nkIteratorDef, nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, - nkGotoState, nkState, nkBreakState, nkType: + nkGotoState, nkState, nkBreakState, nkType, nkIdent: result = toVoid of nkExprColonExpr: result = analyse(c, n.sons[1]) diff --git a/todo.txt b/todo.txt index c29638e29..067c376ad 100644 --- a/todo.txt +++ b/todo.txt @@ -1,13 +1,12 @@ version 0.9.4 ============= +- test&finish first class iterators: + * nested iterators - ``--gc:none`` should complain about when you use the GC - ensure (ref T)(a, b) works as a type conversion and type constructor -- Aporia doesn't compile under devel - document new templating symbol binding rules - make '--implicitStatic:on' the default -- test&finish first class iterators: - * nested iterators - special rule for ``[]=`` - ``=`` should be overloadable; requires specialization for ``=``; general @@ -34,7 +33,6 @@ Bugs - blocks can "export" an identifier but the CCG generates {} for them ... - osproc execProcesses can deadlock if all processes fail (as experienced in c++ mode) -- result = result shr 8 for the "system()" wrapper version 0.9.x |