Closed ciplogic closed 5 years ago
There is still another bug. But it is a bit too late for me to investigate. At least now there is no DATA error in "Poetry" "game".
I hope to look into it tomorrow and hopefully find the other causes.
I was trying to make "next phase" being:
"1 GOTO inliner"
The construct is this:
1 INITIAL_COMMANDS: GOTO 5
2 (something)
...
5 SOME_COMMANDS : GOTO 2
And after this I should have:
1 INITIAL_COMMANDS: SOME_COMMANDS
2 (something)
...
5 SOME_COMMANDS : GOTO 2
And I am hitting a wall with "clone" method. As I need to clone "SOME_COMMANDS" into line 1, is it a proper way to do it? I noticed that the clone method is not doing too much (it instantiate via reflection the final class and sets "NAME" to be of that specific code). Should I copy the "SOME COMMANDS" into a string, parse them and get the line out of it? (it looks a nice enough solution, but I am not sure if this is what is the way or is other nicer way).
That clone method is used at parse time to make an instance clone of the specimen of the command that the parser has used to determine which command it actually is. It wasn't meant to be used to create a clone of a fully populated instance. Your solution with just parsing the remaining commands as a string sounds feasible to me.
Also, I extracted compiling individual tests, so if needed is much easier to run an individual file test