Created
August 9, 2014 17:47
-
-
Save bogen/8b3981242dc6a9491cf6 to your computer and use it in GitHub Desktop.
scraping getStackTrace () but should use what getStrackTrace uses.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc cgenTrace (skip:int = 0, drop:int = 16):string = | |
var a = "" | |
var b = getStackTrace () | |
while a != b: | |
a = b | |
b = replace (a, " ", " ") | |
let c = split (a, "\n") | |
let e = c.len-(3+skip) | |
let g = 1+drop; | |
if (e < 1) or (g > e): | |
return "" | |
else: | |
var f = c [g..e] | |
reverse (f) | |
return "\t/* " & f.join ("; ") & "*/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment