Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: allow use of switches and random switches as procedures #66

merged 7 commits into from Dec 29, 2019


Copy link

@glx22 glx22 commented Nov 24, 2019

NFO output seems correct, but ID handling and generation needs work. For now 2 different procedures can have the same ID.
Work probably needed in other areas too. That's why it's a draft.

Feel free to add commits in my branch.

@glx22 glx22 force-pushed the procedure branch 5 times, most recently from 4430190 to 4828210 Compare Nov 25, 2019
Copy link

@andythenorth andythenorth commented Dec 15, 2019

I've tested this with a single stored procedure in Iron Horse.
Branch is

This replaces global-switch-and-registers with checking a procedure result. It makes more readable code. It's not a very interesting test case but eh. Appears to work.

@glx22 glx22 marked this pull request as ready for review Dec 18, 2019
Copy link
Contributor Author

@glx22 glx22 commented Dec 18, 2019

I think it's ready now.

nml/expression/ Outdated Show resolved Hide resolved
nml/expression/ Outdated Show resolved Hide resolved
Copy link

@andythenorth andythenorth commented Dec 29, 2019

One final +1: I have converted Iron Horse to use procedures widely, and have compiled hundreds of times now using nmlc built with this PR. Zero issues so far.

@LordAro LordAro merged commit 862c1c3 into OpenTTD:master Dec 29, 2019
12 checks passed
@glx22 glx22 deleted the procedure branch Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

5 participants