airbreather / StepperUpper

Some tools for making STEP happen.
MIT License
9 stars 2 forks source link

Improve String Templating #13

Open airbreather opened 7 years ago

airbreather commented 7 years ago

Right now, you can have just a few "template parameters" for the XML file, and they're all hardcoded. They're also implemented by just chaining calls to String.Replace.

This could perhaps be slightly better by instead using chained calls to StringBuilder.Replace so we don't have to keep reallocating and copying entire new strings each time.

Better still would be something like ANTLR's StringTemplate that's actually designed to deal with string templates, and therefore probably allow it to use a less "fixed" set of template parameters.

airbreather commented 7 years ago

The fact that StringTemplate is used by the Creation Kit itself is a really good reason to strongly consider using that tool.