[pypy-svn] r14910 - pypy/dist/pypy/interpreter/pyparser

ludal at codespeak.net ludal at codespeak.net
Fri Jul 22 14:12:56 CEST 2005


Author: ludal
Date: Fri Jul 22 14:12:54 2005
New Revision: 14910

Modified:
   pypy/dist/pypy/interpreter/pyparser/astbuilder.py
Log:
 small debugging function


Modified: pypy/dist/pypy/interpreter/pyparser/astbuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/astbuilder.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/astbuilder.py	Fri Jul 22 14:12:54 2005
@@ -388,3 +388,18 @@
         print "TOK:", tok.tok_name[name], name, value
         self.push_tok( name, value, source )
         return True
+
+def show_stack(before, after):
+    L1 = len(before)
+    L2 = len(after)
+    for i in range(max(L1,L2)):
+        if i<L1:
+            obj1 = str(before[i])
+        else:
+            obj1 = "-"
+        if i<L2:
+            obj2 = str(after[i])
+        else:
+            obj2 = "-"
+        print "% 3d | %30s | %30s"
+    



More information about the Pypy-commit mailing list