diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-09-03 03:14:56 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-09-03 03:14:56 +0300 |
commit | 6082595e968f000b5089b1db7e72ad55bbf3fac3 (patch) | |
tree | 06a76e725c59524b5e7ab23e8c5f1a7c1bef5e54 /compiler/astalgo.nim | |
parent | 39da6979add895cf58e9c6f883ef8df465975cd6 (diff) | |
parent | c8c8d2035af189bdf63b39d4e47266a6e67c38b9 (diff) | |
download | Nim-6082595e968f000b5089b1db7e72ad55bbf3fac3.tar.gz |
Merge branch 'type-classes' into upstream
Diffstat (limited to 'compiler/astalgo.nim')
-rw-r--r-- | compiler/astalgo.nim | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index fd6774e7a..6c48dd00f 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -430,11 +430,14 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope = appf(result, ",$N$1\"info\": $2", [istr, lineInfoToStr(n.info)]) appf(result, "$N$1}", [spaces(indent)]) -proc debug(n: PSym) = - #writeln(stdout, ropeToStr(symToYaml(n, 0, 1))) - writeln(stdout, ropeToStr(ropef("$1_$2: $3, $4", [ - toRope(n.name.s), toRope(n.id), flagsToStr(n.flags), - flagsToStr(n.loc.flags)]))) +proc debug(n: PSym) = + if n == nil: + writeln(stdout, "null") + else: + #writeln(stdout, ropeToStr(symToYaml(n, 0, 1))) + writeln(stdout, ropeToStr(ropef("$1_$2: $3, $4", [ + toRope(n.name.s), toRope(n.id), flagsToStr(n.flags), + flagsToStr(n.loc.flags)]))) proc debug(n: PType) = writeln(stdout, ropeToStr(debugType(n))) |