ChiefOfGxBxL / WC3MapSpecification

The specification of WC3 .w3x files as a living document
MIT License
15 stars 4 forks source link

Formal grammars for WTS and TXT #9

Open WaterKnight opened 1 year ago

WaterKnight commented 1 year ago

Hi,

do we have formal grammars for WTS and TXT?

WTS can have comments with double forward slashes and there are edge considerations like what if there are no line breaks between the curly braces and the content string or in between different strings or if the string can be quoted or how to use curly braces in the content string etc.

TXT probably follows an INI specification but there are different INI variants. Here, you can have comments with double forward slashes, too (did not test hashtag or semicolon as it's often in other INIs). Values can be double quoted on the right side, otherwise the comma serves as a value separator.

There is a number of things that can go wrong in detail when writing a parser or serializer.

ChiefOfGxBxL commented 1 year ago

Hi @WaterKnight Thank you for letting me know about this. I wasn't aware of all these details, but will look into it.

WaterKnight commented 1 year ago

I have started something here without considering all the edge cases yet.