This commit is contained in:
Araq 2011-11-27 16:32:05 +01:00
commit 020a10927a
5 changed files with 14 additions and 10 deletions

View file

@ -1484,20 +1484,14 @@ proc genTupleConstr(p: BProc, n: PNode, d: var TLoc) =
if d.k == locNone: getTemp(p, t, d) if d.k == locNone: getTemp(p, t, d)
for i in countup(0, sonsLen(n) - 1): for i in countup(0, sonsLen(n) - 1):
var it = n.sons[i] var it = n.sons[i]
if it.kind == nkExprColonExpr: if it.kind == nkExprColonExpr: it = it.sons[1]
initLoc(rec, locExpr, it.sons[1].typ, d.s) if t.n == nil:
if (t.n.sons[i].kind != nkSym): InternalError(n.info, "genTupleConstr")
rec.r = ropef("$1.$2",
[rdLoc(d), mangleRecFieldName(t.n.sons[i].sym, t)])
expr(p, it.sons[1], rec)
elif t.n == nil:
initLoc(rec, locExpr, it.typ, d.s) initLoc(rec, locExpr, it.typ, d.s)
rec.r = ropef("$1.Field$2", [rdLoc(d), toRope(i)]) rec.r = ropef("$1.Field$2", [rdLoc(d), toRope(i)])
expr(p, it, rec) expr(p, it, rec)
else: else:
initLoc(rec, locExpr, it.typ, d.s) initLoc(rec, locExpr, it.typ, d.s)
if (t.n.sons[i].kind != nkSym): if (t.n.sons[i].kind != nkSym): InternalError(n.info, "genTupleConstr")
InternalError(n.info, "genTupleConstr: 2")
rec.r = ropef("$1.$2", rec.r = ropef("$1.$2",
[rdLoc(d), mangleRecFieldName(t.n.sons[i].sym, t)]) [rdLoc(d), mangleRecFieldName(t.n.sons[i].sym, t)])
expr(p, it, rec) expr(p, it, rec)

View file

@ -49,6 +49,7 @@ proc ProcessCmdLine(pass: TCmdLinePass) =
if pass == passCmd2: if pass == passCmd2:
arguments = cmdLineRest(p) arguments = cmdLineRest(p)
echo "Setting args to ", arguments
if optRun notin gGlobalOptions and arguments != "": if optRun notin gGlobalOptions and arguments != "":
rawMessage(errArgsNeedRunOption, []) rawMessage(errArgsNeedRunOption, [])
@ -91,7 +92,8 @@ proc HandleCmdLine() =
rawMessage(hintSuccessX, [$gLinesCompiled, rawMessage(hintSuccessX, [$gLinesCompiled,
formatFloat(epochTime() - start, ffDecimal, 3)]) formatFloat(epochTime() - start, ffDecimal, 3)])
if optRun in gGlobalOptions: if optRun in gGlobalOptions:
var ex = quoteIfContainsWhite(changeFileExt(projectName, "").prependCurDir) var ex = quoteIfContainsWhite(
changeFileExt(projectFullPath, "").prependCurDir)
execExternalProgram(ex & ' ' & arguments) execExternalProgram(ex & ' ' & arguments)
#GC_disableMarkAndSweep() #GC_disableMarkAndSweep()

View file

@ -11,6 +11,9 @@
# Garbage Collector # Garbage Collector
# #
# The basic algorithm is *Deferrent Reference Counting* with cycle detection. # The basic algorithm is *Deferrent Reference Counting* with cycle detection.
# This is achieved by combining a Deutsch-Bobrow garbage collector
# together with Christoper's partial mark-sweep garbage collector.
#
# Special care has been taken to avoid recursion as far as possible to avoid # Special care has been taken to avoid recursion as far as possible to avoid
# stack overflows when traversing deep datastructures. This is comparable to # stack overflows when traversing deep datastructures. This is comparable to
# an incremental and generational GC. It should be well-suited for soft real # an incremental and generational GC. It should be well-suited for soft real

View file

@ -1,3 +1,7 @@
discard """
cmd: "nimrod cc --hints:on -d:release $# $#"
"""
# -*- nimrod -*- # -*- nimrod -*-
import math import math

View file

@ -1,6 +1,7 @@
version 0.8.14 version 0.8.14
============== ==============
- argument passing with --run option is broken
- stdlib and compiler should not use deprecated endOfFile and readline - stdlib and compiler should not use deprecated endOfFile and readline
version 0.9.0 version 0.9.0