From 6e2b77c5ba89e75c186e96da2d2634edff6b5ba3 Mon Sep 17 00:00:00 2001 From: Tim Vieira Date: Thu, 1 Aug 2013 16:07:25 -0400 Subject: [PATCH] Small improvement to REPL debug command. --- src/Dyna/Backend/Python/repl.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.50.1