summary refs log tree commit diff stats
path: root/rod/c2nim
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-07-22 19:19:58 +0200
committerAndreas Rumpf <andreas@andreas-laptop>2010-07-22 19:19:58 +0200
commite6bc065cc51ceac27b13403856c4ee307d9eb276 (patch)
tree7f82b4ace7d6814f224dc4aced9d1da8c98f14d9 /rod/c2nim
parentbe878a599333f2d98b8e95b956d17f5e0d37d8b0 (diff)
downloadNim-e6bc065cc51ceac27b13403856c4ee307d9eb276.tar.gz
c2nim: code cleanup
Diffstat (limited to 'rod/c2nim')
-rwxr-xr-xrod/c2nim/cpp.nim45
1 files changed, 0 insertions, 45 deletions
diff --git a/rod/c2nim/cpp.nim b/rod/c2nim/cpp.nim
index 2b4226fd9..46f78602b 100755
--- a/rod/c2nim/cpp.nim
+++ b/rod/c2nim/cpp.nim
@@ -187,24 +187,7 @@ proc parseIfDirAux(p: var TParser, result: PNode) =
     addSon(s, parseStmtList(p))
     addSon(result, s)
   eatEndif(p)
-  
-when false:
-  proc specialIf(p: TParser): bool = 
-    ExpectIdent(p)
-    result = p.tok.s == c2nimSymbol
     
-  proc chooseBranch(whenStmt: PNode, branch: int): PNode = 
-    var L = sonsLen(whenStmt)
-    if branch < L: 
-      if L == 2 and whenStmt[1].kind == nkElse or branch == 0: 
-        result = lastSon(whenStmt[branch])
-      else:
-        var b = whenStmt[branch]
-        assert(b.kind == nkElifBranch)
-        result = newNodeI(nkWhenStmt, whenStmt.info)
-        for i in branch .. L-1:
-          addSon(result, whenStmt[i])
-  
 proc skipUntilEndif(p: var TParser) =
   var nested = 1
   while p.tok.xkind != pxEof:
@@ -283,34 +266,6 @@ proc parseIfndef(p: var TParser): PNode =
     addSon(result.sons[0], e)
     parseIfDirAux(p, result)
   
-when false:
-  proc parseIfdefDir(p: var TParser): PNode = 
-    result = newNodeP(nkWhenStmt, p)
-    addSon(result, newNodeP(nkElifBranch, p))
-    getTok(p)
-    var special = specialIf(p)
-    if p.tok.s == "__cplusplus": 
-      return skipIfdefCPlusPlus(p)
-    addSon(result.sons[0], definedExprAux(p))
-    eatNewLine(p, nil)
-    parseIfDirAux(p, result)
-    if special: 
-      result = chooseBranch(result, 0)
-
-  proc parseIfndefDir(p: var TParser): PNode = 
-    result = newNodeP(nkWhenStmt, p)
-    addSon(result, newNodeP(nkElifBranch, p))
-    getTok(p)
-    var special = specialIf(p)
-    var e = newNodeP(nkCall, p)
-    addSon(e, newIdentNodeP("not", p))
-    addSon(e, definedExprAux(p))
-    eatNewLine(p, nil)
-    addSon(result.sons[0], e)
-    parseIfDirAux(p, result)
-    if special:
-      result = chooseBranch(result, 1)
-
 proc parseIfDir(p: var TParser): PNode = 
   result = newNodeP(nkWhenStmt, p)
   addSon(result, newNodeP(nkElifBranch, p))