OpenTTD / nml

NewGRF Meta Language
GNU General Public License v2.0
43 stars 36 forks source link

Fix: Register named parameters earlier #301

Closed glx22 closed 11 months ago

glx22 commented 1 year ago

Named parameters are registered during pre_process step, which can be too late. Move the registration to register_names step.

frosch123 commented 11 months ago

@glx22 Is it possible to add a simple regression test case for this?

glx22 commented 11 months ago

I'm not even sure it's possible to actually see the effect of this PR without more changes. If I use https://github.com/OpenTTD/nml/pull/302/commits/5a5b4818a0e180b05dbbd0ef368aada88d992ba1 (and a named param for house id in 030) without this PR I get "unrecognized identifier", with the PR it becomes "Expected a compile-time integer constant"