Improved Jinja's debugging support by introducing "@internalcode" which marks code objects that are skipped on tracebacks.  Also template errors are now translated as well to help the pylons debugger.

--HG--
branch : trunk
diff --git a/tests/test_debug.py b/tests/test_debug.py
index d9c5f7a..aadb9a4 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -31,7 +31,19 @@
 >>> tmpl = MODULE.env.get_template('syntaxerror.html')
 Traceback (most recent call last):
   ...
-TemplateSyntaxError: unknown tag 'endif'
   File "loaderres/templates/syntaxerror.html", line 4
     {% endif %}
+TemplateSyntaxError: unknown tag 'endif'
+'''
+
+
+test_regular_syntax_error = '''
+>>> from jinja2.exceptions import TemplateSyntaxError
+>>> raise TemplateSyntaxError('wtf', 42)
+Traceback (most recent call last):
+  ...
+  File "<doctest test_regular_syntax_error[1]>", line 1, in <module>
+    raise TemplateSyntaxError('wtf', 42)
+TemplateSyntaxError: wtf
+  line 42
 '''