Okay, guess I'll get the idea train goin'. How about using
YAML for the config file? I used Valve's KeyValues format initially because it was what the rest of the engine used, but it seems people have trouble matching up braces and ensuring correctness. I think YAML might benefit those editing the file by hand.
Here's a sample of YAML for your viewing pleasure:
receipt: Oz-Ware Purchase Invoice
date: 2007-08-06
customer:
given: Dorothy
family: Gale
items:
- part_no: A4786
descrip: Water Bucket (Filled)
price: 1.47
quantity: 4
- part_no: E1628
descrip: High Heeled "Ruby" Slippers
price: 100.27
quantity: 1
bill-to: &id001
street: |
123 Tornado Alley
Suite 16
city: East Westville
state: KS
ship-to: *id001
specialDelivery: >
Follow the Yellow Brick
Road to the Emerald City.
Pay no attention to the
man behind the curtain.
Here's the design goals of YAML:
- YAML is easily readable by humans.
- YAML matches the native data structures of agile languages.
- YAML data is portable between programming languages.
- YAML has a consistent model to support generic tools.
- YAML supports one-pass processing.
- YAML is expressive and extensible.
- YAML is easy to implement and use.
Another thing is that I really want a way to add comments to the config file programmatically; unfortunately neither KeyValues nor YAML makes that easy (YAML does have a comment syntax defined though). It would be difficult to keep track of what comment goes on what line.