mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 03:44:14 +00:00
it's the year 2014
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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("//", "")
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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])
|
||||
|
||||
10
todo.txt
10
todo.txt
@@ -1,13 +1,12 @@
|
||||
version 0.9.4
|
||||
=============
|
||||
|
||||
- ``--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
|
||||
- ``--gc:none`` should complain about when you use the GC
|
||||
- ensure (ref T)(a, b) works as a type conversion and type constructor
|
||||
- document new templating symbol binding rules
|
||||
- make '--implicitStatic:on' the default
|
||||
|
||||
- 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
|
||||
|
||||
Reference in New Issue
Block a user