[Checkins] SVN: Sandbox/malthe/chameleon.core/ Fixed interpolation issue.

Malthe Borch mborch at gmail.com
Fri Nov 14 18:04:42 EST 2008


Log message for revision 92947:
  Fixed interpolation issue.

Changed:
  U   Sandbox/malthe/chameleon.core/CHANGES.txt
  U   Sandbox/malthe/chameleon.core/src/chameleon/core/parsing.py

-=-
Modified: Sandbox/malthe/chameleon.core/CHANGES.txt
===================================================================
--- Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-14 22:53:55 UTC (rev 92946)
+++ Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-14 23:04:42 UTC (rev 92947)
@@ -4,6 +4,10 @@
 HEAD
 ~~~~
 
+- Fixed interpolation edge where a right curly brace not part of an
+  interpolation expression would cancel a succeeding
+  interpolation. [malthe]
+
 - Pass `target_language` when using macros. [malthe]
 
 1.0b6 (released 13/11/2008)

Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/parsing.py
===================================================================
--- Sandbox/malthe/chameleon.core/src/chameleon/core/parsing.py	2008-11-14 22:53:55 UTC (rev 92946)
+++ Sandbox/malthe/chameleon.core/src/chameleon/core/parsing.py	2008-11-14 23:04:42 UTC (rev 92947)
@@ -107,12 +107,14 @@
         right = string.find('}')
 
         while right != -1:
-            match = string[left:right]
-            try:
-                exp = translator(match)
-                break
-            except SyntaxError:
-                right = string.find('}', right+1)
+            if right > left:
+                match = string[left:right]
+                try:
+                    exp = translator(match)
+                    break
+                except SyntaxError:
+                    pass
+            right = string.find('}', right+1)
         else:
             raise
 



More information about the Checkins mailing list