I've written a rudimentary DF raws parser. It's to the point where it can do basic checks like missing ]'s, duplicate definitions, and very limited checking for tags that don't belong in the current [OBJECT] scope.
Examples:
$ $DFCONFIG/config_file.py raw/objects/item_weapon.txt
raw/objects/item_weapon.txt: 22 toplevel objects
$ $DFCONFIG/config_file.py raw/objects/item_weapon.txt /tmp/item_weapon_copy.txt
raw/objects/item_weapon.txt: 22 toplevel objects
/tmp/item_weapon_copy.txt:5: [ITEM_WEAPON:ITEM_WEAPON_WHIP]: ITEM_WEAPON_WHIP: defined both here and raw/objects/item_weapon.txt:5
And, after editing item_weapon_copy.txt a little:
$ $DFCONFIG/config_file.py /tmp/item_weapon_copy.txt
/tmp/item_weapon_copy.txt:6: Tag is not closed before next [
And typo-ing it a bit more:
$ $DFCONFIG/config_file.py /tmp/item_weapon_copy.txt
/tmp/item_weapon_copy.txt:5: [ITEM_WEPON:ITEM_WEAPON_WHIP]: Unknown top-level tag: [ITEM_WEPON:ITEM_WEAPON_WHIP]
My eventual goal is a tool to assist in merging mods together at a more conceptual level than a text-based merge (shades of modbase!), but it's still far from usable for that. It
can preserve comments and formatting though.
It's entirely within the scope of this project to check references to other objects, like reagents, products, and body parts. But noone's done that yet. You could be the first!
The code's at:
http://github.com/pwildani/dfconfigIt requires python3.