Author: sapient
Date: Mon Jun 23 05:14:18 2008
New Revision: 27424
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27424&view=rev
Log:
added file comments
Modified:
trunk/data/tools/wesnoth/wmliterator.py
Modified: trunk/data/tools/wesnoth/wmliterator.py
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmliterator.py?rev=27424&r1=27423&r2=27424&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmliterator.py (original)
+++ trunk/data/tools/wesnoth/wmliterator.py Mon Jun 23 05:14:18 2008
@@ -1,7 +1,25 @@
"""
wmliterator.py -- Python routines for navigating a Battle For Wesnoth WML tree
Author: Sapient (Patrick Parker), 2007
+
+Purpose:
+ The WmlIterator class can be used to analyze and search the structure of WML
+ files non-invasively (i.e. preserving existing line structure), and its main
+ use is to determine when a transformation of deprecated content needs to take
+ place. (I wrote it was because wmllint was trying to do a lot of things with
+ regular expressions which really required a more algorithmic approach. Also,
+ wmllint was often inconsistent with correct handling of comments and values
+ inside strings.)
+
+Limitations:
+ The WmlIterator does not attempt to expand macros, only to recognize them as
+ another level of nesting. Also, the handling of multiple assignment syntax
+ is somewhat limited (for similar reasons). Adding seamless support for these
+ would be ideal, but it presents a design challenge since the iteration is
+ supposed to be non-invasive. Thus, the current behavior is considered good
+ enough for now.
"""
+
import sys, re, copy
keyPattern = re.compile('(\w+)(,\s?\w+)*\s*=')
keySplit = re.compile(r'[=,\s]')
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits