changeset 117:a392a52a9ae3

Info.py: don't print stupid parentheses
author Sigurd Meldgaard <stm@daimi.au.dk>
date Mon, 26 Oct 2009 10:32:19 +0100
parents 1b8e03af0fef
children 1a9b04a236e1
files pysmcl/emacs/info.py
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/emacs/info.py	Mon Oct 26 10:30:14 2009 +0100
+++ b/pysmcl/emacs/info.py	Mon Oct 26 10:32:19 2009 +0100
@@ -8,7 +8,6 @@
 def main():
     prog = ast.parse(file(sys.argv[1]).read())
     linenr = int(sys.argv[2]) if len(sys.argv) > 2 else 0
-    print "("
     for i in prog.body:
         if isinstance(i, ast.FunctionDef):
             secret_analysis(i)
@@ -18,13 +17,10 @@
                 if isinstance(j, ast.stmt):
                     e = j.out_values["secret"]
                 if isinstance(j, ast.expr):
-                    try:
-                        if expr_secret(j, e):
-                            output = StringIO.StringIO()
-                            print "(%d %d %d)" % (j.lineno, j.col_offset,
-                                                  len(expr_string(j)))
-                    except:
-                        pass
-    print ")"
+                    if expr_secret(j, e):
+                        output = StringIO.StringIO()
+                        print "%d %d %d" % (j.lineno, j.col_offset,
+                                              len(expr_string(j)))
+
 if __name__ == "__main__":
     main()