diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-05-02 01:01:45 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-05-02 01:01:45 +0000 |
commit | 3dabe23c995fca20b5460a12ade3549f7f1810fe (patch) | |
tree | 653511138e2e49fe715691ac769a0b53f27ff91e /lib | |
parent | 4c30e5188c96528be2bf8d6ac3d0f14ad7fc1870 (diff) | |
download | external_python_mako-3dabe23c995fca20b5460a12ade3549f7f1810fe.tar.gz external_python_mako-3dabe23c995fca20b5460a12ade3549f7f1810fe.tar.bz2 external_python_mako-3dabe23c995fca20b5460a12ade3549f7f1810fe.zip |
- control lines, i.e. % lines, support backslashes to continue long
lines (#32)
- fixed single "#" comments in docs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mako/ast.py | 2 | ||||
-rw-r--r-- | lib/mako/lexer.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/mako/ast.py b/lib/mako/ast.py index 0d00f30..db2c316 100644 --- a/lib/mako/ast.py +++ b/lib/mako/ast.py @@ -139,7 +139,7 @@ class PythonFragment(PythonCode): etc. """ def __init__(self, code, **exception_kwargs): - m = re.match(r'^(\w+)(?:\s+(.*?))?:$', code.strip()) + m = re.match(r'^(\w+)(?:\s+(.*?))?:$', code.strip(), re.S) if not m: raise exceptions.CompileException("Fragment '%s' is not a partial control statement" % code, **exception_kwargs) (keyword, expr) = m.group(1,2) diff --git a/lib/mako/lexer.py b/lib/mako/lexer.py index dafa10d..34e7c1a 100644 --- a/lib/mako/lexer.py +++ b/lib/mako/lexer.py @@ -283,7 +283,7 @@ class Lexer(object): return False def match_control_line(self): - match = self.match(r"(?<=^)[\t ]*(%|##)[\t ]*([^\r\n]*)(?:\r?\n|\Z)", re.M) + match = self.match(r"(?<=^)[\t ]*(%|##)[\t ]*((?:(?:\\r?\n)|[^\r\n])*)(?:\r?\n|\Z)", re.M) if match: operator = match.group(1) text = match.group(2) |