60 Commits

Author SHA1 Message Date
Elvish_Hunter
8c098c3264 wmlscope: refactored collision detection
This fixes the breakage caused by the Python 3 zip() function, which like all generators may be iterated only once; also, it finally returns a meaningful output, instead of the obscure list of filenames which was formerly returned
2015-08-05 20:38:49 +02:00
Elvish_Hunter
c1a783b038 all main wml tools: use filter(), map() and zip() from Python 3
The main difference is that these functions return generators instead of lists. This actually breaks wmlscope's collision detection, which will be fixed in my next commit.
2015-08-05 20:38:48 +02:00
Elvish_Hunter
6d67feff9f wmlscope and wmltools: removed calls to cmp() function
Just like the __cmp__ method, the cmp() function isn't available on Python 3
2015-08-05 20:38:48 +02:00
Elvish_Hunter
778e9296d8 wmlscope: fixed files being incorrectly opened as UTF8 instead of binary 2015-08-05 20:38:48 +02:00
Elvish_Hunter
cebfbba68e wmllint and wmlscope: fixed encoding declarations 2015-08-04 10:07:59 +02:00
Elvish_Hunter
ab88b9091f wmlscope: open files as UTF-8 and use Unicode literals 2015-08-04 10:07:58 +02:00
Elvish_Hunter
d8e69a4c40 wmlscope: used print function
This replaces usages of print >> sys.stderr adn sys.stderr.write
2015-07-30 10:51:49 +02:00
Elvish_Hunter
2dee033335 wmlscope: fixed sorted() and type() being used as variable names 2015-07-30 10:48:28 +02:00
Javier Novoa
8be183bdd9 Use with statements to open/close files on wml{indent,lint,scope}. 2015-07-27 22:15:24 -05:00
Groggy Dice
3d11b84611 wmlscope: import glob for Windows shell
The Windows cmd shell will not expand a globbed argument by default, in
fact it will make the argument invalid. Importing and utilizing the glob
module is needed for x-platform.

Globbing is especially important for breaking up the subtree, so wmlscope
doesn't give off "more than one resource/definition is visible here"
errors.
2014-08-01 06:14:00 -04:00
Groggy Dice
8e7581f593 wmlscope: fix mistakes in help and options pointed out by Elvish Hunter
See EH's forum post:

