26.08.2010, 15:13
(
Last edited by Remis; 25/02/2011 at 03:26 PM.
)
PAWN: Missing angle brackets finder
Picture of the new GUIAbout
This script, written in Perl, analyses your script in terms of angle brackets ( { }).
It tells you which bracket(s) have/has a missing bracket, so you can fix your code (the pawn compiler is buggy in this aspect. If there is one or more angle bracket missing somewhere, it outputs wrong errors or even crashes, so you have to go line-by-line).
It can also help you if you don't even know whether brackets are the problem and where to find them. This script isn't 100% accurate because it isn't psychic:
if(..)
{
if(..)
{
}
How could the script guess whether the first if or the seconds if has the missing pair?
But this script helps you in this case by telling you roughly where to look for a missing bracket.
It is released under the creativecommons 3 (http://creativecommons.org/licenses/by/3.0/)
Installation
You need to have the Perl VM installed. If you are using Windows, you have to install Perl at first.
Linux based systems and many other operating systems have it installed by default.
1. Go to http://www.activestate.com/activeperl/downloads and download it (the first one, Windows (x86))
2. Install activeperl
3. Download and unzip brackets.zip and start „missing brackets finder.exe“.
If activeperl is installed, a GUI should shown up.
The „perl“ folder inside is needed by the executable, so don't delete the folder.
If you are using a linux based system, just open the terminal and run „perl GUI.pl“. You also need to have the perl module „Tkx“ installed (you can install Tkx with the package installer: apt-get, yum, ..).
("missing bracket finder.exe" is compiled with mingw, "missing brackets finder alternative.exe" is compiled with the VC++ one (could complained about missing .dlls if you don't have the latest .net installed, thats why I replaced it))
Download (1.1.0 final)
1. Attachment
2. http://jeffersongta.de/downloads/brackets.zip
Source of everything is included
Known issues
- it reported a line, you go to the line but there isn't a missing bracket: Look for the missing bracket around the area where the bracket was reported (the function, ..) (should happen rarely - in investigation)
- works with large scripts (80k+ lines), but at the cost of memory (~60 MB) and execution time (won't be fixed. Rewritting in a programming language such as C++ would take too much time. I needed the dynamics of languages such as perl for this application)
- you are not able to move and touch the window while it is analyzing a script (won't be fixed.)
Changelog
Beta 5 → Final 1:
- Fixed problems with ' and „ in comments („// don't“ << made the script not working)
- create a how-to gallery, so EVERYONE is able to use this
Final 1 → Final 1.1:
- Easier to use
- Fixed many bugs
- GUI
- faster, improved most of the code
Credits
www.perl-community.de (GwenDragon and MatthiasW): Helped me using Text::Balanced, fixing some bugs and stripping out strings (text inside quotes) and gave me more tips in perl