mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-12 17:39:08 +00:00
added file comments
This commit is contained in:
parent
3200d42e06
commit
caa60dbd03
@ -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]')
|
||||
|
Loading…
x
Reference in New Issue
Block a user