http://forums.wesnoth.org/viewtopic.php?f=10&t=40397#p570438
2014-06-10 06:09:58 -04:00
Alexander van Gessel
38b224c1ff Revert "Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old""
This reverts commit 23b72d6956e6316f8b50a6accba607f66cf197a7.
2013-08-09 00:13:46 +02:00
Thibault Févry
23b72d6956 Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old"
This reverts commit 5fa5c034110c3c942d299c8fd440297c89aca037, reversing
changes made to 06374c64ba00977a4f720a44108593fc43d5c787.
2013-08-08 18:50:46 +02:00
Alexander van Gessel
d394f27afb Some python syntax updates for the WML tools 2013-07-26 15:38:05 +02:00
Elvish_Hunter
8200214e9b wmllint, wmlscope and wmlindent: fixed bug caused by Windows' command prompt appending double quotes to arguments 2013-02-23 13:04:12 +00:00
Timotei Dolean
79f2309489 add the 'Unresolved reference' in each reported line...
...instead of adding one comment
2010-08-19 20:45:11 +00:00
Eric S. Raymond
b1fe81d099 Progress option for wmlscope. 2010-07-19 15:04:06 +00:00
Eric S. Raymond
e66a6eacf6 Flag specific macro arguments that have no typechecking with suffix ? 2010-02-08 18:26:07 +00:00
Eric S. Raymond
767c75358a Typo fix. 2010-01-13 23:34:10 +00:00
Gunter Labes
5b3a5412d4 fixed listing logic 2010-01-13 09:26:00 +00:00
Eric S. Raymond
bf36440ece Avoid a duplicative calculation to improve the cross-referencer's performance. 2009-10-31 11:10:11 +00:00
Eric S. Raymond
617ed57222 Teach wmllint how to catch truncated sound-file names. 2009-09-04 04:22:17 +00:00
Eric S. Raymond
33a61c6a10 Make python tools use hashlib instead of the deprecated md5 module. 2009-05-15 02:29:34 +00:00
Eric S. Raymond
40aa7d0ce5 Oops, don't discard *all* errors. 2009-03-18 14:43:21 +00:00
Eric S. Raymond
11efcc99ec Make wmlscope abort gracefully (without stack trace) on interrupt. 2009-03-18 14:41:39 +00:00
Eric S. Raymond
38aa1e661e Add code to detect image below 72&72 size. 2008-11-14 13:11:48 +00:00
Eric S. Raymond
48cadae1ad Another wmllint hack around the macro processor. 2008-10-14 23:14:35 +00:00
Eric S. Raymond
0d43b36615 Teach wmlscope to selectively ignore multiple macro definitions. 2008-10-14 22:30:21 +00:00
Eric S. Raymond
c014cbe185 Beat wmlscope into not complaining about multiple definitions...
...of the carryover macros (they're conditionalized, but wmlscope
cannot know this).
2008-09-30 01:09:12 +00:00
Piotr Cychowski
748220eff8 Commit patch #1076 2008-06-29 16:52:29 +00:00
Eric S. Raymond
c978a28d52 Add an "alignment" type check to wmllint. 2008-03-20 20:26:51 +00:00
Eric S. Raymond
4a5a030151 Change definition-list format to carry more information. 2008-03-16 10:28:07 +00:00
Eric S. Raymond
5a693050e9 Make the --listfiles option work again. 2008-03-07 11:43:52 +00:00
Eric S. Raymond
43900022cf Improve the duplicate detection...
...so that it normally only triggers on exported IDs.  The
--collisions option check all IDs.
2008-03-07 11:36:44 +00:00
Eric S. Raymond
c2971fed96 Teach wmlscope how to detect duplicate unit IDs. Fix some trivial instances. 2008-03-07 10:19:25 +00:00
Eric S. Raymond
c3facc5d43 Document magic export comments. 2008-02-27 11:48:14 +00:00
Eric S. Raymond
b20adef3e9 Frewall in case of really ill-formed WML. 2008-02-27 02:48:23 +00:00
Eric S. Raymond
c14a607215 Add typelist feature. 2008-02-16 23:56:03 +00:00
Eric S. Raymond
e140ac971f Add the ability to change the warning level with in-line comments. 2008-02-16 09:13:28 +00:00
Eric S. Raymond
de18297a39 Suppress trying to print out macro arity in normal listings. 2008-02-16 08:27:54 +00:00
Eric S. Raymond
6252baf0c9 Allow wmlscope to take multiple --foce-used options, and use the capability. 2008-02-13 18:03:43 +00:00
Eric S. Raymond
fe36193828 Collect statistics on macros with unchecked argument types. 2008-02-13 00:03:30 +00:00
Eric S. Raymond
d1c3678356 Generalize the --from option.
Add an images-unused production so we can find things than need to be
included in animation frames etc.  Note, the report generator emits a
fair number of false positives through not recognizing implicit
references; I'll fix that next.
2008-02-10 18:32:20 +00:00
Eric S. Raymond
0ee463c8cf Enrich macro type checking some more and simplify the type inference rules.
Also head off a potential bug noted by Mordante with WML that
looks like {X_SPAN},{Y_SPAN}.
2008-02-10 09:38:07 +00:00
Eric S. Raymond
28bee542c6 More formal-argument fixups and macro type checking. 2008-02-10 08:05:32 +00:00
Eric S. Raymond
74534ae07b wmlscope can now list macros with untyped formals. 2008-02-10 06:15:29 +00:00
Eric S. Raymond
fc045b288e Impprove reporting of type mismatches. Fix a few more formal args. 2008-02-10 05:18:39 +00:00
Eric S. Raymond
7eb3510fca Implement checking of range, span, and filter types in macros.
Show the type signatures in ythe wmlscope error messages for the mismatches.
2008-02-06 20:22:44 +00:00
Eric S. Raymond
3bf19bb1f1 wmlscope now does some argument type checking of macros.
The logic for deducing expected types from formals needs work.
2008-02-06 11:47:20 +00:00
Eric S. Raymond
2f30f121cc Implement zookeeper's FR #5 from bug #10990
check macro calls for mismatches in argument number.  Fix a few
glitches found in mainline using this test.
2008-02-06 08:17:57 +00:00