diff options
author | Doug Knight <karmix0@gmail.com> | 2009-12-14 16:36:08 -0900 |
---|---|---|
committer | R. Tyler Ballance <tyler@monkeypox.org> | 2009-12-14 23:36:27 -0800 |
commit | 0cc9f781eeeb98d6c0d2812145a525f5dfe27b40 (patch) | |
tree | 1fccee90869cbca34c66660940b8426a85b3abd3 /cheetah/Compiler.py | |
parent | 5cd02208b268958e3c28a338d32041abc82a9b85 (diff) | |
download | python-cheetah-0cc9f781eeeb98d6c0d2812145a525f5dfe27b40.tar.gz |
move handling of escaped variables and directives to the parser
Once text reaches the compiler, it is too late to parse escaped
variables and directives. The compiler does not know where the text
came from, and can not determine when it should skip processing of
escape sequences for raw blocks.
Signed-off-by: R. Tyler Ballance <tyler@monkeypox.org>
Diffstat (limited to 'cheetah/Compiler.py')
-rw-r--r-- | cheetah/Compiler.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/cheetah/Compiler.py b/cheetah/Compiler.py index 4ff5e5c..97e69e7 100644 --- a/cheetah/Compiler.py +++ b/cheetah/Compiler.py @@ -428,27 +428,12 @@ class MethodCompiler(GenUtils): else: self._pendingStrConstChunks = [strConst] - def _unescapeCheetahVars(self, theString): - """Unescape any escaped Cheetah \$vars in the string. - """ - - token = self.setting('cheetahVarStartToken') - return theString.replace('\\' + token, token) - - def _unescapeDirectives(self, theString): - """Unescape any escaped Cheetah \$vars in the string. - """ - - token = self.setting('directiveStartToken') - return theString.replace('\\' + token, token) - def commitStrConst(self): """Add the code for outputting the pending strConst without chopping off any whitespace from it. """ if self._pendingStrConstChunks: - strConst = self._unescapeCheetahVars(''.join(self._pendingStrConstChunks)) - strConst = self._unescapeDirectives(strConst) + strConst = ''.join(self._pendingStrConstChunks) self._pendingStrConstChunks = [] if not strConst: return |