varScoper 1.1 – now with cfscript parsing
That’s right, my varScoper tool now supports cfml written within cfscript blocks. Please note that this is still somewhat experimental, but seems to handle quite a few scenarios.
After looking at Zac’s code, I decided to take it to the next level and complete the code required to identify variables created within cfscript blocks.
The code will even ignore variables created within comments, but unfortunately does not include the ability to identify the line number of the variable (which it does within tags). You can still jump directly to the method, but you’re on your own to find the variable.
You can even identify variables created within for loops and if/else blocks. Here’s an example…
for(correctLoop=1;correctLoop LTE 10; correctLoop=correctLoop+1) correctSimpleVar = correctLoop;
In this example correctLoop, and correctSimpleVar will both be identified with the tool.
For those of you who aren’t aware of varscoper, it is a code analyzer that will look for variables without a var statement that exist within a cffunction. I released the tool last July and cfscript support has been the #1 request.
Additionally, I am now hosting the project at RIAforge at http://varscoper.riaforge.org/, you can look there for SVN access.
Please take a minute to test out the code and please let me know ASAP if you can find any cases that the cfscript code doesn’t cover.