# # # The Nim Compiler # (c) Copyright 2013 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. # ## Generates traversal procs for the C backend. # included from cgen.nim type TTraversalClosure = object p: BProc visitorFrmt: string const visitorFrmt = "#nimGCvisit((void*)$1, $2);$n" proc genTraverseProc(c: TTraversalClosure, accessor: Rope, typ: PType) proc genCaseRange(p: BProc, branch: PNode) proc getTemp(p: BProc, t: PType, result: var TLoc; needsInit=false) proc genTraverseProc(c: TTraversalClosure, accessor: Rope, n: PNode; typ: PType) = if n == nil: return case n.kind of nkRecList: for i in 0..