From: Tim Vieira Date: Thu, 1 Aug 2013 20:07:25 +0000 (-0400) Subject: Small improvement to REPL debug command. X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=6e2b77c5ba89e75c186e96da2d2634edff6b5ba3;p=dyna2 Small improvement to REPL debug command. --- diff --git a/src/Dyna/Backend/Python/repl.py b/src/Dyna/Backend/Python/repl.py index 37ceac8..2be484d 100644 --- a/src/Dyna/Backend/Python/repl.py +++ b/src/Dyna/Backend/Python/repl.py @@ -144,6 +144,10 @@ class REPL(cmd.Cmd, object): """ Development tool. Used for view Dyna's intermediate representations. """ + if not line: + rules = self.interp.rules.values() + rules.sort() + line = '\n'.join('%% rule %s\n%s\n' % (r.index, r.src) for r in rules) import debug with file(dotdynadir / 'repl-debug-line.dyna', 'wb') as f: f.write(line)