diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 1e30df7ad..f6680d252 100755 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -207,7 +207,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = # This function replaces all other methods for generating # the assignment operation in C. if src.t != nil and src.t.kind == tyPtr: - # little HACK to suppor the new 'var T' as return type: + # little HACK to support the new 'var T' as return type: appcg(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)]) return var ty = skipTypes(dest.t, abstractVarRange) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index d403aeef1..3bbc0c71f 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -36,6 +36,15 @@ proc semExprWithType(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = GlobalError(n.info, errExprXHasNoType, renderTree(result, {renderNoComments})) +proc semExprNoDeref(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = + result = semExpr(c, n, flags) + if result.kind == nkEmpty: + # do not produce another redundant error message: + raiseRecoverableError() + if result.typ == nil: + GlobalError(n.info, errExprXHasNoType, + renderTree(result, {renderNoComments})) + proc semSymGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode = result = symChoice(c, n, s) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 52fc2ea31..1c6c90c84 100755 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -167,6 +167,26 @@ proc SemReturn(c: PContext, n: PNode): PNode = if n[0][1].kind == nkSym and n[0][1].sym.kind == skResult: n.sons[0] = ast.emptyNode +proc SemYieldVarResult(c: PContext, n: PNode, restype: PType) = + var t = skipTypes(restype, {tyGenericInst}) + case t.kind + of tyVar: + n.sons[0] = takeImplicitAddr(c, n.sons[0]) + of tyTuple: + for i in 0.. varargs convention - implement explicit varargs -- tests: run modules that contain "#RUN_ME", compile the other - modules; run the GC tests +- tests: run the GC tests - change overloading resolution - implement closures; implement proper coroutines @@ -40,8 +38,6 @@ version 0.9.XX - implicit ref/ptr->var conversion; the compiler may store an object implicitly on the heap for write barrier efficiency; better: proc specialization in the code gen -- resizing of strings/sequences could take into account the memory that - is allocated - find a way to reintroduce the cleanup() pass for C code generation: this is hard because of partial evaluation --> symbol files will fix this as a side effect @@ -81,6 +77,8 @@ Low priority - find a way for easy constructors and destructors; (destructors are much more important than constructors) - code generated for type information is wasteful +- resizing of strings/sequences could take into account the memory that + is allocated Version 2