1. You don't always have to specify the length of arrays.
While you can specify the length of arrays, you don't have to. This can work in two different ways. One is with a list of numbers, such as int x[] = {1, 6, 7, 9}. The next is with strings. int y[] = "hello world". Your code shows these as errors.
I think this is now fixed. I was also assuming giving an array size was an error if you initialized an array (i.e. "int x[8] = {1, 2, 3};"), but I found a script that actually did this on PureZC, so I assume that's OK syntax-wise as well.
2. Object functions seem to cause errors when in for loops.
You can grab the number of items, guys, weapons, etc. on the screen with the Screen->NumWhatever() methods. Your code seems to see these as errors, stating "missing update expression of for-loop". An example would be "for(int i = 1; i <= Screen->NumLWeapons(); i++)".
Fixed, at least for the use case you gave.
3. There are times when the script shows "Variable declaration shadows prior variable" incorrectly.
I'm assuming this error is supposed to signal when a variable has already been declared. However, in my situation, that's not really the case. The variables were used before, but in a different scope. In my situation, I had quite a bit of if statements and loops, so I'm guessing your detection to determine the scope is just slightly off.
This should be fixed for variables in functions. Using a global variable as the iterator in a for-loop is still incorrectly flagged as an error, I'll fix that next.
Also, there are a couple things I noticed.
- There's no good way to find out if a closing brace has a partner or not. You do mark its partner with a box, but I'd suggest looking at Notepad++. In it, the braces change colors. Both of them change color. If it doesn't, then you know it doesn't have a partner brace.
- Sometimes the popup when you hover over an error doesn't seem to want to come up.
I've updated the demos so that they highlight both the matching brace and the one at the caret position. This is not yet enabled in the RText download (though it has been updated for the other issues you pointed out).
As for the popup not showing up, I think that's related to uncaught parsing errors. It's always the last error in the file, right? I believe I've fixed this, in the common cases at least.
@King Harkinian, let me know if you still have problems. I have not yet verified whether you can omit semicolons for while-loops if they're at the end of a code block, so I didn't change that yet.