From d10973adb00840631e5314ec902d502f15934801 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 21 Jul 2010 09:44:47 +0200 Subject: c2nim tool added --- rod/semgnrc.nim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rod/semgnrc.nim') diff --git a/rod/semgnrc.nim b/rod/semgnrc.nim index fbc9f18bd..0a291cd42 100755 --- a/rod/semgnrc.nim +++ b/rod/semgnrc.nim @@ -1,11 +1,12 @@ # # # The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. # + # This implements the first pass over the generic body; it resolves some # symbols. Thus for generics there is a two-phase symbol lookup just like # in C++. @@ -155,8 +156,8 @@ proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags = {}): PNode if (a.kind != nkIdentDefs): IllFormedAst(a) checkMinSonsLen(a, 3) L = sonsLen(a) - a.sons[L - 2] = semGenericStmt(c, a.sons[L - 2], {withinTypeDesc}) # do not perform symbol lookup for default - # expressions + a.sons[L - 2] = semGenericStmt(c, a.sons[L - 2], {withinTypeDesc}) + # do not perform symbol lookup for default expressions for j in countup(0, L - 3): addDecl(c, newSymS(skUnknown, getIdentNode(a.sons[j]), c)) of nkConstSection: @@ -196,8 +197,7 @@ proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags = {}): PNode of nkEnumFieldDef: a = n.sons[i].sons[0] of nkIdent: a = n.sons[i] else: illFormedAst(n) - addDeclAt(c, newSymS(skUnknown, getIdentNode(a.sons[i]), c), c.tab.tos - - 1) + addDeclAt(c, newSymS(skUnknown, getIdentNode(a.sons[i]), c), c.tab.tos-1) of nkObjectTy, nkTupleTy: nil of nkFormalParams: @@ -229,4 +229,4 @@ proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags = {}): PNode else: for i in countup(0, sonsLen(n) - 1): result.sons[i] = semGenericStmt(c, n.sons[i], flags) - \ No newline at end of file + -- cgit 1.4.1-2-gfad0