mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-10 15:04:59 +00:00
small bugfixes; reactivated tests/compile
This commit is contained in:
@@ -1048,6 +1048,7 @@ proc instantiateDestructor*(c: PContext, typ: PType): bool =
|
||||
let fullDef = newNode(nkProcDef, i, @[
|
||||
newIdentNode(destructorName, i),
|
||||
emptyNode,
|
||||
emptyNode,
|
||||
newNode(nkFormalParams, i, @[
|
||||
emptyNode,
|
||||
newNode(nkIdentDefs, i, @[
|
||||
@@ -1056,6 +1057,7 @@ proc instantiateDestructor*(c: PContext, typ: PType): bool =
|
||||
emptyNode]),
|
||||
]),
|
||||
newNode(nkPragma, i, @[destructorPragma]),
|
||||
emptyNode,
|
||||
generated
|
||||
])
|
||||
discard semProc(c, fullDef)
|
||||
|
||||
@@ -140,6 +140,7 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode =
|
||||
result[i] = PTransNode(it)
|
||||
elif it.kind == nkIdentDefs:
|
||||
if it.sons[0].kind != nkSym: InternalError(it.info, "transformVarSection")
|
||||
InternalAssert(it.len == 3)
|
||||
var newVar = copySym(it.sons[0].sym)
|
||||
incl(newVar.flags, sfFromGeneric)
|
||||
# fixes a strange bug for rodgen:
|
||||
@@ -498,9 +499,13 @@ proc transformCase(c: PTransf, n: PNode): PTransNode =
|
||||
add(result, elseBranch)
|
||||
|
||||
proc transformArrayAccess(c: PTransf, n: PNode): PTransNode =
|
||||
result = newTransNode(n)
|
||||
result[0] = transform(c, skipConv(n.sons[0]))
|
||||
result[1] = transform(c, skipConv(n.sons[1]))
|
||||
# XXX this is really bad; transf should use a proper AST visitor
|
||||
if n.sons[0].kind == nkSym and n.sons[0].sym.kind == skType:
|
||||
result = n.ptransnode
|
||||
else:
|
||||
result = newTransNode(n)
|
||||
for i in 0 .. < n.len:
|
||||
result[i] = transform(c, skipConv(n.sons[i]))
|
||||
|
||||
proc getMergeOp(n: PNode): PSym =
|
||||
case n.kind
|
||||
|
||||
@@ -243,7 +243,7 @@ all the arguments, but also the matched operators in reverse polish notation:
|
||||
dummy: int
|
||||
|
||||
proc `*`(a, b: TMatrix): TMatrix = nil
|
||||
proc `+`(a, b: TMat): TMatrix = nil
|
||||
proc `+`(a, b: TMatrix): TMatrix = nil
|
||||
proc `-`(a, b: TMatrix): TMatrix = nil
|
||||
proc `$`(a: TMatrix): string = result = $a.dummy
|
||||
proc mat21(): TMatrix =
|
||||
@@ -257,7 +257,7 @@ all the arguments, but also the matched operators in reverse polish notation:
|
||||
|
||||
echo x + y * z - x
|
||||
|
||||
This transforms passes expression ``x + y * z - x`` to the ``optM`` macro as
|
||||
This passes the expression ``x + y * z - x`` to the ``optM`` macro as
|
||||
an ``nnkArgList`` node containing::
|
||||
|
||||
Arglist
|
||||
|
||||
2
todo.txt
2
todo.txt
@@ -2,8 +2,6 @@ version 0.9.0
|
||||
=============
|
||||
|
||||
- make 'm: stmt' use overloading resolution
|
||||
- fix the 'nil' bug in the AST
|
||||
|
||||
- make 'bind' default for templates and introduce 'mixin'
|
||||
|
||||
- implicit deref for parameter matching
|
||||
|
||||
@@ -219,7 +219,7 @@ proc yesno(p: var TCfgParser, v: string): bool =
|
||||
proc parseIniFile(c: var TConfigData) =
|
||||
var
|
||||
p: TCfgParser
|
||||
section: string # current section
|
||||
section = ""
|
||||
var input = newFileStream(c.infile, fmRead)
|
||||
if input != nil:
|
||||
open(p, input, c.infile)
|
||||
|
||||
Reference in New Issue
Block a user