[svn] added doc notes to the installation instructions
[jinja2.git] / jdebug.py
index 95f10cc29e87c14a9461e11055a2c4ee955e7757..5de88155f6ccd013be5850142c576ac24323be65 100644 (file)
--- a/jdebug.py
+++ b/jdebug.py
 """
 from jinja import Environment
 from jinja.parser import Parser
+from jinja.lexer import Lexer
 from jinja.translators.python import PythonTranslator
 
 
-__all__ = ['e', 't', 'p']
+__all__ = ['e', 't', 'p', 'l']
 
 e = Environment()
 t = e.from_string
 
 def p(x):
     print PythonTranslator(e, Parser(e, x).parse()).translate()
+
+def l(x):
+    for item in e.lexer.tokenize(x):
+        print '%5s  %-20s  %r' % item