Author: suokko
Date: Fri Jun 20 17:31:27 2008
New Revision: 27351

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27351&view=rev
Log:
Added support to wmlparser for ignoring macros inside string

Modified:
    trunk/data/tools/wesnoth/wmlparser.py

Modified: trunk/data/tools/wesnoth/wmlparser.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmlparser.py?rev=27351&r1=27350&r2=27351&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmlparser.py (original)
+++ trunk/data/tools/wesnoth/wmlparser.py Fri Jun 20 17:31:27 2008
@@ -40,7 +40,7 @@
             self.current_path = current_path
             self.textdomain = textdomain
 
-    def __init__(self, data_dir, user_dir = None):
+    def __init__(self, data_dir, user_dir = None, no_macros_in_string = Flase):
         """
         Initialize a new WMLParser instance.
 
@@ -51,6 +51,7 @@
 
         self.data_dir = data_dir
         self.user_dir = user_dir
+        self.no_macros_in_string = no_macros_in_string
 
         self.textpos = 0
         self.line = 1
@@ -499,8 +500,11 @@
 
     def parse_string(self):
         text = ""
+        match_read_end = '"'
+        if not no_macros_in_string:
+            match_read_end += '{'
         while not self.at_end():
-            text += self.read_until('"{')
+            text += self.read_until(match_read_end)
             if text[-1] == '"':
                 if self.peek_next() == '"':
                     self.read_next()


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to