HairyDude / pdxparse

A parser for scripts used in Paradox Development Studios games, written in Haskell
MIT License
6 stars 7 forks source link

Defer localisation #11

Closed HairyDude closed 7 years ago

HairyDude commented 8 years ago

In src/EU4/Common.hs, the function triggerEvent tries to find the localized name of the event being triggered by guessing its localization key. This is only necessary because we currently do localization up front, while parsing. If we instead delay localization until needed (i.e. when pretty-printing), it can be looked up from the event itself instead.

This implies parsing all data files before producing any output. It would also eliminate the current special case of parsing idea groups before anything else, and remove the dependency of src/EU4/Common.hs on src/EU4/IdeaGroups.hs.

HairyDude commented 8 years ago

The dependency actually hasn't been broken, in fact src/EU4/Common.hs now depends on all the feature modules.

HairyDude commented 7 years ago

This was fixed ages ago.