Hey there,
So I've spent the last couple weeks working on an arcade shooter for my computer science final. Everything's gone really well so far, and the code's grown to around 500 lines. But I was adding comments to some sections of my code earlier today, and after I had finished I tried to run my program. I got a compile error, "unexpected token: void", highlighting the very last line of a tab I wasn't even editing.
I've gotten an error on a miscellaneous tab before, it turned out that I forgot a curly brace way over in something else. I only edit one block of code at a time (to make bughunting easier if one creeps up), so it didn't take long to find the missing brace in that situation. In this current instance I added comments to a sizable tab that didn't have any comments before, but I'm pretty sure that's all I did (though I must be wrong). For some reason it broke my code.
After much searching I still couldn't find the error. Methods I've tried:
1. My project is too interconnected to comment out blocks to find the one that's causing the issue.
2. I've tried inserting a decoy syntax error into various places in the code, then compiling to see if it picks up the decoy error before the mystery error, to find the relative location of the mystery error.
3. I've also gone through the code by hand, but it's frustrating to look through code that you know you've written correctly, and I feel like I'd miss the error if I skimmed right over it.
What's the best way to find an error that eludes the error-checker?
Here's the source, if anyone's interested. No need to find the actual error, advice will hopefully be enough.
http://encodable.com/cgi-bin/filechucker.cgi?action=landing&path=/&file=warpdrv.zip
An older version of the exported applet, it should pretty much look like this if it compiles right:
http://nik-storage.s3.amazonaws.com/warpdrv/index.html
So I've spent the last couple weeks working on an arcade shooter for my computer science final. Everything's gone really well so far, and the code's grown to around 500 lines. But I was adding comments to some sections of my code earlier today, and after I had finished I tried to run my program. I got a compile error, "unexpected token: void", highlighting the very last line of a tab I wasn't even editing.
I've gotten an error on a miscellaneous tab before, it turned out that I forgot a curly brace way over in something else. I only edit one block of code at a time (to make bughunting easier if one creeps up), so it didn't take long to find the missing brace in that situation. In this current instance I added comments to a sizable tab that didn't have any comments before, but I'm pretty sure that's all I did (though I must be wrong). For some reason it broke my code.
After much searching I still couldn't find the error. Methods I've tried:
1. My project is too interconnected to comment out blocks to find the one that's causing the issue.
2. I've tried inserting a decoy syntax error into various places in the code, then compiling to see if it picks up the decoy error before the mystery error, to find the relative location of the mystery error.
3. I've also gone through the code by hand, but it's frustrating to look through code that you know you've written correctly, and I feel like I'd miss the error if I skimmed right over it.
What's the best way to find an error that eludes the error-checker?
Here's the source, if anyone's interested. No need to find the actual error, advice will hopefully be enough.
http://encodable.com/cgi-bin/filechucker.cgi?action=landing&path=/&file=warpdrv.zip
An older version of the exported applet, it should pretty much look like this if it compiles right:
http://nik-storage.s3.amazonaws.com/warpdrv/index.html
1