🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Detour with a mop.

Published February 08, 2009
Advertisement
My work at making generators able to be declared as phrases took a little detour today when I realized that I couldn't read the build method code anymore. Making phrases work was a good deal of hackery; copy/paste/edit/tweak until it worked. Type parameterization and yield got added onto that. The result was a 1010 line recursive method that took 13 parameters. [dead]

And that's not even the part of code that generates runtime tokens. It's just the code to make a type definition for a method declaration. I'd been meaning to clean it up, and now's a good a time as any. This should also allow type parameterization in phrases (which was missing) and phrase yield methods too. I broke the 'simple' case of non-phrase method into about a half dozen smaller methods. It's still not quite readable, but a lot better.

That leaves the other three parts of the big method: the first part of a phrase, the last part of a phrase, and the stuff in between. Then some added cleanup (or perhaps a second iteration of refactoring).

Ideally it'll get done for next weekend, leaving debugging the new features.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement